import proj4 from "proj4"; import { register } from "ol/proj/proj4"; export const projectionSetup = () => { // Note: EPSG:4167 is NZGD2000 // this is an approximation to NZGD2000 // because the deformation model is not being applied // The difference is up to 1m proj4.defs( "EPSG:4167", "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs" ); // EPSG:1 is user defined and used for LOL coordinates in the database // which are NZGD2000 - 160 degrees // Note the caveat above also applies proj4.defs( "EPSG:1", "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs +pm=160" ); register(proj4); }; // Use these constants at app level in preference to the EPSG number export const lolDatum = "EPSG:4167"; export const lolDatumOffset = "EPSG:1";