rgeo / rgeo-proj4

Proj4 extension for rgeo.
MIT License
13 stars 14 forks source link

Not compatible with PROJ.4 v6.0.0 #4

Closed sethdeckard closed 3 years ago

sethdeckard commented 5 years ago

I had proj4 installed via homebrew and everything was working fine until just recently when 6.0.0 was released and then I started getting the following error: Proj4 not supported in this installation.

My first thought was that I needed just rebuild the native extensions for the gem so I did a bundle pristine but still no luck.

Switching back to 5.2.0 works and I've created a homebrew tap for this:

brew tap sethdeckard/proj
brew install sethdeckard/proj/proj
teeparham commented 5 years ago

Thanks for reporting this.

This appears to be a band-aid, but not a long-term solution:

https://github.com/OSGeo/proj.4/issues/836

mjy commented 5 years ago

It seems this is now impacting a system setup with brew install postgis (gets 11.2), could that be right? We're getting "Coordinate system 'proj4' is not supported'? from the rgeo-2.0.1 gem.

mjy commented 5 years ago

@sethdeckard Thanks much for the pointer, it resolved our issues as well. We were working with completely clean systems, so it wasn't cache related.

Moving forward ket me know I can help test things out somehow here, we really appreciate everyones work on this.

mjy commented 5 years ago

To follow up, switching back to 5.2.0 eliminates the first error, but we hit a second:

PG:UdefinedFile: ERROR: could not load library "/usr/local/lib/postgresl/postgis-2.5.0.so ... Library not loaded: /usr/local/opt/proj/lib/libproj.15.dylib. Seems we only have libproj.13.dylib via this route now. Exploring installing proj from source, but clearly need some other fixes.

Update

For others hitting this I think this ultimately let us use @sethdeckard's solution: brew link --overwrite proj, our system was obiously not "clean".

jasonben commented 5 years ago

Anyone have any suggestions on how to get this gem working with alpine linux 3.9? In alpine proj4 is only available in the edge/testing repo and I can't scope to a different version (currently 6.1.0).

MaxMartiFoundry commented 5 years ago

@mjy I've been hitting the same PG:UdefinedFile error and can't get the link command to change anything. I've tried starting fresh, messing with the postgis install, and several other things. Is there a reproducible set of steps I can follow to fix this?

mjy commented 5 years ago

@MaxMartiFoundry I don't have the full list of steps, sorry. IIRC its something like: nuke as much as possible with brew, also nuke your geo gems. Follow Seth's steps, then my link step, then re-install the gems.

Again, sorry this is not very technical. If I hit it again I'll document explicitly here.

tinco commented 4 years ago

I can't get this to work. I did this:

brew uninstall proj
brew tap sethdeckard/proj
brew install sethdeckard/proj/proj
gem uninstall rgeo-proj4
gem install rgeo-proj4

Am I missing a step? Can some other proj installation be on my system, how do I find which one it's linking to?

mjy commented 4 years ago

One of our team hammered at this yesterday.

The take home was to patch. He wrote:

Used brew edit proj and added the following code:

  head do
    url "https://github.com/OSGeo/proj.4.git"
    depends_on "autoconf" => :build
    depends_on "automake" => :build
    depends_on "libtool" => :build
  end
  #### START OF NEW CODE
  patch <<~EOS
    diff -ruN proj-6.1.0/src/proj_api.h proj-6.1.0-new/src/proj_api.h
    --- proj-6.1.0/src/proj_api.h       2019-05-06 02:11:08.000000000 -0300
    +++ proj-6.1.0-new/src/proj_api.h   2019-05-18 21:03:25.000000000 -0300
    @@ -34,7 +34,8 @@
       */

     #ifndef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
    -#error 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
    +#warning 'Defining ACCEPT_USE_OF_DEPRECATED_PROJ_API_H to allow use of deprecated API. This API won't be available in PROJ 7.0.0 and onwards'
    +#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
     #endif

     #ifndef PJ_VERSION
  EOS
  #### END OF NEW CODE

Executed brew reinstall proj -s and then bundle pristine. rake db:create worked.

While it's specific to our software he posted a precise list of commands for a clean install on os x, I've added a gist here- https://gist.github.com/mjy/02fc0bec94a3f0f4da792baad0df1a3f

baramik commented 4 years ago

Hi, all. Any solution on this, except downgrade?

mjy commented 4 years ago

@baramik The patch mentioned above is technically not a downgrade, it's just delaying the inevitable as far as I understand it- i.e. it enables the use of proj 6.2.

peterwake commented 4 years ago

I have created a Gist for anyone looking to get rgeo / proj4 working on a Mac with Homebrew - see https://gist.github.com/peterwake/b0fff0c5c018c655c6d5a4aee86aa8ef

Mange commented 4 years ago

Any chance of getting support for the newer version? It's not just macOS machines that use this gem.

inkstak commented 4 years ago

Hi @teeparham Is there any plan to provide a long-term solution by replacing proj_api.h ? Is it at least possible ?

LocoDelAssembly commented 4 years ago

Looks like brew is starting to install proj version 7.0. The patch mentioned above will no longer work (as the patch itself warned about). Should still work if you force 6.x, though.

sebfie commented 4 years ago

Hello, Do you plan to support version 7?

gpcarmo commented 4 years ago

Looks like brew is starting to install proj version 7.0. The patch mentioned above will no longer work (as the patch itself warned about). Should still work if you force 6.x, though.

The patch above and @peterwake gist still works with 6.3.2.

As of today (May, 20 2020) it worked with the osgeo-proj.

The only changes are:

brew edit osgeo-proj brew install osgeo-proj -s gem install rgeo -- --with-geos-dir=/usr/local/Cellar/geos/3.8.1_1 \ --with-proj-dir=/usr/local/Cellar/osgeo-proj/6.3.2 gem install rgeo-proj4

keithdoggett commented 3 years ago

Fixed by #10. Version 3.0.0 is now out which uses v6.2+. Thanks for the patience everyone!