[postgis-users] Whats wrong with this geometry?

Paul Ramsey pramsey at cleverelephant.ca
Tue Jan 17 14:51:44 PST 2023


Actually not the handling of 3d, but where we expect the srsDimension to be declared. We'd prefer it on the poslist element

select ST_GeomFromGML('
<gml:Polygon srsName="urn:ogc:def:crs:EPSG::28992"  xmlns:gml="http://www.opengis.net/gml/3.2">
  <gml:exterior>
    <gml:LinearRing>
      <gml:posList count="35" srsDimension="3" >85553.17 444954.729 0.0 85553.307 444954.394 0.0 85555.891 444948.14 0.0 85560.257 444937.574 0.0 85561.733 444934.001 0.0 85566.998 444936.176 0.0 85569.692 444937.289 0.0 85571.391 444937.991 0.0 85570.88 444939.22 0.0 85580.227 444943.09 0.0 85579.371 444945.159 0.0 85570.021 444941.288 0.0 85554.298 444979.132 0.0 85563.714 444982.97 0.0 85562.849 444985.058 0.0 85553.439 444981.201 0.0 85543.245 445005.737 0.0 85552.684 445009.574 0.0 85551.822 445011.652 0.0 85542.385 445007.806 0.0 85540.702 445011.858 0.0 85540.669 445011.845 0.0 85540.384 445011.728 0.0 85540.306 445011.696 0.0 85532.596 445008.541 0.0 85532.755 445008.222 0.0 85533.028 445008.382 0.0 85533.061 445008.303 0.0 85552.172 444962.119 0.0 85552.377 444961.625 0.0 85553.85 444958.064 0.0 85554.257 444957.082 0.0 85554.339 444956.884 0.0 85554.941 444955.428 0.0 85553.17 444954.729 0.0</gml:posList>
    </gml:LinearRing>
  </gml:exterior>
</gml:Polygon>
');


> On Jan 17, 2023, at 2:42 PM, Paul Ramsey <pramsey at cleverelephant.ca> wrote:
> 
> It's the higher dimensionality, seems like we don't like that. 2D works.
> 
> select ST_GeomFromGML('
> <gml:Polygon srsName="urn:ogc:def:crs:EPSG::28992" srsDimension="3"  xmlns:gml="http://www.opengis.net/gml/3.2">
>  <gml:exterior>
>    <gml:LinearRing>
>      <gml:posList count="35">85553.17 444954.729 85553.307 444954.394 85555.891 444948.14 85560.257 444937.574 85561.733 444934.001 85566.998 444936.176 85569.692 444937.289 85571.391 444937.991 85570.88 444939.22 85580.227 444943.09 85579.371 444945.159 85570.021 444941.288 85554.298 444979.132 85563.714 444982.97 85562.849 444985.058 85553.439 444981.201 85543.245 445005.737 85552.684 445009.574 85551.822 445011.652 85542.385 445007.806 85540.702 445011.858 85540.669 445011.845 85540.384 445011.728 85540.306 445011.696 85532.596 445008.541 85532.755 445008.222 85533.028 445008.382 85533.061 445008.303 85552.172 444962.119 85552.377 444961.625 85553.85 444958.064 85554.257 444957.082 85554.339 444956.884 85554.941 444955.428 85553.17 444954.729</gml:posList>
>    </gml:LinearRing>
>  </gml:exterior>
> </gml:Polygon>
> ');
> 
> 
>> On Jan 17, 2023, at 2:02 AM, Valentijn Makkenze <V.Makkenze at vicrea.nl> wrote:
>> 
>> Hi,
>> 
>> I have this geometry from an opensource dataset but postgis says its an invalid GML representation.
>> 
>> select ST_GeomFromGML('
>> <gml:Polygon srsName="urn:ogc:def:crs:EPSG::28992" srsDimension="3"  xmlns:gml="http://www.opengis.net/gml/3.2">
>>  <gml:exterior>
>>    <gml:LinearRing>
>>      <gml:posList count="35">85553.17 444954.729 0.0 85553.307 444954.394 0.0 85555.891 444948.14 0.0 85560.257 444937.574 0.0 85561.733 444934.001 0.0 85566.998 444936.176 0.0 85569.692 444937.289 0.0 85571.391 444937.991 0.0 85570.88 444939.22 0.0 85580.227 444943.09 0.0 85579.371 444945.159 0.0 85570.021 444941.288 0.0 85554.298 444979.132 0.0 85563.714 444982.97 0.0 85562.849 444985.058 0.0 85553.439 444981.201 0.0 85543.245 445005.737 0.0 85552.684 445009.574 0.0 85551.822 445011.652 0.0 85542.385 445007.806 0.0 85540.702 445011.858 0.0 85540.669 445011.845 0.0 85540.384 445011.728 0.0 85540.306 445011.696 0.0 85532.596 445008.541 0.0 85532.755 445008.222 0.0 85533.028 445008.382 0.0 85533.061 445008.303 0.0 85552.172 444962.119 0.0 85552.377 444961.625 0.0 85553.85 444958.064 0.0 85554.257 444957.082 0.0 85554.339 444956.884 0.0 85554.941 444955.428 0.0 85553.17 444954.729 0.0</gml:posList>
>>    </gml:LinearRing>
>>  </gml:exterior>
>> </gml:Polygon>
>> ');
>> 
>> ERROR:  invalid GML representation
>> CONTEXT:  SQL function "st_geomfromgml" statement 1
>> 
>> I have no problem processing this GML in other products such as FME or Oracle
>> 
>> Regards,
>> 
>> Valentijn Makkenze
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/postgis-users
> 



More information about the postgis-users mailing list