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.

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?

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>...? –  Geoist Jul 12 '12 at 0:03
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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.