Atlaslog
Atlaslog / Field Notes / Loading & display
Field note · Loading & display

GeoServer declares 4326 data as 4490, layer shifts half a meter

Quick answer

The data is WGS84 but the layer's nativeCRS is set to EPSG:4490, so GeoServer treats them as different datums and applies a shift on every request. The boundary moves about 0.45 m west and fails a 1:1000 acceptance check.

Last verified 2026-11-03 · Multiple versions · Cite this page
Applies to: GeoServer 2.20 ~ 2.24 · PostGIS 3.4
Symptom
Checklist
  1. Open the layer edit page and compare Declared SRS with Native SRS.
  2. Fetch one known vertex with GetFeature and subtract the original file coordinate.
  3. A difference in the 1e-6~1e-5 degree range points to a datum shift, not a projection change.
  4. Switch SRS handling to FORCE_DECLARED or REPROJECT_TO_DECLARED and fetch again to see whether the difference disappears.
  5. Check that the PostGIS geometry SRID matches the declared layer CRS.
Fix

Set nativeCRS to what the data really is, 4326 for WGS84 and 4490 for CGCS2000, then choose FORCE_DECLARED when only the metadata was wrong and REPROJECT_TO_DECLARED when a real transformation is required.

Code
# 取一个顶点对比
curl "http://localhost:8080/geoserver/gis/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=gis:districts&maxFeatures=1&outputFormat=application/json"

# 原始值  116.3974280, 39.9092300
# 返回值  116.3974235, 39.9092302
# 差      -4.5e-6 度,约 0.45 米
PUT /rest/workspaces/gis/datastores/pg/featuretypes/districts
Content-Type: application/json
{
  "featureType": {
    "nativeCRS": "EPSG:4326",
    "srs": "EPSG:4326",
    "projectionPolicy": "FORCE_DECLARED"
  }
}
Watch out
All 120 field notesChinese originalRunnable examples
English edition written for Atlaslog from the original Chinese field note. Code is unchanged and runs as-is.
Cite this page

Atlaslog (2026). GeoServer declares 4326 data as 4490, layer shifts half a meter. https://www.jingweizhi.com/en/cookbook/geoserver-srs-mismatch.html (accessed 2026-11-03).