projlib.dox 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*! \page projlib GRASS and the PROJ projection library
  2. <!-- doxygenized from "GRASS 5 Programmer's Manual"
  3. by M. Neteler 11/2005
  4. -->
  5. by GRASS Development Team
  6. https://grass.osgeo.org
  7. \section projintro GRASS GIS and the PROJ projection library
  8. GRASS GIS utilizes the PROJ library (<a
  9. href="https://proj.org">https://proj.org</a>) originally
  10. developed by Gerald Evenden/USGS (Cartographic Projection Procedures
  11. for the UNIX Environment -- A User's Manual, Evenden, 1990, Open-file
  12. report 90-284). The PROJ functions are used through wrapper functions
  13. in a GRASS environment.
  14. Internally to the PROJ library, projection may involve transformation to
  15. and from geodetic co-ordinates (latitude and longitude), and numerical
  16. corrections to account for different datums.
  17. This is transparent for the user as input and output parameters are
  18. either read from PROJ_INFO and PROJ_UNITS files (<tt>g.proj</tt>,
  19. <tt>v.proj</tt>, <tt>r.proj</tt>). In addition, a PROJ_EPSG file is
  20. stored. GRASS converts a co-ordinate system representation to WKT
  21. style, the EPSG code is here preferred if available. The TOWGS84 parameter
  22. is scanned from PROJ_INFO file and appended to co-ordinate system definition
  23. imported from EPSG code by GDAL library.
  24. In GRASS the wrapper functions in lib/proj/get_proj.c makes the
  25. preparations to set up the parameter strings and init the info-structures,
  26. while lib/proj/do_proj.c contains the actual projection calls.
  27. Files lib/proj/ellipse.c and lib/proj/datum.c contain functions for
  28. querying GRASS locations and users for ellipsoid and datum information
  29. (some of these functions were included in the GIS library in earlier
  30. versions of GRASS).
  31. File lib/proj/convert.c contains functions for converting GRASS
  32. co-ordinate system descriptions to and from the formats used by other
  33. GIS. Heavy use is made of the OGR library, part of GDAL
  34. (https://gdal.org).
  35. \subsection datum_transformation Datum transformation
  36. GRASS generally supports datum transformation (3 parameters, 7 parameters
  37. and grid).
  38. <p>
  39. Note that datum transformation is handled exclusively by PROJ 6 and later.
  40. In the case that GRASS is compiled with PROJ 5 or older, the datum
  41. management is still done within GRASS GIS. Only in that case,
  42. if a warning appears that a certain datum is not recognised by GRASS and
  43. no parameters found, the datum transformation parameters have to be
  44. added to $GISBASE/etc/proj/datum.table (and also $GISBASE/etc/proj/datumtransform.table
  45. if you have 7-parameter transformation parameters). No need to re-compile
  46. though. When adding to git, currently these files are still in lib/gis/.
  47. <p>
  48. A list of datum equivalents is included in convert.c for geospatial files that
  49. use a non-standard name for a datum that is already supported in GRASS.
  50. <p>
  51. Hint: use GDAL's "testepsg" to identify the canonical name, e.g.
  52. testepsg epsg:4674
  53. \subsection Makefile_Example Makefile Example
  54. <p>
  55. The following code demonstrates the Makefile.
  56. \verbatim
  57. MODULE_TOPDIR = ../..
  58. PGM = r.myproj
  59. EXTRA_INC = $(PROJINC)
  60. LIBES = $(GPROJLIB) $(GISLIB)
  61. DEPENDENCIES= $(GPROJDEP) $(GISDEP)
  62. include $(MODULE_TOPDIR)/include/Make/Module.make
  63. default: cmd
  64. \endverbatim
  65. \section Functions
  66. - GPJ_ask_datum_params()
  67. - GPJ_get_datum_by_name()
  68. - GPJ__get_datum_params()
  69. - GPJ_get_datum_params()
  70. - GPJ_get_datum_transform_by_name()
  71. - GPJ_get_default_datum_params_by_name()
  72. - GPJ_get_ellipsoid_by_name()
  73. - GPJ__get_ellipsoid_params()
  74. - GPJ_get_ellipsoid_params()
  75. - GPJ_get_equivalent_latlong()
  76. - GPJ_grass_to_osr()
  77. - GPJ_grass_to_osr2()
  78. - GPJ_grass_to_wkt()
  79. - GPJ_grass_to_wkt2()
  80. - GPJ_free_datum()
  81. - GPJ_free_datum_transform()
  82. - GPJ_free_ellps()
  83. - GPJ_set_csv_loc()
  84. - GPJ_osr_to_grass()
  85. - GPJ_wkt_to_grass()
  86. - GPJ_init_transform()
  87. - GPJ_transform()
  88. - GPJ_transform_array()
  89. */