[GRASS-dev] [PROJ] GRASS GIS + PROJ 6 + GDAL 2.5

Roger Bivand Roger.Bivand at nhh.no
Fri Mar 8 11:22:04 PST 2019


On Fri, 8 Mar 2019, Even Rouault wrote:

> On vendredi 8 mars 2019 18:22:42 CET Markus Metz wrote:
>> On Fri, Mar 8, 2019 at 5:56 PM Even Rouault <even.rouault at spatialys.com>
>>
>> wrote:
>>> On vendredi 8 mars 2019 17:01:57 CET Markus Metz wrote:
>>>> My question is, what should GRASS do with a SRS without proj string? The
>>>> best answer is probably: use WKT instead of a proj string. But most of
>>
>> the
>>
>>>> GRASS code uses (for historical reasons) some form of proj syntax, also
>>
>> to
>>
>>>> store projection info for a GRASS location. If there is no proj string,
>>>> GRASS thinks there is no SRS and falls back to a generic xy system
>>
>> which is
>>
>>>> not always correct.
>>>
>>> The WKT will not help here. You will be able to get here, but you won't be
>>> able to do coordinate transformation with it. This is just that this EPSG
>>> method is not implemented or mapped to a PROJ projection method
>>
>> I understand that coordinate transformation with PROJ will not be possible.
>> But having a valid SRS definition would at least allow to compare two
>> spatial references, i.e. OSRIsSame() should work. Having a valid SRS
>> instead of dumping it would also help if the corresponding PROJ method
>> becomes implemented in the future. That's why I am wondering about an
>> alternative to the current proj-like projection information in GRASS.

Might it be possible for proj_get_crs_info_list_from_database() to return 
a field indicating whether the record in proj_crs_info can be exported to 
proj_string?

I found example code for proj_log_func() in GDAL in ogr/ogr_proj_p.cpp, 
and am using that to do nothing on apparent PJ_LOG_ERROR messages reported 
in proj_as_proj_string(). The messages are suppressed, and I destroy the 
context after looping through the projections found. I'm a bit concerned 
that if something goes wrong, turning off error handling isn't safe.

In rgdal::make_EPSG(), the proj_string is returned as (null), and can be 
grepped, so it does provide information.

Roger

>
> Yes, for having a reference SRS definition, you can use the WKT export. By
> "useful", I meant being able to do coordinate transformation.
> To compare SRS for equality, rather than using full string comparison, I'd
> suggest using proj_is_equivalent_to() which has a few options for different
> levels of equality.
>
> Even
>
>

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: Roger.Bivand at nhh.no
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en


More information about the grass-dev mailing list