I have installed PostGIS 2.0 on a Postgres 9.1 database on a Windows 2012 Server.

I need to write an insert query, which uses ST_GeomFromGeoJSON(). The Docs for this query say that I need - JSON-C >= 0.9, and very helpfully give a link on how to configure PostGIS for that.

Unfortunately, the article which talks about configuration, only shows how you configure PostGIS on a Linux system.

What steps do I need, to configure PostGIS 2.0 on windows to use ST_GeomFromGeoJSON?

  • I have PostGIS 2.0 on Windows and never had a problem with ST_GeomFromGeoJSON(). I didn't even know about JSON-C enablement. What error message do you get if you try to run this SQL command? SELECT ST_AsText(ST_GeomFromGeoJSON('{"type":"Point","coordinates":[-48.23456,20.12345]}')) As wkt; – Martin F Oct 23 '13 at 22:08
  • I was getting a weird error with libgeos_c-1.dll not found; But I installed PostGres+PostGIS on a fresh Virtual Machine and it run without any issue; So I guess it was a system specific issue. – Devdatta Tengshe Oct 24 '13 at 2:58

This was a system specific Issue.

I installed PostGres+PostGIS on a fresh Virtual Machine and then ran

select ST_Y(ST_GeomFromGeoJSON('{"type":"Point","coordinates":[-48.23456,20.12345]}')) As Y;

This ran without any issue on the new machine while on the old system it gave an error with libgeoc_c-1.dll not found;

So we can conclude that you don't need to do anything special to get this running on Windows. If you Install PostGIS 2.0 from the 'Application Stack Builder' you can use the ST_GeomFromGeoJSON without any issues.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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