First -

Thanks to Simon for an interesting angle on how to load gml data into PostGIS. Using Postgres xml operators combined with the Postgis ST_GeomFromGML() function is a new one for me :-)

However, the "standard" open source procedure for loading gml files into PostGIS would be to use the OGR2OGR command-line tool (and not psql) for this operation.  More information on OGR2OGR : https://gdal.org/programs/ogr2ogr.html and https://www.gisinternals.com/

More specific information on GML -> PostGIS using OGR2OGR: https://gis.stackexchange.com/questions/302944/using-ogr2ogr-to-convert-multiple-gml-files-to-a-postgis-table.

And Shao, I would kindly like to second Barend Köbben's suggestion, that you do some self study on the subjects of database schemas and PostGIS technology. There is a ton of information waiting for you just by using google search with the relevant search words. If you prefer your information in a book form, i can recommend "PostGIS in Action, 2. edition" for a primer in PostGIS and spatial databases. Available from Amazon. This book include information about both OGR2OGR and general SQL

--
Med venlig hilsen / Kind regards

Bo Victor Thomsen
GIS- and Database specialist
AestasGIS Denmark


Den 01-09-2019 kl. 09:13 skrev Simon (SPDBA) Greener:
Yes.

One method is to copy the gml into a table (column declared as text or xml). Then use XML XQUERY  processing to shred the GML document into nodes that ST_GeomFromGML() can consume.

Simon

39 Cliff View Drive, Allens Rivulet, Tas 7150
(H) 0362396397
(M) 0418396391
<http://www.spatialdbadvisor.com>www.spatialdbadvisor.com <http://www.spatialdbadvisor.com> / <http://www.spdba.com.au>www.spdba.com.au <http://www.spdba.com.au>

Sent from BlueMail <http://www.bluemail.me/r?b=15487>
On 1 Sep. 2019, at 16:57, Shaozhong SHI <[email protected] <mailto:[email protected]>> wrote:

    Hi, all,
    Can psql copy gml into postgis?
    Regards,
    Shao

    ------------------------------------------------------------------------

    postgis-users mailing list
    [email protected]
    https://lists.osgeo.org/mailman/listinfo/postgis-users


_______________________________________________
postgis-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/postgis-users

_______________________________________________
postgis-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/postgis-users

Reply via email to