coordtransforms.rst 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. .. _crs_coordtransforms:
  2. .. |EPSG_V| replace:: EPSG version 7.9.0
  3. Coordinate Operations
  4. =====================
  5. Coordinate operations are used to convert coordinates from a `source CRS` to a `target CRS`.
  6. If source and target CRSs are referred to a different datum, a datum transform has to be applied. Datum transforms are not exact, they are determined empirically. For the same pair of CRS, there can be many datum transforms and versions, each one with its own domain of validity and an associated transform error. Given a CRS pair, GeoServer will automatically pick the most accurate datum transform from the EPSG database, unless a custom operation is declared.
  7. * Coordinate operations can be queried and tested using the `Reprojection Console`_.
  8. * To enable higher accuracy Grid Shift transforms, see `Add Grid Shift Transform files`_.
  9. * See `Define a custom Coordinate Operation`_ to declare new operations. Custom operations will take precedence over the EPSG ones.
  10. Reprojection Console
  11. --------------------
  12. The reprojection console (available in :ref:`demos`) lets you quickly test coordinate operations. Use it to convert a single coordinate or WKT geometry, and to see the operation details GeoServer is using. It is also useful to learn by example when you have to `Define a custom Coordinate Operation`_.
  13. Read more about the :ref:`demos_reprojectionconsole`.
  14. Add Grid Shift Transform files
  15. ------------------------------
  16. GeoServer supports NTv2 and NADCON grid shift transforms. Grid files are not shipped out with GeoServer. They need to be downloaded, usually from your National Mapping Agency website.
  17. .. warning::
  18. Grid Shift files are only valid in the specific geographic domain for which they where made; trying to transform coordinates outside this domain will result in no trasformation at all. Make sure that the Grid Shift files are valid in the area you want to transform.
  19. #. Search for the *Grid File Name(s)* int the tables below, which are extracted from |EPSG_V|. If you need to use a Grid Shift transform not declared in EPSG, you will need to `Define a custom Coordinate Operation`_.
  20. #. Get the Grid File(s) from your National Mapping Agency (NTv2) or the `US National Geodetic Survey <http://www.ngs.noaa.gov/TOOLS/Nadcon/Nadcon.shtml>`_ (NADCON).
  21. #. Copy the Grid File(s) in the :file:`user_projections` directory inside your data directory.
  22. #. Use the `Reprojection Console`_ to test the new transform.
  23. List of available Grid Shift transforms
  24. ```````````````````````````````````````
  25. The list of Grid Shift transforms declared in |EPSG_V| is:
  26. NTv2
  27. ....
  28. .. csv-table::
  29. :header: Source CRS, Target CRS, Grid File Name, Source Info
  30. 4122,4326,NB7783v2.gsb,OGP
  31. 4122,4326,NS778301.gsb,OGP
  32. 4122,4326,PE7783V2.gsb,OGP
  33. 4122,4617,NB7783v2.gsb,New Brunswick Geographic Information Corporation land and water information standards manual.
  34. 4122,4617,NS778301.gsb,Nova Scotia Geomatics Centre - Contact aflemmin@linux1.nsgc.gov.ns.ca or telephone 902-667-6409
  35. 4122,4617,PE7783V2.gsb,PEI Department of Transportation & Public Works
  36. 4149,4150,CHENyx06a.gsb,Bundesamt für Landestopografie swisstopo; www.swisstopo.ch
  37. 4149,4151,CHENyx06_ETRS.gsb,Bundesamt für Landestopografie swisstopo; www.swisstopo.ch
  38. 4149,4258,CHENyx06_ETRS.gsb,Bundesamt für Landestopografie swisstopo; www.swisstopo.ch
  39. 4149,4326,CHENyx06_ETRS.gsb,IOGP
  40. 4171,4275,rgf93_ntf.gsb,ESRI
  41. 4202,4283,A66 National (13.09.01).gsb,GDA Technical Manual. http://www.icsm.gov.au/gda
  42. 4202,4283,SEAust_21_06_00.gsb,Office of Surveyor General Victoria; http://www.land.vic.gov.au/
  43. 4202,4283,nt_0599.gsb,GDA Technical Manual. http://www.icsm.gov.au/gda
  44. 4202,4283,tas_1098.gsb,http://www.delm.tas.gov.au/osg/Geodetic_transform.htm
  45. 4202,4283,vic_0799.gsb,Office of Surveyor General Victoria; http://www.land.vic.gov.au/
  46. 4202,4326,A66 National (13.09.01).gsb,OGP
  47. 4203,4283,National 84 (02.07.01).gsb,GDA Technical Manual. http://www.icsm.gov.au/gda
  48. 4203,4283,wa_0700.gsb,"Department of Land Information, Government of Western Australia; http://www.dola.wa.gov.au/"
  49. 4203,4326,National 84 (02.07.01).gsb,OGP
  50. 4207,4258,DLx_ETRS89_geo.gsb,Instituto Geografico Portugues; http://www.igeo.pt
  51. 4225,4326,CA7072_003.gsb,OGP
  52. 4225,4674,CA7072_003.gsb,IBGE.
  53. 4230,4258,"100800401.gsb","Geodesy Unit, Cartographic Institute of Catalonia (ICC); http://www.icc.cat"
  54. 4230,4258,SPED2ETV2.gsb,"Instituto Geográfico Nacional, www.cnig.es"
  55. 4230,4326,SPED2ETV2.gsb,OGP
  56. 4258,4275,rgf93_ntf.gsb,OGP
  57. 4267,4269,NTv2_0.gsb,http://www.geod.nrcan.gc.ca/products/html-public/GSDapps/English/NTv2_Fact_Sheet.html
  58. 4267,4269,QUE27-83.gsb,Geodetic Service of Quebec. Contact alain.bernard@mrn.gouv.qc.ca
  59. 4267,4326,NTv2_0.gsb,OGP
  60. 4267,4326,QUE27-98.gsb,OGP
  61. 4267,4326,SK27-98.gsb,OGP
  62. 4267,4617,NB2783v2.gsb,"""Generation of a NAD27-NAD83(CSRS) NTv2-type Grid Shift File for New Brunswick"", Marcelo C. Santos and Carlos A. Garcia, Department of Geodesy and Geomatics Engineering, University of New Brunswick, October, 2011 via Service New Brunswick."
  63. 4267,4617,QUE27-98.gsb,Geodetic Service of Quebec. Contact alain.bernard@mrn.gouv.qc.ca
  64. 4267,4617,SK27-98.gsb,Dir Geodetic Surveys; SaskGeomatics Div.; Saskatchewan Property Management Company.
  65. 4269,4326,AB_CSRS.DAC,OGP
  66. 4269,4326,NAD83-98.gsb,OGP
  67. 4269,4326,SK83-98.gsb,OGP
  68. 4269,4617,AB_CSRS.DAC,Geodetic Control Section; Land and Forest Svc; Alberta Environment; http://www3.gov.ab.ca/env/land/dos/
  69. 4269,4617,NAD83-98.gsb,Geodetic Service of Quebec. Contact alain.bernard@mrn.gouv.qc.ca
  70. 4269,4617,SK83-98.gsb,Dir Geodetic Surveys; SaskGeomatics Div.; Saskatchewan Property Management Company.
  71. 4272,4167,nzgd2kgrid0005.gsb,Land Information New Zealand: LINZS25000 Standard for New Zealand Geodetic Datum 2000; 16 November 2007.
  72. 4272,4326,nzgd2kgrid0005.gsb,OGP
  73. 4274,4258,D73_ETRS89_geo.gsb,Instituto Geografico Portugues; http://www.igeo.pt
  74. 4277,4258,OSTN02_NTv2.gsb,"Ordnance Survey of Great Britain, http://www.gps.gov.uk"
  75. 4277,4258,OSTN15_NTv2_OSGBtoETRS.gsb,Ordnance Survey of Great Britain.
  76. 4277,4326,OSTN02_NTv2.gsb,OGP
  77. 4277,4326,OSTN15_NTv2_OSGBtoETRS.gsb,IOGP
  78. 4283,7844,COCOS_C_V1.gsb,GDA2020 Technical Manual (http://www.icsm.gov.au)
  79. 4283,7844,GDA94_GDA2020_conformal.gsb,GDA2020 Technical Manual and ICSM Datum Technical Fact Sheet TN1 (http://www.icsm.gov.au).
  80. 4283,7844,GDA94_GDA2020_conformal_and_distortion.gsb,GDA2020 Technical Manual and ICSM Datum Technical Fact Sheet TN1 (http://www.icsm.gov.au).
  81. 4283,7844,XMAS_C_V1.gsb,GDA2020 Technical Manual (http://www.icsm.gov.au).
  82. 4289,4258,rdtrans2008.gsb,"Kadaster and Rijkswaterstaat CIV, working together under the name RDNAP."
  83. 4300,4258,tm75_etrs89.gsb,ESRI Ireland.
  84. 4300,4326,tm75_etrs89.gsb,OGP
  85. 4301,4612,tky2jgd.gsb,ESRI
  86. 4301,6668,tky2jgd.gsb,OGP
  87. 4312,4258,AT_GIS_GRID.gsb,Federal Office of Metrology and Surveying (BEV); http://www.bev.gv.at
  88. 4313,4258,bd72lb72_etrs89lb08.gsb,IGN Brussels www.ngi.be
  89. 4314,4258,BETA2007.gsb,BKG via EuroGeographics http://crs.bkg.bund.de/crs-eu/
  90. 4314,4326,BETA2007.gsb,OGP
  91. 4326,4275,rgf93_ntf.gsb,OGP
  92. 4608,4269,May76v20.gsb,Geodetic Survey of Canada http://www.geod.nrcan.gc.ca/
  93. 4608,4326,May76v20.gsb,OGP
  94. 4609,4269,CGQ77-83.gsb,Geodetic Service of Quebec. Contact alain.bernard@mrn.gouv.qc.ca
  95. 4609,4326,CGQ77-98.gsb,OGP
  96. 4609,4617,CGQ77-98.gsb,Geodetic Service of Quebec. Contact alain.bernard@mrn.gouv.qc.ca
  97. 4612,6668,touhokutaiheiyouoki2011.gsb,ESRI
  98. 4618,4326,SAD69_003.gsb,OGP
  99. 4618,4674,SAD69_003.gsb,IBGE.
  100. 4745,4258,NTv2_SN.gsb,Saxony State Spatial Data and Land Survey Corporation (GeoSN).
  101. 4745,4326,BETA2007.gsb,OGP
  102. 4746,4326,BETA2007.gsb,OGP
  103. 4749,4644,RGNC1991_NEA74Noumea.gsb,ESRI
  104. 4749,4662,RGNC1991_IGN72GrandeTerre.gsb,ESRI
  105. 5524,4326,CA61_003.gsb,OGP
  106. 5524,4674,CA61_003.gsb,IBGE.
  107. 5527,4326,SAD96_003.gsb,OGP
  108. 5527,4674,SAD96_003.gsb,IBGE.
  109. .. The SQL statement::
  110. SELECT DISTINCT source_crs_code SOURCE_CRS, target_crs_code TARGET_CRS, val.param_value_file_ref GRID_FILE_NAME, information_source SOURCE_INFO
  111. FROM epsg_coordoperationparamvalue val, epsg_coordoperation op
  112. WHERE val.coord_op_method_code = 9615 AND val.coord_op_code = op.coord_op_code AND op.deprecated = 0
  113. ORDER BY SOURCE_CRS, TARGET_CRS, GRID_FILE_NAME, SOURCE_INFO
  114. NADCON
  115. ......
  116. .. csv-table::
  117. :header: Source CRS, Target CRS, Version, Latitude shift file, Longitude shift file
  118. 4135,4269,NGS-Usa HI,hawaii.las,hawaii.los
  119. 4136,4269,NGS-Usa AK StL,stlrnc.las,stlrnc.los
  120. 4137,4269,NGS-Usa AK StP,stpaul.las,stpaul.los
  121. 4138,4269,NGS-Usa AK StG,stgeorge.las,stgeorge.los
  122. 4139,4269,NGS-PRVI,prvi.las,prvi.los
  123. 4169,4152,NGS-Asm E,eshpgn.las,eshpgn.los
  124. 4169,4152,NGS-Asm W,wshpgn.las,wshpgn.los
  125. 4267,4269,NGS-Usa AK,alaska.las,alaska.los
  126. 4267,4269,NGS-Usa Conus,conus.las,conus.los
  127. 4269,4152,NGS-Usa AL,alhpgn.las,alhpgn.los
  128. 4269,4152,NGS-Usa AR,arhpgn.las,arhpgn.los
  129. 4269,4152,NGS-Usa AZ,azhpgn.las,azhpgn.los
  130. 4269,4152,NGS-Usa CA n,cnhpgn.las,cnhpgn.los
  131. 4269,4152,NGS-Usa CO,cohpgn.las,cohpgn.los
  132. 4269,4152,NGS-Usa CA s,cshpgn.las,cshpgn.los
  133. 4269,4152,NGS-Usa ID MT e,emhpgn.las,emhpgn.los
  134. 4269,4152,NGS-Usa TX e,ethpgn.las,ethpgn.los
  135. 4269,4152,NGS-Usa FL,flhpgn.las,flhpgn.los
  136. 4269,4152,NGS-Usa GA,gahpgn.las,gahpgn.los
  137. 4269,4152,NGS-Usa HI,hihpgn.las,hihpgn.los
  138. 4269,4152,NGS-Usa IA,iahpgn.las,iahpgn.los
  139. 4269,4152,NGS-Usa IL,ilhpgn.las,ilhpgn.los
  140. 4269,4152,NGS-Usa IN,inhpgn.las,inhpgn.los
  141. 4269,4152,NGS-Usa KS,kshpgn.las,kshpgn.los
  142. 4269,4152,NGS-Usa KY,kyhpgn.las,kyhpgn.los
  143. 4269,4152,NGS-Usa LA,lahpgn.las,lahpgn.los
  144. 4269,4152,NGS-Usa DE MD,mdhpgn.las,mdhpgn.los
  145. 4269,4152,NGS-Usa ME,mehpgn.las,mehpgn.los
  146. 4269,4152,NGS-Usa MI,mihpgn.las,mihpgn.los
  147. 4269,4152,NGS-Usa MN,mnhpgn.las,mnhpgn.los
  148. 4269,4152,NGS-Usa MO,mohpgn.las,mohpgn.los
  149. 4269,4152,NGS-Usa MS,mshpgn.las,mshpgn.los
  150. 4269,4152,NGS-Usa NE,nbhpgn.las,nbhpgn.los
  151. 4269,4152,NGS-Usa NC,nchpgn.las,nchpgn.los
  152. 4269,4152,NGS-Usa ND,ndhpgn.las,ndhpgn.los
  153. 4269,4152,NGS-Usa NewEng,nehpgn.las,nehpgn.los
  154. 4269,4152,NGS-Usa NJ,njhpgn.las,njhpgn.los
  155. 4269,4152,NGS-Usa NM,nmhpgn.las,nmhpgn.los
  156. 4269,4152,NGS-Usa NV,nvhpgn.las,nvhpgn.los
  157. 4269,4152,NGS-Usa NY,nyhpgn.las,nyhpgn.los
  158. 4269,4152,NGS-Usa OH,ohhpgn.las,ohhpgn.los
  159. 4269,4152,NGS-Usa OK,okhpgn.las,okhpgn.los
  160. 4269,4152,NGS-Usa PA,pahpgn.las,pahpgn.los
  161. 4269,4152,NGS-PRVI,pvhpgn.las,pvhpgn.los
  162. 4269,4152,NGS-Usa SC,schpgn.las,schpgn.los
  163. 4269,4152,NGS-Usa SD,sdhpgn.las,sdhpgn.los
  164. 4269,4152,NGS-Usa TN,tnhpgn.las,tnhpgn.los
  165. 4269,4152,NGS-Usa UT,uthpgn.las,uthpgn.los
  166. 4269,4152,NGS-Usa VA,vahpgn.las,vahpgn.los
  167. 4269,4152,NGS-Usa WI,wihpgn.las,wihpgn.los
  168. 4269,4152,NGS-Usa ID MT w,wmhpgn.las,wmhpgn.los
  169. 4269,4152,NGS-Usa OR WA,wohpgn.las,wohpgn.los
  170. 4269,4152,NGS-Usa TX w,wthpgn.las,wthpgn.los
  171. 4269,4152,NGS-Usa WV,wvhpgn.las,wvhpgn.los
  172. 4269,4152,NGS-Usa WY,wyhpgn.las,wyhpgn.los
  173. 4675,4152,NGS-Gum,guhpgn.las,guhpgn.los
  174. 8351,4156,UGKK-Svk,Slovakia_JTSK03_to_JTSK.LAS.las,Slovakia_JTSK03_to_JTSK.LAS.los
  175. 8351,4156,UGKK-Svk,Slovakia_JTSK03_to_JTSK.LOS.las,Slovakia_JTSK03_to_JTSK.LOS.los
  176. .. The SQL statement::
  177. SELECT DISTINCT source_crs_code SOURCE_CRS, target_crs_code TARGET_CRS, coord_tfm_version VERSION, REPLACE ( REPLACE (val.param_value_file_ref, '.las'), '.los') + '.las' GRID_FILE_NAME_1, REPLACE ( REPLACE (val.param_value_file_ref, '.las'), '.los') + '.los' GRID_FILE_NAME_2
  178. FROM epsg_coordoperationparamvalue val, epsg_coordoperation op
  179. WHERE val.coord_op_method_code = 9613 AND val.coord_op_code = op.coord_op_code AND op.deprecated = 0 AND information_source != 'OGP'
  180. ORDER BY SOURCE_CRS, TARGET_CRS, GRID_FILE_NAME_1, GRID_FILE_NAME_2, VERSION
  181. Define a custom Coordinate Operation
  182. ------------------------------------
  183. Custom Coordinate Operations are defined in :file:`epsg_operations.properties` file. This file has to be placed into the :file:`user_projections` directory, inside your data directory (create it if it doesn't exist).
  184. Each line in :file:`epsg_operations.properties` will describe a coordinate operation consisting of a `source CRS`, a `target CRS`, and a math transform with its parameter values. Use the following syntax::
  185. <source crs code>,<target crs code>=<WKT math transform>
  186. Math transform is described in `Well-Known Text <http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html>`_ syntax. Parameter names and value ranges are described in the `EPSG Geodetic Parameter Registry <http://www.epsg-registry.org/>`_.
  187. .. note::
  188. Use the `Reprojection Console`_ to learn from example and to test your custom definitions.
  189. Examples
  190. ````````
  191. Custom NTv2 file::
  192. 4230,4258=PARAM_MT["NTv2", \
  193. PARAMETER["Latitude and longitude difference file", "100800401.gsb"]]
  194. Geocentric transformation, preceded by an ellipsoid to geocentric conversion, and back geocentric to ellipsoid. The results is a concatenation of three math transforms::
  195. 4230,4258=CONCAT_MT[ \
  196. PARAM_MT["Ellipsoid_To_Geocentric", \
  197. PARAMETER["dim", 2], \
  198. PARAMETER["semi_major", 6378388.0], \
  199. PARAMETER["semi_minor", 6356911.9461279465]], \
  200. PARAM_MT["Position Vector transformation (geog2D domain)", \
  201. PARAMETER["dx", -116.641], \
  202. PARAMETER["dy", -56.931], \
  203. PARAMETER["dz", -110.559], \
  204. PARAMETER["ex", 0.8925078166311858], \
  205. PARAMETER["ey", 0.9207660950870382], \
  206. PARAMETER["ez", -0.9166407989620964], \
  207. PARAMETER["ppm", -3.5200000000346066]], \
  208. PARAM_MT["Geocentric_To_Ellipsoid", \
  209. PARAMETER["dim", 2], \
  210. PARAMETER["semi_major", 6378137.0], \
  211. PARAMETER["semi_minor", 6356752.314140356]]]
  212. You can make use of existing grid shift files such as this explicit transformation from NAD27 to WGS84 made up of a NADCON transform from NAD27 to NAD83 followed by a Molodenski transform converting from the GRS80 Ellipsoid (used by NAD83) to the WGS84 Ellipsoid::
  213. 4267,4326=CONCAT_MT[ \
  214. PARAM_MT["NADCON", \
  215. PARAMETER["Latitude difference file", "conus.las"], \
  216. PARAMETER["Longitude difference file", "conus.los"]], \
  217. PARAM_MT["Molodenski", \
  218. PARAMETER["dim", 2], \
  219. PARAMETER["dx", 0.0], \
  220. PARAMETER["dy", 0.0], \
  221. PARAMETER["dz", 0.0], \
  222. PARAMETER["src_semi_major", 6378137.0], \
  223. PARAMETER["src_semi_minor", 6356752.314140356], \
  224. PARAMETER["tgt_semi_major", 6378137.0], \
  225. PARAMETER["tgt_semi_minor", 6356752.314245179]]]
  226. Affine 2D transform operating directly in projected coordinates::
  227. 23031,25831=PARAM_MT["Affine", \
  228. PARAMETER["num_row", 3], \
  229. PARAMETER["num_col", 3], \
  230. PARAMETER["elt_0_0", 1.0000015503712145], \
  231. PARAMETER["elt_0_1", 0.00000758753979846734], \
  232. PARAMETER["elt_0_2", -129.549], \
  233. PARAMETER["elt_1_0", -0.00000758753979846734], \
  234. PARAMETER["elt_1_1", 1.0000015503712145], \
  235. PARAMETER["elt_1_2", -208.185]]
  236. Each operation can be described in a single line, or can be split in several lines for readability, adding a backslash "\\" at the end of each line, as in the former examples.