r-spatial / lwgeom

bindings to the liblwgeom library
https://r-spatial.github.io/lwgeom/
58 stars 23 forks source link

Support for PROJ 6.0.0 #42

Closed sebastic closed 4 years ago

sebastic commented 5 years ago

lwgeom still uses proj_api.h which is deprecated in PROJ 6.0.0 and will be removed in PROJ 7.0.0 (scheduled for March 2020).

When using proj_api.h with PROJ 6.0.0 -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1 needs to be added to CFLAGS to prevent a compiler error.

lwgeom should be updated to (also) support the proj.h API.

edzer commented 5 years ago

Thanks for notifying! I think #41 took care of this (with the long DEPRECATED flag).

I know we need to update the whole liblwgeom as well, but that requires the CRAN build environments to also upgrade to PROJ 6, since that then becomes a requirement. Maybe best to wait with that until GDAL 2.5.0 is released.

sebastic commented 5 years ago

Adding the flag is just a temporary workaround to get the project to build with PROJ 6.0.0 while still using proj_api.h.

lwgeom has a few dependencies that need to be updated first: GDAL, PostGIS & sf.

Waiting for those is fine. Note that GDAL & PostGIS have recently added support for PROJ 6.0.0.

edzer commented 5 years ago

If you say "has a few dependencies", are you referring to a particular software packaging environment?

sebastic commented 5 years ago

Yes, my perspective is that of the Debian package maintainer of PROJ.

This issue was created when I went over all reverse dependencies of the proj package in Debian to check what changes they need for PROJ 6. This also helped to extend the list of projects in the proj.h adoption status wiki maintained by the PROJ community.

Regarding PostGIS & lwgeom, be aware that the headers for lwgeom will be removed in PostGIS 3.0 (which should also have PROJ 6 support), that may also affect how useful the liblwgeom package in Debian will be for your CRAN package. The PostGIS developers don't really want other projects to use liblwgeom as they consider it internal to PostGIS.

edzer commented 5 years ago

Since the latest CRAN release (0.1-6) lwgeom only compiles to the liblwgeom copy it ships with, so no longer depends on, or uses, liblwgeom when being present as system lib. But that right now depends on PROJ <= 6, and will have to migrate accordingly, after the CRAN check & build farms have migrated to PROJ >= 6. @rsbivand

edzer commented 5 years ago

Fixed in #41 for PROJ 6.0.0, PROJ 7 will need a complete update of the libllwgeom copy.

sebastic commented 5 years ago

Please keep this issue open until support for proj.h is available.

Adding the deprecated flag is only a temporary workaround.

edzer commented 5 years ago

lwgeom 0.1-7 is now on CRAN, using the compatibility flag (because of the shipped liblwgeom still needs it).

edzer commented 4 years ago

lwgeom 0.2-0 is now on CRAN, which uses proj.h when found, and no longer needs the proj_api.h compatibility flag.

edzer commented 4 years ago

Thanks for updating the wiki, @rsbivand !

rsbivand commented 4 years ago

What wiki?

edzer commented 4 years ago

Here: https://github.com/OSGeo/PROJ/wiki/proj.h-adoption-status