Re: [GRASS-dev] PROJ 5 support in trunk

2018-03-26 Thread Markus Metz
There is an important difference between the PROJ4 and the PROJ5+
API/syntax:

The old PROJ4 API uses latlong WGS84 as pivot datum for coordinate
transformations like

projection1 -> latlong WGS84 -> projection2
or in '+to' syntax
projection1 +to projection2

The new PROJ5+ API no longer uses a pivot datum. The advantage is that you
can directly convert from one datum to another, without going through
WGS84. The disadvantage is that the user/software using the new API has to
make sure that either a common pivot datum is used or coordinates are
correctly transformed from one datum to another, e.g. with a Helmert
Transform.

Both GDAL and GRASS have implemented the new API as a simple 2-step
pipeline like

1. projection1 -> some latlong
2. some latlong -> projection2

or in pipeline syntax

+proj=pipeline
+step +inv projection1
+step projection2

Even Rouault has done some tests and found sometimes subtle differences in
the results between the old and new API/syntax. Further on, there is no
mechanism (yet) in place to validate the pipeline, most importantly that
the output of step 1 conforms to the required input for step 2.

IMHO, the implementation of the new PROJ5+ API/syntax in GDAL and GRASS
should be regarded as experimental and testing by as many people as
possible would be a huge benefit to PROJ/GDAL/GRASS and to all applications
using these projects.

Markus M

On Sun, Mar 25, 2018 at 10:47 PM, Helmut Kudrnovsky  wrote:
>
> >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
>
> Thanks for this Update!
>
> Fyi See
> https://lists.osgeo.org/pipermail/osgeo4w-dev/2018-March/003557.html
>
> ---
> [...]
> The API from PROJ 4 lives on in PROJ 5, so GRASS 7.4 should be able to use
> PROJ 5 as well. We’ve been carefull not to breaking anything with this
> release.
> That comes with PROJ 6 and 7. Of course there might be implementation
> details
> in GRASS that I am unaware of that makes using PROJ 5 impossible.
> 
>
>
>
> -
> best regards
> Helmut
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Dev-f3991897.html
> ___
> grass-dev mailing list
> grass-dev@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-dev
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] PROJ 5 support in trunk

2018-03-25 Thread Helmut Kudrnovsky
>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

Thanks for this Update!

Fyi See
https://lists.osgeo.org/pipermail/osgeo4w-dev/2018-March/003557.html

---
[...]
The API from PROJ 4 lives on in PROJ 5, so GRASS 7.4 should be able to use
PROJ 5 as well. We’ve been carefull not to breaking anything with this
release.
That comes with PROJ 6 and 7. Of course there might be implementation
details
in GRASS that I am unaware of that makes using PROJ 5 impossible.




-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Dev-f3991897.html
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] PROJ 5 support in trunk

2018-03-23 Thread Moritz Lennert

On 23/03/18 10:41, Markus Metz wrote:
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 :-)).


Wow ! Congratulations and thank you for all this hard work !!

Moritz

___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] PROJ 5 support in trunk

2018-03-23 Thread Markus Metz
On Thu, Mar 22, 2018 at 4:38 PM, Markus Metz 
wrote:
>
>
>
> On Thu, Mar 22, 2018 at 7:16 AM, Markus Neteler  wrote:
> >
> > On Tue, Mar 20, 2018 at 8:04 PM, Markus Metz
> >  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
>
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] PROJ 5 support in trunk

2018-03-22 Thread Markus Metz
On Thu, Mar 22, 2018 at 7:16 AM, Markus Neteler  wrote:
>
> On Tue, Mar 20, 2018 at 8:04 PM, Markus Metz
>  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. 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
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] PROJ 5 support in trunk

2018-03-22 Thread Markus Neteler
On Tue, Mar 20, 2018 at 8:04 PM, Markus Metz
 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.

> 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

markusN
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] PROJ 5 support in trunk

2018-03-20 Thread Markus Metz
On Tue, Mar 20, 2018 at 8:04 PM, Markus Metz 
wrote:
>
> Hi all,
>
> I have added support for the new PROJ 5+ API in trunk, finished with
r72433.

Now really finished with trunk r72443.

Markus M

> 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.
>
> Markus M
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

[GRASS-dev] PROJ 5 support in trunk

2018-03-20 Thread Markus Metz
Hi all,

I have added support for the new PROJ 5+ API in trunk, finished with
r72433. 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.

Markus M
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev