README.txt 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Projection string management: GRASS GIS relies on GDAL/PROJ.
  2. The EPGS DB is transformed into suitable CSV data for GDAL/PROJ
  3. according to this procedure:
  4. http://svn.osgeo.org/metacrs/geotiff/trunk/libgeotiff/csv/README
  5. The EPSG CSV files are used via GDAL/OGR API from
  6. gdal-config --datadir
  7. The datum shift grids are also used from GDAL/PROJ (proj-nad package).
  8. TODO: It is recommended to rely on PROJ4's proj-nad package. For doing so,
  9. there would be some changes needed to lib/proj/get_proj.c - the call
  10. to pj_set_finder() should be removed so that PROJ looks in its default
  11. locations for the files.
  12. Function:
  13. const char* pszDatumshiftfile = CPLFindFile( "gdal", "datum_shift.csv" );
  14. ##########
  15. # EPSG code queries:
  16. # printing all available datum shift codes
  17. ogrinfo /usr/share/gdal/datum_shift.csv -al
  18. ogrinfo /usr/share/gdal/gcs.csv -al
  19. # selective printing
  20. ogrinfo /usr/share/gdal/datum_shift.csv -al -where "SOURCE_CRS_CODE = '4156'" -al
  21. ogrinfo /usr/share/gdal/gcs.csv -al -where "COORD_REF_SYS_NAME LIKE '%JT%'"
  22. # print NAD file info
  23. gdalinfo /usr/share/proj/hawaii
  24. # query codes
  25. gdalsrsinfo EPSG:5514
  26. # transform between projections
  27. gdaltransform -s_srs EPSG:4326 -t_srs "+proj=longlat +datum=nad27" --debug on
  28. ##########
  29. # Testing: comparing results
  30. # Testing using GDAL
  31. PROJ_DEBUG=ON CPL_DEBUG=ON gdaltransform -s_srs EPSG:4326 -t_srs "+proj=longlat +datum=nad27"
  32. -100 40
  33. -99.9995941840488 39.9999941029394 0
  34. # Testing using GRASS GIS
  35. PROJ_DEBUG=ON CPL_DEBUG=ON m.proj proj_in="+init=epsg:4326" proj_out="+proj=longlat +datum=NAD27" coordinates=-100,40 -d
  36. -99.99959418|39.99999410|0.00000000
  37. The resulting values need to be identical (note: m.proj prints with less precision)