3

I am trying to make a column in a table with data type geoJSON, I have been told that it is the same as the geometry data type, but when I insert a geojson in the field it give me an SQL error. I am using phpgeAdmin. I am confused.

1 Answer 1

2

If the field is geometry, then you need to use ST_GeomFromGeoJSON like this,

INSERT INTO table (col)
VALUES ( ST_GeomFromGeoJSON(JSON) )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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