Skip to content

Conversation

@ShubhamSharmaFAO
Copy link

Feature: WebMapTileService GetFeatureInfo support & specs

Description

Adds WMTS GetFeatureInfo (feature picking) to WebMapTileServiceImageryProvider:

  • New options: enablePickFeatures (default true), getFeatureInfoFormats, getFeatureInfoUrl, getFeatureInfoParameters.
  • Implements pickFeatures via UrlTemplateImageryProvider + GetFeatureInfoFormat; supports both KVP and REST templating.
  • Honors dimensions and time-dynamic values; supports JSON/XML/HTML with format fallback.
  • Non‑breaking: default behavior enables picking; existing imagery fetching unchanged.
  • Provides GetFeatureInfo for WMTS imagery layers.

Issue number and link

  • Discussion: https://github.com/TerriaJS/terriajs/discussions/7603

Testing plan

  • Lint/build/docs/types
npm run eslint
npm run build
npm run build-docs
npm run build-ts
  • Targeted unit suite
npm run test -- --includeName WebMapTileServiceImageryProvider
  • Verifies:
    • Disabled states: empty getFeatureInfoFormats, enablePickFeatures=false
    • Initialization for KVP and REST URLs
    • getFeatureInfoUrl override used for picking
    • Request construction (service/version/request/layer/style/tilematrixset/tilematrix/tilecol/tilerow/i/j/infoformat)
    • Dimensions in KVP (query) and REST (template) forms
    • Time-dynamic values in query and template (with URL-encoding)
    • getFeatureInfoParameters lowercased into query
    • JSON parsing to ImageryLayerFeatureInfo[] with name/position checks
    • XML (fetchXML) and HTML (fetchText) infoformats
    • Fallback to next format when the first request fails

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code


const pickFeaturesCustomTags = createPickFeaturesCustomTags(this);

this._pickFeaturesProvider = new UrlTemplateImageryProvider({

Choose a reason for hiding this comment

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

What worries me here is that we now have two ways to build URLs: one for loading images and one for picking features. Ideally, we'd have a single interface to handle both.
@na9da, what do you think about changing everything in this class to use UrlTemplateImageryProvider? Changing everything to tileProvider will require more changes to the file, but it will make the file more straightforward and give us more confidence that requests are made with the same parameters.
In the long run, we could also push the changes upstream to cesium (first merge it here so we don't block other tickets).

p.s. There are quite a few lines of code that are the same in WebMapTileServiceImageryProvider as in UrlTemplateImageryProvider.

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