2
votes

Using EnterpriseDB's GUI installer, I installed Postgres 9.3.5 on my Mac running Mavericks. I selected the option to install spatial components and PostGIS 2.1.3 was installed automatically. After enabling the PostGIS extension, I was able to perform geography calculations as expected. I then discovered the ST_GeomFromGeoJSON function (because I'm a noob), tried to use it, and realized that I needed to install JSON-C, which I did.

The PostGIS documentation says "To enable JSON-C, run configure --with-jsondir=/path/to/json-c. See Section 2.4.1, 'Configuration' for details." The "Configuration" section is all about installing PostGIS from scratch.

So, two questions: 1. Can I enable JSON-C for PostGIS without rebuilding PostGIS? 2. If not, how can I ensure my new PostGIS install includes all the features that were installed automatically the first time? I had no visibility into what the installer was doing, so I don't know which, if any, of the 12 "--with" options were used.

I am brand new to Postgres/PostGIS and fairly new to command-line wizardry. All help is appreciated.

1
You'd need to ask EnterpriseDB to update their packages to enable that in PostGIS. You can't really do it yourself without recompiling PostGIS, which is not the friendliest process in the world.Craig Ringer
(The reason it's hard isn't that PostGIS its self is hard to compile, it's satisfying the dependencies like libgeos)Craig Ringer
@CraigRinger, in my experience of building Postgres/Postgis from source, the real pain point is GDAL, for what it is worth.John Powell
Also worth noting that installing using the EnterpriseDB installer is risky. Going through a package maanger like brew or yum is much much less likely to cause this.Frank Conry

1 Answers

0
votes

Questions:

  1. Can I enable JSON-C for PostGIS without rebuilding PostGIS?
  2. If not, how can I ensure my new PostGIS install includes all the features that were installed automatically the first time?

No, this needs to be configured and compiled. It sounds like a standard feature that EnterpriseDB should include, so if you would like this method, then as Craig suggested, request it.

There are several options for OSX. The Homebrew method looks like a good one.

brew install postgis