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 mapml-proxy cascading #374

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dromagnoli
Copy link
Member

@dromagnoli dromagnoli commented Aug 23, 2024

PR supporting MapML proxy.

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 dromagnoli requested a review from aaime August 23, 2024 14:12
@prushforth
Copy link
Collaborator

I have successfully used this branch with the CFS CWFIS WMS (GeoServer!), and I found it works well in Remote request mode, except the remote GetFeatureInfo request balks at including of a blank cql_filter paramter:

e.g. the following template
https://cwfis.cfs.nrcan.gc.ca/geoserver/wms?request=GetFeatureInfo&query_layers=fdr_current&crs=EPSG:3978&bbox={xmin},{ymin},{xmax},{ymax}&language=en&cql_filter=&version=1.3.0&transparent=true&service=WMS&layers=fdr_current&width={w}&x={i}&feature_count=50&y={j}&styles=&info_format=text/html&height={h}

when filled out gives rise to an example query such as:

https://cwfis.cfs.nrcan.gc.ca/geoserver/wms?request=GetFeatureInfo&query_layers=fdr_current&crs=EPSG:3978&bbox=-1150222.572178498,-634225.7217853889,863260.6214545518,1688820.5909739062&language=en&cql_filter=&version=1.3.0&transparent=true&service=WMS&layers=fdr_current&width=761&x=381&feature_count=50&y=439&styles=&info_format=text/html&height=878

I find that if I edit the above URL and remove the cql_filter parameter entirely, it works ok:

https://cwfis.cfs.nrcan.gc.ca/geoserver/wms?request=GetFeatureInfo&query_layers=fdr_current&crs=EPSG:3978&bbox=-1150222.572178498,-634225.7217853889,863260.6214545518,1688820.5909739062&language=en&version=1.3.0&transparent=true&service=WMS&layers=fdr_current&width=761&x=381&feature_count=50&y=439&styles=&info_format=text/html&height=878

Maybe this is actually a bug in GeoServer cql_filter handling? Anyway, I will see if there are other cases I come across.

@dromagnoli dromagnoli marked this pull request as ready for review August 27, 2024 11:04
@dromagnoli
Copy link
Member Author

PR updated with WMTS tests and getFeatureInfo with empty cql_filter being properly handled.

@dromagnoli dromagnoli force-pushed the mapml-cascading branch 2 times, most recently from 667ac05 to 043a482 Compare August 27, 2024 13:37
@prushforth
Copy link
Collaborator

prushforth commented Sep 5, 2024

Just returning to playing with this, and maybe it's something odd about the remote WMS, but I can't get it to proxy correctly, it always seems to truncate the "_en" from the remote URL. The remote WMS capabilities is here

The remote layer name to proxy is "WMS-Toporama", which is like a layer group afaict on the remote wms.
image

The client proxy always comes back with a 404, because it uses an incorrect URL in the tref attribute of the <map-link>:
image

Edit: Something similar seems to happen with this WMS - i.e. the base URL gets truncated and substituted with wms inadvertently.

@prushforth
Copy link
Collaborator

prushforth commented Sep 23, 2024

Ideally, creation (at all) of the <map-link rel="query"> would be conditional on if the remote layer is queryable.

IIRC GeoServer itself can cascade remote queries if the remote WMS supports some flavour of GML. Maybe we could change that when the Remote proxy option for MapML is selected, to text/mapml, text/html or text/plain availability? If none is available we would not create a <map-link rel="query" at all, as though the remote layer was not queryable in the first place.

@dromagnoli
Copy link
Member Author

Ideally, creation (at all) of the would be conditional on if the remote layer is queryable.

IIRC GeoServer itself can cascade remote queries if the remote WMS supports some flavour of GML. Maybe we could change that when the Remote proxy option for MapML is selected, to text/mapml, text/html or text/plain availability? If none is available we would not create a <map-link rel="query" at all, as though the remote layer was not queryable in the first place.

I have updated the code so that it won't generate the query link if the remote server has none of these format supported.
I have also added a test.

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.

2 participants