Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting TCRS configuration through gridset selector #375

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dromagnoli
Copy link
Member

Checklist

For core and extension modules:

  • New unit tests have been added covering the changes.
  • Documentation has been updated (if change is visible to end users).
  • The REST API docs have been updated (when changing configuration objects or the REST controllers).
  • There is an issue in the GeoServer Jira (except for changes that do not affect administrators or end users in any way).
  • Commit message(s) must be in the form [GEOS-XYZWV] Title of the Jira ticket.
  • Bug fixes and small new features are presented as a single commit.
  • Each commit has a single objective (if there are multiple commits, each has a separate JIRA ticket describing its goal).

@dromagnoli
Copy link
Member Author

Code depends on this GeoTools PR adding PROJ formatting support: geosolutions-it/geotools#84

MapML XML/XSD has been updated to modify the projection elements.
It was tied to ProjType which is an enum only supporting the 4 Built-in Projections (WGS84,CBMTILE,APSTILE,OSMTILE).
I have created a WrappingProjType which encapsulates the ProjType and modified projection elements of xsd/xml to be simple String instead of ProjType type. Please, let me know if that's ok.

Side Question on the next task related to Projection support:
SW.4.1.19 requires allowing GeoServer admin to set the default projection MapML URL.
At the moment I think is it already supported.
Admin can specify default Projection during layer configuration, by specifying a MapML:CRS as Declared CRS and select Reproject Native to Declared.
image

The generated LayerPreview will use that CRS.
http://localhost:8080/geoserver/topp/wms?service=WMS&version=1.1.0&request=GetMap&layers=topp%3Astates&bbox=-2154706.877127081%2C2763762.2272634404%2C3844204.014332743%2C5981537.174078367&width=768&height=411&srs=MapML%3AUTM14WGS84Quad&styles=&format=text%2Fhtml%3B%20subtype%3Dmapml

image
image

Is it what is requested?
Or do we actually need a different feature where we want the possibility to specify a Declared CRS and specify a different Default output CRS?

@prushforth
Copy link
Collaborator

prushforth commented Oct 21, 2024

MapML XML/XSD has been updated to modify the projection elements.
It was tied to ProjType which is an enum only supporting the 4 Built-in Projections (WGS84,CBMTILE,APSTILE,OSMTILE).
I have created a WrappingProjType which encapsulates the ProjType and modified projection elements of xsd/xml to be simple String instead of ProjType type. Please, let me know if that's ok.

That is ok! One thing I don't want to have happen is to allow the projection name string to contain :, as I don't want users to use for example, "EPSG:4326" as the name of a TCRS, since they are definitely not the same kind of thing. I noticed that the data type used in the rnc was string but in the xsd it's anyURI which might lead to trouble, but I suppose even a plain string without the : can be considered a URI. If I use the example pictured, we want to use MapML:UTM14WGS84QUAD as the value required by GeoServer (GetMap srsName parameter requirement), but inside the HTML and MapML document it should be used without the prefix:

<mapml-viewer projection="UTM14WGS84QUAD" ...>...</mapml-viewer>

Side Question on the next task related to Projection support:
SW.4.1.19 requires allowing GeoServer admin to set the default projection MapML URL.
At the moment I think is it already supported.

You are correct.

Admin can specify default Projection during layer configuration, by specifying a MapML:CRS as Declared CRS and select Reproject Native to Declared.

This is done, thanks!

@dromagnoli
Copy link
Member Author

One thing I don't want to have happen is to allow the projection name string to contain :

This is already addressed, there is also a note in the GridSet to TCRS Selector documentation that reports that:
https://github.com/geosolutions-it/geoserver/pull/375/files#diff-3bb5273b2d308af6af5f3b5f39e968a4307b50fe4084adf3e6dda3f2c8935fe8R73

Quoting:
Gridsets containing ":" character in the name won't be listed

@dromagnoli dromagnoli requested a review from aaime October 28, 2024 09:34
Copy link
Member

@aaime aaime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, see comments below


/** */
public MapMLGridsets() {
gwc = GeoServerExtensions.bean(GWC.class);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a java bean, why isn't it injected through he constructor (or like before, using autowiring?)

TILED_CRS.put(name, tiledCRS);
TILED_CRS.put(("MAPML:" + name).toUpperCase(), tiledCRS);
if (code.toUpperCase().startsWith("EPSG:")) {
String urnEPSGcode = code.replace("EPSG:", "URN:OGC:DEF:CRS:EPSG::");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And what if we want to use MapML on Mars or the Sun? (e.g., IAU authority)


@Test
public void testGridsetToTiledCRS() throws Exception {
CoordinateReferenceSystem crs = CRS.decode("MapML:UTM31WGS84Quad");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. I would also check that:

  • The code shows up in "CRS.getSupportedCodes()
  • A GUI test that adds a built-in valid griset as a valid TRCS, and after the submission, the CRS class can find it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants