1

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

Postgresql version PostgreSQL 9.1.2

I'm having issues inserting Curves into a PostGIS database using st_geomfromgml(). Basically I'm hitting up Geoserver WFS services and storing returned geometries.

Here is an example of failing GML;

    <gml:Curve xmlns:gml="http://www.opengis.net/gml" srsName="urn:x-ogc:def:crs:EPSG:4326" srsDimension="2">
      <gml:segments>
        <gml:LineStringSegment interpolation="linear">
          <gml:posList>-61.5681 -179.687 -61.52288589853826 -180.0</gml:posList>
        </gml:LineStringSegment>
        <gml:LineStringSegment interpolation="linear">
          <gml:posList>-61.52288589853826 -178.0 -61.5177 -179.9641</gml:posList>
        </gml:LineStringSegment>
      </gml:segments>
    </gml:Curve>

Yet if I split this up into multiple inserts like;

    <gml:Curve xmlns:gml="http://www.opengis.net/gml" srsName="urn:x-ogc:def:crs:EPSG:4326" srsDimension="2">
      <gml:segments>
        <gml:LineStringSegment interpolation="linear">
          <gml:posList>-61.5681 -179.687 -61.52288589853826 -180.0</gml:posList>
        </gml:LineStringSegment>
      </gml:segments>
    </gml:Curve>

    <gml:Curve xmlns:gml="http://www.opengis.net/gml" srsName="urn:x-ogc:def:crs:EPSG:4326" srsDimension="2">
      <gml:segments>
        <gml:LineStringSegment interpolation="linear">
          <gml:posList>-61.52288589853826 -178.0 -61.5177 -179.9641</gml:posList>
        </gml:LineStringSegment>
      </gml:segments>
    </gml:Curve>

It works fine. What is incorrect with the original GML?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.