PROJ API

Olly Betts olly at survex.com
Tue Sep 7 18:47:01 BST 2021


On Tue, Sep 07, 2021 at 08:48:42AM +0100, Oliver Madge wrote:
> I’m trying to build Survex and ran into the following error:
> 
> commands.c:38:10: fatal error: proj_api.h: No such file or directory
>    38 | #include <proj_api.h>
>       |          ^~~~~~~~~~~~
> compilation terminated.
> 
> This is because Survex uses the (now very old) PROJ 4 API.

While it's very old in that it's been a stable API for a long time, this
API was only actually deprecated in 2019 - this feels like rather an
aggressive timescale for deprecating and removing a long-time stable API
to me, especially given the difficulty of migrating code to the new API.

> I can see that
> Survex defines ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
> which allowed use of the old API until PROJ 7 but this has now been
> completely removed in PROJ 8 in favour of the PROJ 6 API.
> 
> Are there plans to migrate Survex to use the PROJ 6 API?

Yes (we'll have to in order to build with current releases of PROJ as
you've noticed).

I've been trying to migrate for a while but the new API takes quite a
different approach and various things aren't currently working properly
for unclear reasons.

They've also dropped support for some features in proj strings which
Survex uses in some cases.  Modern .3d files embed a proj string to
describe the coordinate system, so I've had to try to pattern match
these and convert to something that work.  Given the user can specify an
arbitrary proj string to use in their .svx file, this almost certainly
means that in some cases where they've done that aven won't be able to
understand the coordinate system.

Cheers,
    Olly



More information about the Survex mailing list