Skip to content

Proj4 upgrade and include support for "Grid Based Datum Adjustments" #11423#11424

Merged
offtherailz merged 12 commits intogeosolutions-it:masterfrom
rowheat02:feat/projgridfile
Sep 3, 2025
Merged

Proj4 upgrade and include support for "Grid Based Datum Adjustments" #11423#11424
offtherailz merged 12 commits intogeosolutions-it:masterfrom
rowheat02:feat/projgridfile

Conversation

@rowheat02
Copy link
Copy Markdown
Contributor

@rowheat02 rowheat02 commented Sep 2, 2025

Description

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature

fixes #11423

What is the current behavior?

#11423
No Support for Grid-Based Datum Adjustments on proj4's projections

What is the new behavior?

  • Porj4 is updated to a newer version, which has support for "Grid Based Datum Adjustments"
  • Grid-based correction can be applied to the projection definitions ( which will show corrected coordinates during transformation)

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

Other useful information

  • On Projection definitions(localConfig) user can pass the nadgrids parameter. Before that, gridFiles must be defined with a path and the type
  • Grid files will be loaded while starting the app to proj4
  • While transformation, proj4 knows to apply the correction from grid files.

Notes:

  • sample config files on localConfig
    •        "gridFiles": {
             "PENR2009": {
               "path": "http://localhost:8000/PENR2009.gsb", // add hosted url here
               "type": "gsb",
               "description": "ETRS89 transformation grid"
             },
             "es_ign_egm08-rednap": {
               "path": "https://cdn.proj.org/ca_nrc_NA83SCRS.tif",
               "type": "geotiff"
             }
           },
           "projectionDefs": [
             {
               "code": "EPSG:25830",
               "def": "+proj=utm +zone=30 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs +nadgrids=PENR2009",
               "extent": [
                 166021.44,
                 0,
                 833978.56,
                 9329005.18
               ],
               "worldExtent": [
                 -18,
                 27,
                 5,
                 44
               ]
             },
         ]
      
  • Coordinates should be different with and without +nadgrids in projectionDefs
  • Coordinate transformation only works where the area of the grid file is. e.g
  • tested on base map for EPSG
  • image - CRS and bbox are sent correctly and also rendered on the canvas

@rowheat02 rowheat02 added this to the 2025.02.00 milestone Sep 2, 2025
@rowheat02 rowheat02 self-assigned this Sep 2, 2025
@tdipisa tdipisa requested a review from offtherailz September 2, 2025 08:14
@tdipisa tdipisa assigned offtherailz and unassigned rowheat02 Sep 2, 2025
@rowheat02 rowheat02 marked this pull request as ready for review September 2, 2025 09:04
@offtherailz offtherailz self-requested a review September 3, 2025 13:47
@offtherailz
Copy link
Copy Markdown
Member

offtherailz commented Sep 3, 2025

This can be tested by adding to the dev (qa) data dir a config like this:

"gridFiles": {
    "PENR2009": {
      "path": "PENR2009.gsb",
      "type": "gsb",
      "description": "ETRS89 transformation grid"
    },
    "es_ign_egm08-rednap": {
      "path": "https://cdn.proj.org/es_ign_SPED2ETV2.tif",
      "type": "geotiff"
    }
  },
  "projectionDefs": [
    {
      "code": "EPSG:25830",
      "def": "+proj=utm +zone=30 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs +nadgrids=es_ign_egm08-rednap",
      "extent": [
        166021.44,
        0,
        833978.56,
        9329005.18
      ],
      "worldExtent": [
        -18,
        27,
        5,
        44
      ]
    }
  ],

and for CRS selector plugin

"filterAllowedCRS": [
            "EPSG:4326",
            "EPSG:3857",
            "EPSG:25830"
          ],

@offtherailz offtherailz merged commit e2b44ac into geosolutions-it:master Sep 3, 2025
6 checks passed
@offtherailz
Copy link
Copy Markdown
Member

offtherailz commented Sep 3, 2025

Please @ElenaGallo test this.

This to be tested may require to add to localConfig.json

  • gridFiles entry and projectionDefs entry for EPSG:25830
