Skip to main content
2 of 2
edited tags
Evan Carroll
  • 64.7k
  • 49
  • 251
  • 496

ERROR: invalid GeoJson representation

the GeoJSON Spec show,

{
  "type": "Feature",
  "geometry": {
    "type": "Point",
    "coordinates": [125.6, 10.1]
  },
  "properties": {
    "name": "Dinagat Islands"
  }
}

But when I wrap that in a call to ST_GeomFromGeoJSON, like this,

SELECT ST_GeomFromGeoJSON($${                                                                                                                          
  "type": "Feature",                                                                                                                                   
  "geometry": {                                                                                                                                        
    "type": "Point",                                                                                                                                   
    "coordinates": [125.6, 10.1]                                                                                                                       
  },                                                                                                                                                   
  "properties": {                                                                                                                                      
    "name": "Dinagat Islands"                                                                                                                          
  }                                                                                                                                                    
}$$);

I get the error,

ERROR: invalid GeoJson representation

Evan Carroll
  • 64.7k
  • 49
  • 251
  • 496