We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Jsonix: Talking to OGC Web Services in JSON

Formale Metadaten

Titel
Jsonix: Talking to OGC Web Services in JSON
Serientitel
Anzahl der Teile
183
Autor
Lizenz
CC-Namensnennung - keine kommerzielle Nutzung - Weitergabe unter gleichen Bedingungen 3.0 Deutschland:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen und nicht-kommerziellen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen und das Werk bzw. diesen Inhalt auch in veränderter Form nur unter den Bedingungen dieser Lizenz weitergeben.
Identifikatoren
Herausgeber
Erscheinungsjahr
Sprache
Produzent
Produktionsjahr2015
ProduktionsortSeoul, South Korea

Inhaltliche Metadaten

Fachgebiet
Genre
Abstract
Can you talk to OGC Web Services in JSON instead of XML? You can - with Jsonix, a powerful JavaScript tool for XML - JSON conversion. JSON has probably already replaced XML as a "lingua franca". JSON is much lighter and easier to use than XML, especially in JavaScript-based web apps. In the context of GIS, web mapping is dominated by JavaScript libraries like OpenLayers and Leaflet, which speak JSON natively. But what about the standards? Open Geospatial Consortium defines more than 50 specifications with more than 100 individual versions. Technically almost all of them are XML-based and defined by XML schemas. These are de jure and de facto standards, widely used and well supported. So you still need XML processing in JS web mapping apps. Processing XML is no rocket science, but it's seldom a pleasure to implement. The OL3 KML parser is about 2.5KLoc of dense XML parsing. Even a very simple WMS GetCapabilities format is almost 1 KLOC. From this code around 90% is pure XML parsing and only 10% is the processing of the payload. Would not it be nice if we could talk to the OGC Web Services directly in JSON? So that the developers could focus on the 10%, the payload processing, and cut off the 90% (XML handling) of the effort. Jsonix is an open source library for XML - JS conversion which makes it just possible. With Jsonix you can take an XML Schema and generate XML - JS mappings. These mappings allow you to parse XML in the original schema and get your data in pretty JSON. It also works in the opposite direction: you can serialize JSON in XML, which would correspond to the original XML Schema. What makes Jsonix unique is that it is type and structure-safe. On the JSON side, you will get types and structures exactly as they are defined in the original XML Schema. For instance, xs:decimal is converted into a number in number in JSON, repeatable elements are represented by arrays etc. You just need the corresponding mapping. You can generate Jsonix mappings on your own or use one of the pre-generated mappings. The (unofficial) OGC Schemas Project compiles and provides mappings for many of the popular OGC schemas (OWS, WMS, WFS, CSW, SLD and many more). This presentation gives an overview of Jsonix demonstrates its usage by a number of examples.