Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.