-
Notifications
You must be signed in to change notification settings - Fork 0
GML conversion
xml-to-postgres
contains a rudimentary GML parser that can convert certain flavors of GML (embedded in the XML document) to the binary EWKB format that PostGIS uses internally for geometries. This is hilariously fast but also an evil ugly hack if ever there was one. It is in no way a complete, standards-compliant GML parser, nor will it ever be. It has been succesfully used to convert a subset of the GML 3.2 Simple Features Profile, but it will fail on many valid GML datasets and may subtly corrupt others. Use this feature at your own risk and do verify that it generates the geometries it should.
A safer though slower way to use xml-to-postgres
to import GML is to use the xml-to-text conversion on the XML element that contains the GML to read the entire GML text into PostgreSQL. Then use a query like this to let PostGIS do the conversion:
UPDATE <table> SET <geometry_column> = ST_GeomFromGML(<gml_column>)