That sounds okay, goal is to surface this information for use in the
GetFeatureInfo free marker template?
- It may be more appropriate to use a RecordId or FeatureId then a String?
- Idea: If you are surfacing the feature id it may be worth outing the
other granule properties at the same time, or is that already available ....
- The handling of interpolation sounds a bit suspect, may be better to
return the nearest neighbour FID and attributes

--
Jody Garnett


On Wed, 17 Jul 2019 at 13:48, Josh Fix via Geoserver-devel <
[email protected]> wrote:

> I was interested in submitting a PR to enhance the GetFeatureInfo response
> for image mosaics, but thought I would post here first.
>
> When GetFeatureInfo is called on an image mosaic, the pixel values are
> returned in a table.  The first column of the table is "fid", but is never
> populated.  I would like to submit PRs (requires a PR for GeoTools and
> GeoServer) to return the fid(s) of the features used for granule(s) used
> for the corresponding pixel values.  I thought I would start a conversation
> here first.
>
> The changes would entail:
>
> 1) [gt] Adding a "String sourceFid" to RasterLayerResponse
> <https://github.com/geotools/geotools/blob/master/modules/plugin/imagemosaic/src/main/java/org/geotools/gce/imagemosaic/RasterLayerResponse.java#L524>
> 2) [gt] In BaseSubmosaicProducer
> <https://github.com/geotools/geotools/blob/master/modules/plugin/imagemosaic/src/main/java/org/geotools/gce/imagemosaic/granulecollector/BaseSubmosaicProducer.java#L228>,
> get the fid from GranuleLoadingResult.originator
> <https://github.com/geotools/geotools/blob/master/modules/plugin/imagemosaic/src/main/java/org/geotools/gce/imagemosaic/GranuleDescriptor.java#L336>,
> which is a `SimpleFeature`, and set it on the rasterLayerResponse.
> 3) [gt] In RasterLayerResponse
> <https://github.com/geotools/geotools/blob/master/modules/plugin/imagemosaic/src/main/java/org/geotools/gce/imagemosaic/RasterLayerResponse.java#L1240>,
> put the fid into the properties map for the coverage.  (maybe need to add a
> new public static final String for the key to GridCoverage2DReader...
> SOURCE_FID_PROPERTY?)
> 4) [gs] In RasterLayerIdentifier
> <https://github.com/geoserver/geoserver/blob/master/src/wms/src/main/java/org/geoserver/wms/featureinfo/RasterLayerIdentifier.java#L327>,
> get the fid from the properties map in the coverage object, and set it as
> the id in the call to SimpleFeatureBuilder.build.
>
> In the event the value comes from interpolation of more than one granule,
> the fid would be a comma separated string containing the feature ids of the
> granules used to calculate the value.
>
> Any thoughts or objections?
>
> V/r,
>
> Josh
>
>
>
> _______________________________________________
> Geoserver-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to