[Geoserver-devel] GetCapabilities JSON format

Hi Devs

I notice from https://docs.geoserver.org/latest/en/user/services/wms/reference.html#getcapabilities and https://docs.geoserver.org/latest/en/user/services/wms/vendor.html#getcapabilities-request that XML is the only response format option for the GetCapabilities call, and I wonder why that is, and if it is technically not possible to return the response in application/json format?

I am sure that the OGC spec states XML only, but can JSON be supported as a vendor option?

Is there just insufficient demand for the format?

If I wanted to implement this format, can you give me any pointers? Is GetCapabilitiesTransformer.java only for XML and would need an equivalent for JSON?

Thanks

Peter

Hi Peter,
yes, in general the OGC service allow alternative formats for outputs, although normally they are found for
data requests such as GetFeature/GetCoverage/GetMap. The capabilities document must be supported in the mandated
XML variant, and a standard client will look for that format: there is less incentive to support other formats.

That said, it’s possible. Two considerations:

  • You’ll have to hand write a JSON encoding for each protocol and version (cap documents can be very long, they are typically hand-crafted to avoid loading everything in memory)
  • OGC APIs (available as GeoServer community modules) are instead JSON native first, although still in flux specification wise
  • If you really want to go that way, I’d look around and see if any other project attempted that way, to avoid having multiple incompatible JSON variants out there.
    Cheers

Andrea

···

Regards,

Andrea Aime

==
GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

https://www.geosolutionsgroup.com/

http://twitter.com/geosolutions_it


Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail