Hey Jody,

Yes, the goal is to surface the information not only for the HTML output of
GetFeatureInfo, but for all outputs.  The pixel values are bundled in a
SimpleFeature, and the line that builds that feature in
RasterLayerIdentifier looks like this:

return DataUtilities.collection(SimpleFeatureBuilder.build(gridType,
values, ""));

Where "" is the id String.  That feature is used as the source for all
output formats, and for all output formats, the fid is empty.  In GML3, the
output looks like this:

<gml:featureMembers>
  <ws:geotools_coverage gml:id="">
    <ws:RED_BAND>2659.0</ws:RED_BAND>
    ...

- On your first point, I may be a little confused.  The feature ID is a
string.  I'm not certain what a record ID is.
- For your second point/idea, that is entirely possible.  I could stuff the
entire feature(s) into the properties map if that were desirable.  My goal
is only to obtain the fid; I'm open to including anything extra, so long as
I can get to the fid.
- I don't honestly know what I'm talking about here, other than trying to
answer the question of what to do if the pixel values are calculated from
more than one granule.  Totally open to suggestions and can write this any
way that makes sense.

On Thu, Jul 18, 2019 at 12:58 AM Jody Garnett <[email protected]>
wrote:

> 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