projlib.dox 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*! \page projlib GRASS and the PROJ4 projection library
  2. <!-- doxygenized from "GRASS 5 Programmer's Manual"
  3. by M. Neteler 11/2005
  4. -->
  5. by GRASS Development Team
  6. http://grass.osgeo.org
  7. \section projintro GRASS GIS and the PROJ4 projection library
  8. GRASS GIS utilizes the PROJ4 library (<a
  9. href="http://proj.osgeo.org">http://proj.osgeo.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 PROJ4 functions are used through wrapper functions
  13. in a GRASS environment.
  14. Internally to the PROJ.4 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>).
  20. In GRASS the wrapper functions in lib/proj/get_proj.c makes the
  21. preparations to set up the parameter strings and init the info-structures,
  22. while lib/proj/do_proj.c contains the actual projection calls.
  23. Files lib/proj/ellipse.c and lib/proj/datum.c contain functions for
  24. querying GRASS locations and users for ellipsoid and datum information
  25. (some of these functions were included in the GIS library in earlier
  26. versions of GRASS).
  27. File lib/proj/convert.c contains functions for converting GRASS
  28. co-ordinate system descriptions to and from the formats used by other
  29. GIS. Heavy use is made of the OGR library, part of GDAL
  30. (http://www.gdal.osgeo.org/ogr/).
  31. \subsection datum_transformation Datum transformation
  32. GRASS generally supports datum transformation (3 parameters, 7 parameters
  33. and grid).
  34. <p>
  35. If a warning appears that a certain datum is not recognised by GRASS and
  36. no parameters found, the datum transformation parameters have to be
  37. added to $GISBASE/etc/proj/datum.table (and also $GISBASE/etc/proj/datumtransform.table
  38. if you have 7-parameter transformation parameters). No need to re-compile
  39. though. When adding to SVN, currently these files are still in lib/gis/.
  40. <p>
  41. A list of datum equivalents is included in convert.c for geospatial files that
  42. use a non-standard name for a datum that is already supported in GRASS.
  43. <p>
  44. Hint: use GDAL's "testepsg" to identify the canonical name, e.g.
  45. testepsg epsg:4674
  46. \subsection Makefile_Example Makefile Example
  47. <p>
  48. The following code demonstrates the Makefile.
  49. \verbatim
  50. MODULE_TOPDIR = ../..
  51. PGM = r.myproj
  52. EXTRA_INC = $(PROJINC)
  53. LIBES = $(GPROJLIB) $(GISLIB)
  54. DEPENDENCIES= $(GPROJDEP) $(GISDEP)
  55. include $(MODULE_TOPDIR)/include/Make/Module.make
  56. default: cmd
  57. \endverbatim
  58. \section Functions
  59. - GPJ_ask_datum_params()
  60. - GPJ_get_datum_by_name()
  61. - GPJ__get_datum_params()
  62. - GPJ_get_datum_params()
  63. - GPJ_get_default_datum_params_by_name()
  64. - GPJ_get_ellipsoid_by_name()
  65. - GPJ_get_ellipsoid_params()
  66. - GPJ_get_equivalent_latlong()
  67. - GPJ_grass_to_osr()
  68. - GPJ_grass_to_wkt()
  69. - GPJ_free_datum()
  70. - GPJ_free_ellps()
  71. - GPJ_set_csv_loc()
  72. - GPJ_osr_to_grass()
  73. - GPJ_wkt_to_grass()
  74. */