4

I am attempting to insert a geometry into a table using the st_geomfromgml function.

The GML is being sourced from a Geoserver WFS request.

The function call looks like this

st_geomfromgml('<?xml version="1.0" encoding="UTF-8"?><gml:LineString xmlns:gml="http://www.opengis.net/gml" srsName="http://www.opengis.net/gml/srs/epsg.xml#4326" srsDimension="2"> <gml:posList>146.48296 -18.6222 146.48296 -18.6222</gml:posList> </gml:LineString>');

This worked on PostGIS version POSTGIS="1.5.3" GEOS="3.3.1-CAPI-1.7.1" PROJ="Rel. 4.7.1, 23 September 2009" LIBXML="2.7.3" USE_STATS

but fails on POSTGIS="2.0.0 r9605" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.8.0, 6 March 2012" LIBXML="2.7.8" LIBJSON="UNKNOWN"

However I can make it work if I specify three dimensions like so;

select st_geomfromgml('<?xml version="1.0" encoding="UTF-8"?><gml:LineString xmlns:gml="http://www.opengis.net/gml" srsName="http://www.opengis.net/gml/srs/epsg.xml#4326" srsDimension="3"> <gml:posList>146.48296 -18.6222 0 146.48296 -18.6222 0</gml:posList> </gml:LineString>');

Is there a way to keep the geometry in two dimensions and insert it?

closed as off-topic by nmtoken, Andre Silva, Vince, Fezter May 28 '18 at 0:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This problem cannot or can no longer be reproduced. Changes to the system or to the asker's circumstances may have rendered the question obsolete, or the question does not include a procedure to enable potential answerers to reproduce the same symptoms. Such questions are off-topic as they are unlikely to help future readers, but editing them to include more details can lead to re-opening." – nmtoken, Andre Silva, Vince, Fezter
If this question can be reworded to fit the rules in the help center, please edit the question.

  • On closer inspection I note that the points in the LineString are the same, this appears to be the cause of my problem. – tojofo Feb 26 '13 at 0:27