Markus Neteler d33152f1d5 Numerous typos fixed (identified with tools/fix_typos.sh) 8 년 전
..
Makefile 2e920ea3aa libproj: cleanup of local copies of NAD and datum shift files which are used from GDAL; extended documentation in README.txt (trac https://trac.osgeo.org/grass/ticket/2456) 8 년 전
README.txt 2e920ea3aa libproj: cleanup of local copies of NAD and datum shift files which are used from GDAL; extended documentation in README.txt (trac https://trac.osgeo.org/grass/ticket/2456) 8 년 전
convert.c 207025b5dc libproj: don't mess up PROJCS versus GEOGCS (fixes https://trac.osgeo.org/grass/changeset/68131, see https://trac.osgeo.org/grass/ticket/2456) 8 년 전
datum.c e543b66dc9 Fix GPJ__get_datum_params() to respect https://trac.osgeo.org/grass/changeset/69211 (see https://trac.osgeo.org/grass/ticket/2456) 8 년 전
desc.table b54f3e9bc2 move proj-related files from etc/ to etc/proj 13 년 전
do_proj.c 970eb3790a Add "const" to function parameters where appropriate 12 년 전
ellipse.c 9bb15308a5 projlib: improve doxygen documentation ellipse.c 8 년 전
ftol.c 7f41d3778e winGRASS/OSGeo4W updates (see https://trac.osgeo.org/grass/changeset/45429) 14 년 전
get_proj.c d33152f1d5 Numerous typos fixed (identified with tools/fix_typos.sh) 8 년 전
local_proto.h 1dba9b62d4 dox: fixing several doxygen warnings (wrong file names, typos, lt gt chars) 12 년 전
parms.table b54f3e9bc2 move proj-related files from etc/ to etc/proj 13 년 전
projlib.dox 41a87c3ed8 libproj: TODO pj_set_finder() should be removed so that PROJ uses its own datum shift grid files 8 년 전
units.table b54f3e9bc2 move proj-related files from etc/ to etc/proj 13 년 전

README.txt

Projection string management: GRASS GIS relies on GDAL/PROJ.

The EPGS DB is transformed into suitable CSV data for GDAL/PROJ
according to this procedure:
http://svn.osgeo.org/metacrs/geotiff/trunk/libgeotiff/csv/README

The EPSG CSV files are used via GDAL/OGR API from
gdal-config --datadir

The datum shift grids are also used from GDAL/PROJ (proj-nad package).

TODO: It is recommended to rely on PROJ4's proj-nad package. For doing so,
there would be some changes needed to lib/proj/get_proj.c - the call
to pj_set_finder() should be removed so that PROJ looks in its default
locations for the files.

Function:
const char* pszDatumshiftfile = CPLFindFile( "gdal", "datum_shift.csv" );

##########
# EPSG code queries:

# printing all available datum shift codes
ogrinfo /usr/share/gdal/datum_shift.csv -al
ogrinfo /usr/share/gdal/gcs.csv -al

# selective printing
ogrinfo /usr/share/gdal/datum_shift.csv -al -where "SOURCE_CRS_CODE = '4156'" -al
ogrinfo /usr/share/gdal/gcs.csv -al -where "COORD_REF_SYS_NAME LIKE '%JT%'"

# print NAD file info
gdalinfo /usr/share/proj/hawaii

# query codes
gdalsrsinfo EPSG:5514

# transform between projections
gdaltransform -s_srs EPSG:4326 -t_srs "+proj=longlat +datum=nad27" --debug on

##########
# Testing: comparing results

# Testing using GDAL
PROJ_DEBUG=ON CPL_DEBUG=ON gdaltransform -s_srs EPSG:4326 -t_srs "+proj=longlat +datum=nad27"
-100 40
-99.9995941840488 39.9999941029394 0

# Testing using GRASS GIS
PROJ_DEBUG=ON CPL_DEBUG=ON m.proj proj_in="+init=epsg:4326" proj_out="+proj=longlat +datum=NAD27" coordinates=-100,40 -d
-99.99959418|39.99999410|0.00000000

The resulting values need to be identical (note: m.proj prints with less precision)