[GRASS-dev] [GRASS GIS] #2456: read CSV from GDAL data directory

Paul Kelly paul-grass at stjohnspoint.co.uk
Mon Apr 25 13:37:06 PDT 2016


On 04/25/2016 09:12 PM, Even Rouault wrote:
> Le lundi 25 avril 2016 22:02:20, Paul Kelly a écrit :
[...]
>>
>> Perhaps there is a better / more correct way to get the co-ordinate
>> system definition from GDAL than by requesting it as a "+init=epsg:XXXX"
>> PROJ string?
>
> Yes, if you use OSRImportFromProj4(), the building of the SRS WKT will be done
> by "reverse engineering" the proj.4 string that gets expended by proj.4 from
> +init=epsg:3358 to  "+proj=lcc +lat_1=36.16666666666666
> +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0
> +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs". Which has lost any
> datum name.
>
> The solution is simple : use OSRImportFromEPSG(hSRS, code)

Ah, thanks for the hint - but I had got confused: g.proj has actually 
been using OSRImportFromEPSG() for a long time (since r31652, in 2008 
actually). Faulty memory on my part.

The problem is actually even simpler (datum simply not recognised in 
GRASS) and there are two possible solutions:

1) If we want NAD83_High_Accuracy_Reference_Network to be treated as a 
completely separate datum from North_American_Datum_1983, then we add it 
as a new line in lib/gis/datum.table as per the first attached patch.

2) If we want NAD83_High_Accuracy_Reference_Network to be treated as 
equivalent to North_American_Datum_1983 (this means once the location 
has been created, 'g.proj -w' will report the datum name as 
North_American_Datum_1983), then we add two new lines to the equivalent 
pairs array in lib/proj/convert.c as per the second attached patch.

I don't really feel qualified to decide which is the most desirable 
behaviour, so I'll leave that up to someone else to decide, if that's OK.

Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: datum.table.patch
Type: text/x-patch
Size: 512 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20160425/bafd8c09/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: convert.c.patch
Type: text/x-patch
Size: 295 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20160425/bafd8c09/attachment-0001.bin>


More information about the grass-dev mailing list