Reputation: 1194
In PostGIS 2.0 I try:
select ST_GeomFromGML(
'<gml:Point srsName="urn:ogc:def:crs:EPSG::28992">
<gml:pos>275466.0 565559.0 0.0</gml:pos>
</gml:Point>');
This gives an error:
********** Error **********
ERROR: invalid GML representation
SQL state: XX000
Context: SQL function "st_geomfromgml" statement 1
What is wrong with my point?
Upvotes: 2
Views: 762
Reputation: 43672
It looks like the parser is assuming a 2D geometry, when you actually have a 3D geometry, even though you might not be using the Z dimension, unless your point is at sea level (it is 0.0). If you explicitly state the dimension attribute, you will get the correct result:
SELECT ST_AsText(ST_GeomFromGML(
'<gml:Point srsName="urn:ogc:def:crs:EPSG::28992">
<gml:pos dimension="3">275466.0 565559.0 0.0</gml:pos>
</gml:Point>'));
st_astext
---------------------------
POINT Z (275466 565559 0)
(1 row)
Upvotes: 1