Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON export from GML #18

Open
TomPohys opened this issue Jan 28, 2014 · 0 comments
Open

JSON export from GML #18

TomPohys opened this issue Jan 28, 2014 · 0 comments
Assignees

Comments

@TomPohys
Copy link
Member

JSON export is going to be a conversion of XML (OGC GML) to JSON.

Use: https://github.com/hay/xml2json

like:
python xml2json.py --strip_newlines --strip_text --pretty ~/Downloads/5514.xml
on XML with removed namespaces (e.g. xlink:, epsg: lowercase!, xmlns:.*", gml:)

Example:

{
    "ProjectedCRS": {
        "@id": "ogp-crs-5514",
        "baseGeodeticCRS": {
            "@href": "urn:ogc:def:crs::4156"
        },
        "cartesianCS": {
            "@href": "urn:ogc:def:cs::4499"
        },
        "conversion": {
            "@href": "urn:ogc:def:coordinateOperation::5510"
        },
        "domainOfValidity": {
            "@href": "urn:ogc:def:area::1306"
        },
        "identifier": {
            "#text": "urn:ogc:def:crs::5514",
            "@codeSpace": "OGP"
        },
        "metaDataProperty": {
            "CommonMetaData": {
                "alias": {
                    "@alias": "S-JTSK / Krovak EN (G)",
                    "@code": "17802",
                    "@codeSpace": "urn:ogc:def:naming-system::7302",
                    "remarks": "Uses Greenwich meridian."
                },
                "changes": {
                    "changeID": {
                        "@href": "urn:ogc:def:change-request::2011.039"
                    }
                },
                "informationSource": "Land Survey Office (ZU), Prague. www.cuzk.cz/zu",
                "isDeprecated": "false",
                "revisionDate": "2011-05-09",
                "show": "true",
                "type": "projected"
            }
        },
        "name": "S-JTSK / Krovak East North",
        "remarks": "Greenwich-based alternative to S-JTSK (Ferro) / Krovak East North, CRS code 5221.",
        "scope": "GIS. Due to distortions in survey network introduced after the initial realisation the projection has an inaccuracy of several decimetres."
    }
}

for

<?xml version="1.0" encoding="UTF-8"?>
<gml:ProjectedCRS xmlns:epsg="urn:x-ogp:spec:schema-xsd:EPSG:1.0:dataset"
                  xmlns:gml="http://www.opengis.net/gml/3.2"
                  xmlns:xlink="http://www.w3.org/1999/xlink"
                  gml:id="ogp-crs-5514">
   <gml:metaDataProperty>
      <epsg:CommonMetaData>
         <epsg:type>projected</epsg:type>
         <epsg:alias code="17802" codeSpace="urn:ogc:def:naming-system:EPSG::7302"
                     alias="S-JTSK / Krovak EN (G)">
            <epsg:remarks>Uses Greenwich meridian.</epsg:remarks>
         </epsg:alias>
         <epsg:informationSource>Land Survey Office (ZU), Prague. www.cuzk.cz/zu</epsg:informationSource>
         <epsg:revisionDate>2011-05-09</epsg:revisionDate>
         <epsg:changes>
            <epsg:changeID xlink:href="urn:ogc:def:change-request:EPSG::2011.039"/>
         </epsg:changes>
         <epsg:show>true</epsg:show>
         <epsg:isDeprecated>false</epsg:isDeprecated>
      </epsg:CommonMetaData>
   </gml:metaDataProperty>
   <gml:identifier codeSpace="OGP">urn:ogc:def:crs:EPSG::5514</gml:identifier>
   <gml:name>S-JTSK / Krovak East North</gml:name>
   <gml:remarks>Greenwich-based alternative to S-JTSK (Ferro) / Krovak East North, CRS code 5221.</gml:remarks>
   <gml:domainOfValidity xlink:href="urn:ogc:def:area:EPSG::1306"/>
   <gml:scope>GIS. Due to distortions in survey network introduced after the initial realisation the projection has an inaccuracy of several decimetres.</gml:scope>
   <gml:conversion xlink:href="urn:ogc:def:coordinateOperation:EPSG::5510"/>
   <gml:baseGeodeticCRS xlink:href="urn:ogc:def:crs:EPSG::4156"/>
   <gml:cartesianCS xlink:href="urn:ogc:def:cs:EPSG::4499"/>
</gml:ProjectedCRS>
@ghost ghost assigned TomPohys Jan 28, 2014
@klokan klokan mentioned this issue Jan 28, 2014
@klokan klokan modified the milestone: future Nov 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants