Markus Neteler b626337613 libproj: added alias for ITRF92 (#1460) 4 年之前
..
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 a157e45d35 svn refs changed to git (#93) 5 年之前
convert.c b626337613 libproj: added alias for ITRF92 (#1460) 4 年之前
datum.c 4dc36bb86f libproj (#252) 5 年之前
desc.table b54f3e9bc2 move proj-related files from etc/ to etc/proj 13 年之前
do_proj.c e0b3fc55c0 lib/proj: fix results for ll equivalents (#1444) 4 年之前
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 6e0d4b8e25 PROJ6+ / WKT2 support (#1240) 4 年之前
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 6ebdd6159a libproj: change warning to debug message (#1337) 4 年之前
units.table b54f3e9bc2 move proj-related files from etc/ to etc/proj 13 年之前

README.txt

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

EPGS DB management: see https://github.com/OSGeo/libgeotiff/tree/master/libgeotiff

The EPSG data 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)