"gridFiles": {
    "PENR2009": {
      "path": "PENR2009.gsb",
      "type": "gsb",
      "description": "ETRS89 transformation grid"
    },
    "es_ign_egm08-rednap": {
      "path": "https://cdn.proj.org/es_ign_SPED2ETV2.tif",
      "type": "geotiff"
    }
  },
  "projectionDefs": [
    {
      "code": "EPSG:25830",
      "def": "+proj=utm +zone=30 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs +nadgrids=es_ign_egm08-rednap",
      "extent": [
        166021.44,
        0,
        833978.56,
        9329005.18
      ],
      "worldExtent": [
        -18,
        27,
        5,
        44
      ]
    }
  ],
  • to CRSSelector and MousePosition plugin a
 "filterAllowedCRS": [
            "EPSG:4326",
            "EPSG:3857",
            "EPSG:25830"
          ],

**We can decide to put these changes on dev/qa datadir (it is ok @tdipisa ? ) or ask @ElenaGallo to test it locally

dsuren1 added a commit to dsuren1/MapStore2 that referenced this pull request Sep 9, 2025
…tinerary

* commit 'ea419127df12f794a56f234f5660632511df7484':
  Update README.md
  Proj4 upgrade and include support for "Grid Based Datum Adjustments" geosolutions-it#11423 (geosolutions-it#11424)
  Bom versions for maven-war-plugin in all POMs.xml (geosolutions-it#11413)
  Fix geosolutions-it#11419 fixed group translation files (geosolutions-it#11420)
  Update geoserver.md (geosolutions-it#11399)
  Bump org.apache.tomcat:tomcat-coyote from 9.0.105 to 9.0.108 in /binary (geosolutions-it#11384)
  Update on the Swedish translation file for MapStore (geosolutions-it#11412)
  Fix geosolutions-it#11258 :For clipping/masking 3D tiles and terrain removed ClippingPlaneCollection and introduced ClippingPolygonCollection (geosolutions-it#11352)
  Fix : geosolutions-it#11400 Added quickFilters also  when exporting data from TableWidget (geosolutions-it#11401)
  Fix geosolutions-it#11404 Problem with user permissions still involving the "Save As" (geosolutions-it#11408)
  Fix geosolutions-it#11406 Pending changes prompt shows up after save as (geosolutions-it#11407)
  Fix geosolutions-it#11374 Improve the Street Smart plugin view for 3D maps visualization (geosolutions-it#11375)
  Update i18n showEmptyMessageGFI (geosolutions-it#11392)
  geosolutions-it#11369: Enhance non hyperlink query field to have spacing (geosolutions-it#11370)
  Bump org.apache.tomcat:tomcat-util from 9.0.105 to 9.0.107 in /binary (geosolutions-it#11305)
  chore: Remove element-closest dependency (geosolutions-it#11251)
  Fix the widget support for the WFS layer with no geom (geosolutions-it#11379)
  Support of widget in map even when layer have no geometry and fix time dependencies for the widget (geosolutions-it#11377)
  Performace Lag when there is a layer with very large geomerty geosolutions-it#11358 (geosolutions-it#11359)
  skip click on layer should return intersected features test on Cesium tests (geosolutions-it#11365)
@ElenaGallo
Copy link
Copy Markdown
Contributor

ElenaGallo commented Nov 12, 2025

@offtherailz I added these config, but when I open a new map and select "EPSG:25830", the coordinates are not visible for the Iberian Peninsula area.

See the video below:

proj.mp4

Did I miss a step?

@tdipisa
Copy link
Copy Markdown
Member

tdipisa commented Nov 12, 2025

@offtherailz or @rowheat02 can you please assisti for the above?

@rowheat02
Copy link
Copy Markdown
Contributor Author

@ElenaGallo, I have corrected the TIFF file link for the given projection system: #11424 (comment)
should be "https://cdn.proj.org/ca_nrc_NA83SCRS.tif"
Can you test it now in the Spanish region?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proj4 upgrade and include support for "Grid Based Datum Adjustments"

5 participants