NCEAS / metacatui

MetacatUI: A client-side web interface for DataONE data repositories
https://nceas.github.io/metacatui
Apache License 2.0
41 stars 27 forks source link

Add support for click-to-request more info for map features #2190

Open robyngit opened 1 year ago

robyngit commented 1 year ago

We need a flexible and standardized way to allow users to click on a map feature and retrieve more information about it, without having all of this information pre-loaded in the browser. This feature should be compatible with existing standards like OGC's GetFeatureInfo from Web Map Service (WMS), as well as custom APIs like the LEO Network.

Context

GetFeatureInfo Standard

GetFeatureInfo is a part of the OGC's WMS standard. It enables clients to retrieve information about a map feature by sending a request to the WMS service. This request includes various parameters such as the pixel or geographical coordinates where the user clicked, the layers to query, and the desired output format.

Example Request URL:

http://your-wms-service.org/wms?REQUEST=GetFeatureInfo&SERVICE=WMS&VERSION=1.3.0&LAYERS=your-layer&QUERY_LAYERS=your-layer&WIDTH=800&HEIGHT=600&CRS=EPSG:4326&STYLES=&BBOX=40,-100,45,-95&X=400&Y=300&INFO_FORMAT=text/html
Custom APIs: LEO Network

In addition to established standards, our implementation should also support custom APIs like the LEO Network. This would involve sending an API request to retrieve data about a specific feature based on the user's interaction with the map.

Considerations

robyngit commented 8 months ago

This feature has been requested by DRP, from duplicate issue #2240:

Vector features are already selectable and bring up a box with attribute information. The same should happen when the user clicks on a visible raster layer. Probably the way this should work is that all visible raster layers will report sample values at the chosen point. This way, the user (and the developer) avoids having to work around the problem of "visibility" which may complicate their understanding of sampling just the "top" layer. Plus, until TOC layers are reorderable (https://github.com/NCEAS/metacatui/issues/1769), this would be a way of reporting cell values that are unbiased by their ordering in the TOC, which is largely arbitrary.

Is your feature request related to a problem? Please describe. Feedback from the DRP meeting is that people don't know what to do with the raster layers that have been added. They look good and behave in the way they expect, but generally they are only good for visualization at the moment. They should instead be useful as "decisionmaking tools" as well, i.e. they should be able to convey some quantitative data when the user selects certain locations.

Additional context Similar to this view but with one value per visible raster layer, separated by layer name, perhaps with a lat/lon sample location at the top.


To obtain point information from our raster layers, we will need some sort of backend service. The service will need to be queryable for a given location, and will need to return actual data values from the raster datasets. The browser currently only has access to the PNG representation of the raster data.

There is a standardized approach to this outlined in WMS: the 'GetFeatureInfo' request can be used to retrieve information about particular points on a raster layer. When a user clicks a point on the map, the coordinates are sent to the server via a GetFeatureInfo request, and the server returns information about the raster cell at that location.