Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for PROJ 6.0.0 #5766

Closed
sebastic opened this issue Mar 13, 2019 · 15 comments
Closed

Support for PROJ 6.0.0 #5766

sebastic opened this issue Mar 13, 2019 · 15 comments
Assignees
Milestone

Comments

@sebastic
Copy link
Contributor

sebastic commented Mar 13, 2019

Mapserver 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.

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

Note that PHP MapScript still includes projects.h which is no longer available in PROJ 6.0.0.

@bmulcahy
Copy link
Contributor

bmulcahy commented Mar 15, 2019

In the mean time a quick work around for anyone needing to use PROJ 6 or anyone who has recently built GDAL with PROJ 6 without realizing mapserver wasn't compatible, not saying that is what I did but just in case someone does.

Add

#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1
before line 41 in mapserver/mapproject.h

THIS IS NOT A SOLUTION just a work around.

@sdlime sdlime added this to the 7.4 Release milestone Mar 15, 2019
@sdlime sdlime self-assigned this Mar 15, 2019
@sdlime
Copy link
Member

sdlime commented Mar 15, 2019

This should really be targeted for 7.4. @rouault, any feel for how big a deal this is likely to be?

@rouault
Copy link
Contributor

rouault commented Mar 15, 2019

any feel for how big a deal this is likely to be?

I haven't looked in details, but not trivial.
And I'm not sure we can keep PROJ <6 and PROJ >= 6 support at the same time.

@sdlime
Copy link
Member

sdlime commented Mar 15, 2019

Thanks and ugh... I had this as a code sprint activity for 8.0, perhaps it's best left there. Will start reading up.

@fxcoudert
Copy link

fxcoudert commented Mar 23, 2019

Currently blocking integration of latest proj in Homebrew: Homebrew/homebrew-core#38215

@sdlime
Copy link
Member

sdlime commented Mar 29, 2019

@rouault is the preferred method to set a cflag -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1 or the define in mapproject.h as suggested by @bmulcahy? They're equivalent and the latter is trivial (no messing with cmake) so I was going to add that quickly before creating the 7.4 branch. Just making sure...

@rouault
Copy link
Contributor

rouault commented Mar 29, 2019

or the define in mapproject.h

this is fine to me, but I also see that mapwcs20.c directly includes <proj_api.h>. I guess that include should be replaced by mapproject.h (or it is possible that mapproject.h is indirectly included)

@sdlime
Copy link
Member

sdlime commented Mar 29, 2019

mapproject.h is included in mapserver.h which is also included in mapwcs20.c so I think we're ok. It looks like mapwcs20.c is only using the pg_is_latlong() function/macro...

@sebastic
Copy link
Contributor Author

sebastic commented Mar 31, 2019

What about PHP MapScript? It still uses projects.h in 7.4.0-beta1.

@sdlime
Copy link
Member

sdlime commented Apr 2, 2019

What about PHP MapScript? It still uses projects.h in 7.4.0-beta1.

Will have to address in beta2...

@sdlime
Copy link
Member

sdlime commented Apr 15, 2019

@sebastic, I made a small change in PHP/MapScript with the workaround. Any chance you could test on your end? --Steve

@sebastic
Copy link
Contributor Author

sebastic commented Apr 15, 2019

I guess you mean commit b4b680d?

That won't suffice, because projects.h is still used (and is no longer available in PROJ 6.0.0), php_proj.c needs to be ported to use proj_api.h instead. And possibly also the two methods in map.c.

@rouault
Copy link
Contributor

rouault commented Apr 15, 2019

That won't suffice, because projects.h is still used (and is no longer available in PROJ 6.0.0), php_proj.c needs to be ported to use proj_api.h instead

I'd suggest completely dropping php_proj.c . This has nothing to do mapserver itself. This is a PHP binding to PROJ old projects.h. There's no way to emulate completely with new API since this is really a raw bindng to projects.h function. And we could drop it since it doesn't seem to be used elsewhere in the PHP bindings.
Actually it isn't even in CMakeLists.txt ! So the file should be removed
@sebastic Do you have actual build issues related to it ?

And possibly also the two methods in map.c.

From what I see, they use mapserver abstracted API and don't depend explicitly on PROJ headers

@sebastic
Copy link
Contributor Author

sebastic commented Apr 15, 2019

@sebastic Do you have actual build issues related to it ?

No, MapServer 7.4.0-beta1 builds successfully with PROJ 6.0.0.

@rouault
Copy link
Contributor

rouault commented Nov 3, 2019

Support for proj.h API has been added in master a few weeks ago per #5888

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants