Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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>

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?

share|improve this question
Your srsName looks weird. Why not just EPSG:28992? Can you try using <gml:coordinates>275466.0, 565559.0, 0.0</gml:coordinates> instead of <gml:pos>...? – nagytech Jul 12 '12 at 0:03
up vote 1 down vote accepted

You may need to upgrade to the latest version of PostGIS. There is an interaction between older versions of PostGIS and the latest version of libxml2 that causes this problem.

share|improve this answer
For now I will try hardcoding removal of "gml:" from the xml in my python script as this will be easier then asking my client to upgrade their database ;-) – milovanderlinden Apr 21 '13 at 9:52

Try specifying that the point is in 3D space with:

<gml:pos srsDimension="3">275466.0 565559.0 0.0</gml:pos>

Or drop the extra coordinate (if it isn't important).

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.