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
--- lib/gis/datum.table	(revision 68305)
+++ lib/gis/datum.table	(working copy)
@@ -36,6 +36,7 @@
 nad27  "North_American_Datum_1927"              clark66       dx=-22.0    dy=157.0    dz=176.0
 # North American 1983
 nad83	"North_American_Datum_1983"		  grs80		dx=0.0	    dy=0.0	dz=0.0
+nad83harn "NAD83_High_Accuracy_Reference_Network" grs80		dx=0.0	    dy=0.0	dz=0.0
 # Tokyo datum mean
 tokyo  "Tokyo"                       bessel        dx=-148   dy=507    dz=685
 # Ordnance Survey of Great Britain (1936)
--- lib/proj/convert.c	(revision 68305)
+++ lib/proj/convert.c	(working copy)
@@ -791,6 +791,8 @@
     "Sistema_de_Referencia_Geocentrico_para_America_del_Sur_2000",
     "ITRF_1992",
     "ITRF92",
+    "NAD83_High_Accuracy_Reference_Network",
+    "North_American_Datum_1983",
     NULL
 };
 
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to