1"use strict";(globalThis.webpackChunkhc_documentation=globalThis.webpackChunkhc_documentation||[]).push([[6548],{2016(e,t,n){n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>s,default:()=>h,frontMatter:()=>o,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"tutorials/2018-05-04-shp-tutorial","title":"Preparing ESRI shapefiles for online transformation","description":"ESRI Shapefile format","source":"@site/docs/tutorials/2018-05-04-shp-tutorial.md","sourceDirName":"tutorials","slug":"/tutorials/2018-05-04-shp-tutorial","permalink":"/docs/tutorials/2018-05-04-shp-tutorial","draft":false,"unlisted":false,"editUrl":"https://github.com/wetransform/hc-documentation/tree/master/docs/tutorials/2018-05-04-shp-tutorial.md","tags":[],"version":"current","frontMatter":{"title":"Preparing ESRI shapefiles for online transformation","categories":["help-page-category-tutorials","help-page-subcategory-tutorials"],"layout":"help-detail","language":"en"},"sidebar":"tutorialSidebar","previous":{"title":"Creating Styled Layer Descriptor files (SLDs) for hale\xbbconnect","permalink":"/docs/tutorials/2018-05-03-sld-tutorial"},"next":{"title":"Creating a profile using the hale\xbbconnect Profile Management Tool (PMT)","permalink":"/docs/tutorials/2018-05-05-pmt-tutorial"}}');var r=n(4848),a=n(8453);const o={title:"Preparing ESRI shapefiles for online transformation",categories:["help-page-category-tutorials","help-page-subcategory-tutorials"],layout:"help-detail",language:"en"},s=void 0,l={},c=[{value:"<strong>ESRI Shapefile format</strong>",id:"esri-shapefile-format",level:3},{value:"<strong>Datum transformations</strong>",id:"datum-transformations",level:3},{value:"<strong>Coordinate reference system identification in hale\xbbconnect</strong>",id:"coordinate-reference-system-identification-in-haleconnect",level:3},{value:"<strong>Manually adding the AUTHORITY parameter to an ESRI prj file</strong>",id:"manually-adding-the-authority-parameter-to-an-esri-prj-file",level:3},{value:"<strong>Axis flip</strong>",id:"axis-flip",level:3}];function d(e){const t={a:"a",code:"code",em:"em",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h3,{id:"esri-shapefile-format",children:(0,r.jsx)(t.strong,{children:"ESRI Shapefile format"})}),"\n",(0,r.jsx)(t.p,{children:"The ESRI shapefile is a vector data storage format comprised of three files with the same file name prefix:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"shp: stores the geometry as a list of vertices"}),"\n",(0,r.jsx)(t.li,{children:"shx: index of the geometry to enable fast, index-based searches"}),"\n",(0,r.jsx)(t.li,{children:"dbf: dBase file used to store attribute information"}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["Shapefiles may have additional files, such as ",(0,r.jsx)(t.code,{children:".prj"})," which stores coordinate system information (used by ArcGIS), or ",(0,r.jsx)(t.code,{children:".cpg"})," which specifies the code page for identifying the character set to be used. By definition, a vector is a Cartesian-based (i.e. X,Y) data structure used to store spatial data. Most geographic information systems, including ESRI's ArcGIS, store geospatial data in vector format. Other common spatial data formats include raster and TIN.\nFor more information, read the ",(0,r.jsx)(t.a,{href:"https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf",children:"ESRI Shapefile Technical Description: An ESRI White Paper-July 1988"})]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"ESRI prj files and WKT files"})}),"\n",(0,r.jsxs)(t.p,{children:["A shapefile is typically accompanied by a ",(0,r.jsx)(t.code,{children:".prj"})," file that contains a Well known text (WKT) string which stores coordinate reference system information. Well known text (WKT) is a text markup language for representing vector geometry objects on a map. The format was originally defined by the Open Geospatial Consortium (OGC) and described in their Simple Feature Access specification, to which ESRI was a contributing member. The ",(0,r.jsx)(t.a,{href:"https://www.opengeospatial.org/standards/wkt-crs",children:"current version of the WKT standard"})," was published on August 13, 2019."]}
1),"\n",(0,r.jsxs)(t.p,{children:["Not all ",(0,r.jsx)(t.code,{children:".prj"})," files contain the same parameters. There are also syntactical differences between ESRI WKT files and OGC WKT files. Visit the ",(0,r.jsx)(t.a,{href:"https://epsg.io/",children:"EPSG.io"})," to view examples of different WKT files. Here are examples of WKT files for EPSG:25832:"]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.em,{children:(0,r.jsx)(t.strong,{children:"Example of Well Known Text as HTML"})})}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{children:'PROJCS["ETRS89 / UTM zone 32N",\n GEOGCS["ETRS89",\n DATUM["European_Terrestrial_Reference_System_1989",\n SPHEROID["GRS 1980",6378137,298.257222101,\n AUTHORITY["EPSG","7019"]],\n TOWGS84[0,0,0,0,0,0,0],\n AUTHORITY["EPSG","6258"]],\n PRIMEM["Greenwich",0,\n AUTHORITY["EPSG","8901"]],\n UNIT["degree",0.0174532925199433,\n AUTHORITY["EPSG","9122"]],\n AUTHORITY["EPSG","4258"]],\nPROJECTION["Transverse_Mercator"],\nPARAMETER["latitude_of_origin",0],\nPARAMETER["central_meridian",9],\nPARAMETER["scale_factor",0.9996],\nPARAMETER["false_easting",500000],\nPARAMETER["false_northing",0],\nUNIT["metre",1,\n AUTHORITY["EPSG","9001"]],\nAXIS["Easting",EAST],\nAXIS["Northing",NORTH],\nAUTHORITY["EPSG","25832"]]\n'})}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.em,{children:(0,r.jsx)(t.strong,{children:"Example of OGC WKT"})})}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{children:'PROJCS["ETRS89 / UTM zone 32N",\n GEOGCS["ETRS89",\n DATUM["European_Terrestrial_Reference_System_1989",\n SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],\n TOWGS84[0,0,0,0,0,0,0],\n AUTHORITY["EPSG","6258"]],\n PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],\n UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],\n AUTHORITY["EPSG","4258"]],\nPROJECTION["Transverse_Mercator"],\nPARAMETER["latitude_of_origin",0],\nPARAMETER["central_meridian",9],\nPARAMETER["scale_factor",0.9996],\nPARAMETER["false_easting",500000],\nPARAMETER["false_northing",0],\nUNIT["metre",1,AUTHORITY["EPSG","9001"]],\nAXIS["Easting",EAST],\nAXIS["Northing",NORTH],\nAUTHORITY["EPSG","25832"]]\n'})}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.em,{children:(0,r.jsx)(t.strong,{children:"Example of ESRI WKT"})})}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{children:'PROJCS["ETRS89_UTM_zone_32N",\n GEOGCS["GCS_ETRS_1989",\n DATUM["D_ETRS_1989",\n SPHEROID["GRS_1980",6378137,298.257222101]],\n PRIMEM["Greenwich",0],\n UNIT["Degree",0.017453292519943295]],\nPROJECTION["Transverse_Mercator"],\nPARAMETER["latitude_of_origin",0],\nPARAMETER["central_meridian",9],\nPARAMETER["scale_factor",0.9996],\nPARAMETER["false_easting",500000],\nPARAMETER["false_northing",0],\nUNIT["Meter",1]]\n'})}),"\n",(0,r.jsx)(t.h3,{id:"datum-transformations",children:(0,r.jsx)(t.strong,{children:"Datum transformations"})}),"\n",(0,r.jsx)(t.p,{children:"Datum transformations are required when your transformation from one coordinate system to another includes a geographic coordinate system. Datum transformations should be performed with caution because they can result in significant data shifts of 1 meter or more. There are several different methods used to perform datum transformation- Bursa-Wolf is one method."}),"\n",(0,r.jsxs)(t.p,{children:["The WKT parameter ",(0,r.jsx)(t.code,{children:"TOWGS84"})," is used to approximate a transformation from the horizontal datum to the WGS84 datum.\nThe original Simple Features specification of WKT does not specify ",(0,r.jsx)(t.code,{children:"TOWGS84"})," as a valid keyword. ESRI does not support the ",(0,r.jsx)(t.code,{children:"TOWGS84"})," parameter in WKT. Instead of using a fixed transformation, ESRI software asks the user to choose an appropriate transformation method when necessary, as does QGIS."]}),"\n",(0,r.jsxs)(t.p,{children:["The current version of WKT has no backward compatibility with ",(0,r.jsx)(t.code,{children:"TOWGS84"}),". WKT descriptions of geodetic datums written to the OGC 01-009 specification are not readable by implementations of the current WKT specification if the optional ",(0,r.jsx)(t.code,{children:"TOWGS84"})," object is provided."]}),"\n",(0,r.jsx)(t.h3,{id:"coordinate-reference-system-identification-in-haleconnect",children:(0,r.jsx)(t.strong,{children:"Coordinate reference system identification in hale\xbbconnect"})}),"\n",(0,r.jsxs)(t.p,{children:["hale\xbbconnect uses the open source Java GIS toolkit GeoTools to process spatial data. GeoTools, in turn, contains a copy of the ",(0,r.jsx)(t.a,{href:"http://www.epsg-registry.org/",children:"EPSG database"}
1),". When a shapefile is uploaded to the platform, hale\xbbconnect uses the GeoTools library to attempt to match the WKT contained in the ",(0,r.jsx)(t.code,{children:".prj"})," file to the CRS definitions in the EPSG database. If a match is found, the data is subsequently processed using the matched EPSG CRS code."]}),"\n",(0,r.jsxs)(t.p,{children:["In some cases, GeoTools cannot determine the CRS definition based on the information contained in the WKT. To support GeoTools in finding the correct match, the user can add an ",(0,r.jsx)(t.code,{children:"AUTHORITY"})," parameter as the final parameter to the WKT file. GeoTools then uses the user-supplied EPSG code in the ",(0,r.jsx)(t.code,{children:"AUTHORITY"})," parameter to apply the CRS definition defined in the EPSG database to the shapefile. These definitions also contain the Bursa-Wolf parameters required for datum transformation from the CRS definitions in the EPSG database."]}),"\n",(0,r.jsx)(t.h3,{id:"manually-adding-the-authority-parameter-to-an-esri-prj-file",children:(0,r.jsx)(t.strong,{children:"Manually adding the AUTHORITY parameter to an ESRI prj file"})}),"\n",(0,r.jsxs)(t.p,{children:["You can manually edit an ESRI ",(0,r.jsx)(t.code,{children:".prj"})," file to include the optional ",(0,r.jsx)(t.code,{children:"AUTHORITY"})," parameter. The parameter must be added as the final, terminating parameter in the file using the following pattern: ",(0,r.jsx)(t.code,{children:'AUTHORITY["EPSG","25832"]'}),". Although the use of the ",(0,r.jsx)(t.code,{children:"AUTHORITY"})," parameter is officially deprecated in the current version of WKT, for purposes of backward compatibility its use is still accepted."]}),"\n",(0,r.jsxs)(t.p,{children:["In the current version of WKT, the ",(0,r.jsx)(t.code,{children:"AUTHORITY"})," object has been replaced by the ",(0,r.jsx)(t.code,{children:"ID"})," object. The identifier object is not as narrowly defined as ",(0,r.jsx)(t.code,{children:"AUTHORITY"})," was in previous versions."]}),"\n",(0,r.jsx)(t.h3,{id:"axis-flip",children:(0,r.jsx)(t.strong,{children:"Axis flip"})}),"\n",(0,r.jsxs)(t.p,{children:["The root cause for many of the axis-flip problems users experience, is that the axis order of the geometries in the shapefile is longitude, latitude/Easting, Northing but the WKT definition in the ",(0,r.jsx)(t.code,{children:".prj"})," file describes a CRS that has latitude, longitude/Northing, Easting axis order. For example, WGS 84 = EPSG:4326."]}),"\n",(0,r.jsxs)(t.p,{children:["This is problematic if no EPSG definition for the CRS with the axis order used in the shapefile exists, because no matching code can be provided for the ",(0,r.jsx)(t.code,{children:"AUTHORITY"}),' parameter. In these cases it is necessary to use the "Flip coordinate order" toggle to flip the axis order after publishing the dataset.']}),"\n",(0,r.jsxs)(t.p,{children:["In the end, the only way to handle axis order is to analyze the axis order of the shapefile geometries and determine if the axis order fits the CRS definition in the ",(0,r.jsx)(t.code,{children:".prj"})," file and act accordingly, i.e. either add an ",(0,r.jsx)(t.code,{children:"AUTHORITY"})," parameter to the ",(0,r.jsx)(t.code,{children:".prj"}),' file or utilize the "Flip coordinate order" toggle in hale\xbbconnect.']})]})}function h(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453(e,t,n){n.d(t,{R:()=>o,x:()=>s});var i=n(6540);const r={},a=i.createContext(r);function o(e){const t=i.useContext(a);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(a.Provider,{value:t},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.