Atlaslog / Field Notes / Coordinates & projections
Field note · Coordinates & projections
proj4 throws unknown projection: EPSG:4547
Quick answer
proj4js ships a built-in table with 4326, 3857 and 326xx but not the CGCS2000 3-degree codes, so an unregistered code makes its lookup return undefined and throws. Some builds alias 4490 to 4326, which appears to work but lacks ellps=GRS80.
Symptom
- Console throws Error: unknown projection: EPSG:4547 while the same call with EPSG:3857 or EPSG:4326 succeeds.
- EPSG:4526 and EPSG:4490 fail the same way; all affected codes are CGCS2000.
- proj4.defs('EPSG:4547') returns undefined, while proj4.defs('EPSG:3857') returns an object.
Checklist
- Run proj4.defs('EPSG:4547') in the console; undefined means it is not registered.
- Run proj4.defs('EPSG:3857') as a control to confirm the built-in table is available.
- Look up the PROJ string for the code on epsg.org or in proj4js defs.js.
- Check the argument order in proj4.defs; the name must come first, as 'EPSG:4547'.
- After registering, project a point on the central meridian and check that x is exactly 500000.
Fix
Register the definition before use: proj4.defs('EPSG:4547', '+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs'); in OpenLayers, call ol.proj.proj4.register(proj4) instead of proj4 directly.
Code
Uncaught Error: unknown projection: EPSG:4547
at proj4 (proj4.js:1:1)
at <anonymous>:1:1console.log(proj4.defs('EPSG:4547')); // undefined
console.log(proj4.defs('EPSG:3857')); // { title: 'WGS 84 / Pseudo-Mercator', ... }
Watch out
- Writing proj4.defs(projString, 'EPSG:4547') with the arguments reversed, which registers nothing useful.
- Using the 4326 definition as a stand-in for 4490; it lacks ellps=GRS80 and hides the datum difference.
English edition written for Atlaslog from the original Chinese field note. Code is unchanged and runs as-is.
Atlaslog (2026). proj4 throws unknown projection: EPSG:4547. https://www.jingweizhi.com/en/cookbook/proj4-defs-missing.html (accessed 2026-11-03).