Markus Metz 78a842ea73 libproj: do not free a pointer internal to a OGRSpatialReference; +safety check before calling OSRDestroySpatialReference() 7 years ago
..
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 years ago
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 years ago
convert.c 78a842ea73 libproj: do not free a pointer internal to a OGRSpatialReference; +safety check before calling OSRDestroySpatialReference() 7 years ago
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 years ago
desc.table b54f3e9bc2 move proj-related files from etc/ to etc/proj 13 years ago
do_proj.c effe7075f4 libproj: use new PROJ API starting with proj-5.1.0 7 years ago
ellipse.c 9bb15308a5 projlib: improve doxygen documentation ellipse.c 8 years ago
ftol.c 7f41d3778e winGRASS/OSGeo4W updates (see https://trac.osgeo.org/grass/changeset/45429) 14 years ago
get_proj.c 4e84b93818 libproj: +new GRASS API for coordinate transformation 7 years ago
local_proto.h 1dba9b62d4 dox: fixing several doxygen warnings (wrong file names, typos, lt gt chars) 12 years ago
parms.table b54f3e9bc2 move proj-related files from etc/ to etc/proj 13 years ago
projlib.dox f1945944e4 libproj: add new fns to dox 7 years ago
units.table b54f3e9bc2 move proj-related files from etc/ to etc/proj 13 years ago

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)