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

FeatureInfo: Support parsing values from WMS raster sources that lack both ID and geometry #1274

Closed
jacobwod opened this issue Jan 25, 2023 · 0 comments
Assignees
Labels
module:client/core Core functionality (not a plugin) new feature Request for adding/changing functionality
Milestone

Comments

@jacobwod
Copy link
Member

jacobwod commented Jan 25, 2023

Sometimes we want to read values from sources that lack typical information we usually get from vector-based sources. One example is a GeoTIFF raster where each color is mapped to a value (e.g. height above sea level, or temperature).

If those layers are queried using GeoJSON, there's no way to tell which feature belongs to which layer (because the returned features lack IDs).

But if we request them as GML or text/xml, we might get something that we can work on:

<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns="http://www.opengis.net/wfs" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:bmf="https://bmf.halmstad.se" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs https://karta.halmstad.se/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd">
    <gml:boundedBy>
        <gml:null>unknown</gml:null>
    </gml:boundedBy>
    <gml:featureMember>
        <bmf:ndem_2022 fid="">
            <bmf:GRAY_INDEX>7.832002639770508</bmf:GRAY_INDEX>
        </bmf:ndem_2022>
    </gml:featureMember>
    <gml:featureMember>
        <bmf:dtm_2022 fid="">
            <bmf:GRAY_INDEX>24.24799919128418</bmf:GRAY_INDEX>
        </bmf:dtm_2022>
    </gml:featureMember>
</wfs:FeatureCollection>

The example above contains both one attribute value (GRAY_INDEX) and information on WMS layer name in the response, making it possible for us to match the infoclick definition with the correct layer.

Unfortunately, OpenLayers' built-in parsers fail on generating usable feature IDs (FIDs) here. Hence, a custom solution is needed that will take care of this and produce something really usable.

(This is remotely related to #1099, #1258 and #1266.)

@jacobwod jacobwod added module:client/core Core functionality (not a plugin) new feature Request for adding/changing functionality labels Jan 25, 2023
@jacobwod jacobwod added this to the 3.12 milestone Jan 25, 2023
@jacobwod jacobwod self-assigned this Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:client/core Core functionality (not a plugin) new feature Request for adding/changing functionality
Projects
None yet
Development

No branches or pull requests

1 participant