Hi Markus, Even,

On 04/24/2016 10:29 PM, Markus Neteler wrote:
Hi Paul,

you are probably the person with most insights into lib/proj/convert.c.

I try to debug why the North Carolina Location cannot be generated
properly (EPSG 3358) but comes out like this:


  grass71 -c epsg:3358 ~/grassdata/nc_data
  GRASS 7.1.svn (nc_data):~ > g.proj -w
  PROJCS["NAD83(HARN) / North Carolina",
      GEOGCS["grs80",
          DATUM["unknown",

The datum name "unknown" is coming through from GDAL. Here is a simple test program to illustrate it (using latest SVN GDAL from this evening):

#include <stdio.h>
#include <ogr_srs_api.h>

main()
{
    OGRSpatialReferenceH hSRS;
    const char *datum;

    hSRS = OSRNewSpatialReference(NULL);
    OSRImportFromProj4(hSRS, "+init=epsg:3358");

    datum = OSRGetAttrValue(hSRS, "DATUM", 0);
    printf("Datum name is %s\n", datum);

    return 0;
}

Compile as:
gcc -Wall -o test test.c -lgdal
and run:
./test
Datum name is unknown


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?

Paul
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to