[GRASS-user] [GRASS-dev] PROJ 5 support in trunk

Markus Metz markus.metz.giswork at gmail.com
Fri Mar 23 02:41:53 PDT 2018


On Thu, Mar 22, 2018 at 4:38 PM, Markus Metz <markus.metz.giswork at gmail.com>
wrote:
>
>
>
> On Thu, Mar 22, 2018 at 7:16 AM, Markus Neteler <neteler at osgeo.org> wrote:
> >
> > On Tue, Mar 20, 2018 at 8:04 PM, Markus Metz
> > <markus.metz.giswork at gmail.com> wrote:
> > > Hi all,
> > >
> > > I have added support for the new PROJ 5+ API in trunk, finished with
r72433.
> >
> > That's really great! First OSGeo project :-)
> >
> > It was a lot of work for you, thanks.
>
> The work is not yet finished.

Now (last related commit is trunk r72522) it's finished. I have introduced
a new GRASS API that handles both PROJ 4 and PROJ 5, consisting of

GPJ_init_transform() (new, initializes coordinate transformation)
GPJ_transform() replacing pj_do_proj()
GPJ_transform_array() replacing pj_do_transform()

The old GRASS API is still there but is no longer used by core modules.

Only few ifdefs in lib/proj are needed for different PROJ versions. Modules
do not need any ifdefs, they can simply call GPJ_init_transform() +
GPJ_transform() without caring about the PROJ API.

As soon as PROJ 5.0.1 is out, I would like to drop support for PROJ 5.0.0
and only support PROJ 4 and PROJ 5.0.1 or higher (learning from GDAL :-)).

Markus M

> The current implementation works but is ugly and code in modules became
less readable because of lots of ifdefs for PROJ4 or PROJ5. I am now
testing a new GRASS API as interface to PROJ4/5 that would allow to remove
these ifdefs in modules. The old GRASS API as well as the standard PROJ4
API will still be supported. The main difference is that GRASS now uses for
PROJ5 the new pipeline syntax which allows to define more complex
transformations. Forward/backward transformation will also become easier by
simply defining the direction. m.proj still needs to be updated to support
this new pipeline syntax with any number of steps as input for proj_in.
>
> >
> > > This means, trunk is now using exclusively the new PROJ 5+ API if
available.
> > >
> > > This new PROJ 5 API is available e.g. in Debian testing.
> > >
> > > Please test!
> > >
> > > During testing, I discovered some dangerous naming conflicts in GRASS
and
> > > PROJ4/PROJ5: internal functions start both in GRASS and PROJ with pj_
which
> > > can lead to cryptic errors. Within GRASS, some but not all
> > > projection-related functions start with GPJ_, this should be adopted
for
> > > those starting with pj_. Also the GRASS structure struct pj_info
should be
> > > renamed to struct gpj_info.
> >
> > BTW: Also GDAL now comes with support for PROJ 5, see
> > https://lists.osgeo.org/pipermail/gdal-dev/2018-March/048278.html
>
> Nice!
>
> Markus M
> >
> > markusN
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20180323/428e6c50/attachment.html>


More information about the grass-user mailing list