1

I want to export a XSD from a GML. I already have the GML and I want to export a XSD that fits the GML

For an ETL tool we've programmed, people have to deliver a GML, XML and XSD. Those people already have a GML and XML, the ETL tool also requires an XSD. So I'm looking for an easy way to export an XSD that fits the GML

Is it possible to make an export in QGIS or ArcMap?

5
  • 1
    Would you be able to edit your question to explain the significance of your arcmap tag, please?
    – PolyGeo
    Oct 29, 2014 at 10:44
  • I don't know why You want to export GML to XSD, but OGC already has schemas for GML. If a consultant has asked for the schemas, when you can send the schemas from OGC. They are the official schemas for GML anyway. Oct 29, 2014 at 13:30
  • Hello Ulf, Thanks for your comment. For an ETL tool we've programmed, people have to deliver a GML, XML and XSD. Those people already have a GML and XML, the ETL tool also requires an XSD. So I'm looking for an easy way to export an XSD that fits the GML
    – user39861
    Oct 29, 2014 at 13:59
  • To me it seems the XML contains GML references but its not purely GML, something like AIXM data for aviation extranet.eurocontrol.int/http://webprisme.cfmu.eurocontrol.int/… so you would need the XSD I guess for what you need. What ETL tool are you using? Oct 29, 2014 at 16:59
  • Thanks user 30184. With you help I found the following GUI; ogr2gui.ca/en/index.php Works perfect for my cause!
    – BH.
    Oct 30, 2014 at 14:47

2 Answers 2

1

You can create .xsd schema file by rewriting your GML with ogr2ogr. Writing schema into .xsd file is the default in GML driver http://www.gdal.org/drv_gml.html so you can simply use this command:

ogr2ogr -f GML output.gml input.gml

You do not need the output.gml file for anything so you can delete it and use the .xsd. If your source GML is big you can create .xsd faster by converting just one feature into the dummy gml:

ogr2ogr -f gml output.gml input.gml -dialect sqlite -sql "select * from input_layer limit 1"

The layer name to be used instead of "input_layer" can be checked by listing the layers with ogrinfo:

ogrinfo input.gml
-1

My previous account is somehow not reachable anymore, because I used the same emailadres for this account.

But on topic: The XML contains metadata for the GML, so there is extra information in the XML. We need the XSD for the ETL, is a self build ETL tool. The XSD makes the conditions for the acceptation of the data in the ETL.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.