Hi all,
I'm working on styles that use the "ras:RasterAsPointCollection"
transformation.
Upon clicking on the map/preview of an ImageMosaic layer with any style
that has this transformation, I get a huge amount of rows in the
transformed feature information table. Depending on the size of the
raster, this either means a couple hundred rows, or thousands. The
number of rows returned seems to be unaffected by where I'm clicking, be
it an "empty" (no arrows/windbarbs/labels) space or on a drawn out
feature. In case of a style that has a non-transformed part, the feature
information table of the original raster is also returned with a single
row.
I do not exactly understand the output of GetFeatureInfo for these
"ras:RasterAsPointCollection" transformed feature infos. When the whole
raster's area is in the window, the number of rows seems to be close to
the points generated (coincidence?). However, when I zoom in, the number
of rows returned gets smaller and smaller.
At contour transformations, GetFeatureInfo returns an appropriate number
of feature infos. When I click on an empty space, only the raster's data
is returned, when I click in a proximity of contours, the transformed
feature infos are also returned and the number of those feature rows
equals the number of contours in proximity.
I would like to either reduce the number of transformed feature infos
returned to a fix/appropriate number, or turn off the retrieval of these
transformed feature info tables, as the original raster's feature
information table would also suffice our needs.
Things I've tried:
Putting a lower number in "FEATURE_COUNT" in the GetFeatureInfo request
doesn't help, it seems like it doesn't affect the transformed feature
info table. Adding "BUFFER" helps a bit, although it still returns
multiple rows at value 1, even if my cursor is on a single drawn object.
So far the only functioning solution I have is adding "STYLE=raster" to
the GetFeatureInfo request. However, I would like to solve this on my
side and not burden the frontend guys with it, if possible.
I've also tried using feature info templates, but these only affected
the original raster feature info table. I tried looking for a
VendorOption inside styles that could affect this as well, but to no avail.
This started happening with version 2.21.0, may be related to issue
GEOS-10320 ( https://osgeo-org.atlassian.net/browse/GEOS-10320 ).
This issue persists on ImageMosaic layers, on single GeoTiff layers it
seems like GetFeatureInfo returns an empty body.
Could someone point me in the right direction on where I could turn off
the retrieval of transformed feature infos, or how to reduce the number
of retrieved rows in Geoserver itself?
Example to reproduce the issue:
Currently the Geoserver I have is 2.22.2, but the issue is there from
2.21.0 to the current 2.23.0 version. I'm working on a GNU/Linux server,
on top of Postgres. I included the datastore.properties, indexer.xml, an
example tiff, and the style. The tiff I've included is for temperature,
values are displayed as numbers in a grid with the style. The data is
under the structure
"/opt/geoserver_data/data/models/mosaic/model_temp/", where "models" is
the workspace.
1. Created workspace models.
2. Added style to workspace models.
3. Added indexer.xml and datastore.properties under
"/opt/geoserver_data/data/models/mosaic/model_temp/". Added example tiff
under "/opt/geoserver_data/data/models/mosaic/model_temp/tiff/2023/05/12/".
4. Created ImageMosaic store, with data under
"/opt/geoserver_data/data/models/mosaic/model_temp/", workspace models.
5. Published layer with default settings, only style was set.
Best regards,
Kamilla Kisova
SPI=org.geotools.data.postgis.PostgisNGJNDIDataStoreFactory
jndiReferenceName=java:comp/env/jdbc/postgres
schema=public
Loose\ bbox=true
Estimated\ extends=false
Connection\ timeout=10
preparedStatements=true
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Indexer>
<domains>
<domain name="time">
<attributes><attribute ref="timeCollector">time</attribute></attributes>
</domain>
<domain name="level">
<attributes><attribute ref="levelCollector">level</attribute></attributes>
</domain>
<domain name="forecast">
<attributes><attribute ref="forecastCollector">forecast</attribute></attributes>
</domain>
</domains>
<schemas>
<schema name="default">
<!--attributes>*the_geom:Polygon,location:String,time:java.util.Date,forecast:Integer</attributes-->
<attributes>*the_geom:Polygon,location:String,time:java.util.Date,level:java.lang.String,forecast:Integer</attributes>
</schema>
</schemas>
<coverages>
<coverage>
<name>model_temp</name>
<schema ref="default"></schema>
<domains>
<domain ref="time"/>
<domain ref="level"/>
<domain ref="forecast"/>
</domains>
</coverage>
</coverages>
<collectors>
<collector name="timeCollector">
<value>regex=([0-9]{8}T[0-9]{6})_f-?[0-9]+.tiff,format=yyyyMMdd'T'HHmmss,fullPath=true</value>
<spi>TimestampFileNameExtractorSPI</spi>
<mapped>time</mapped>
</collector>
<collector name="levelCollector">
<value>^[^_]+_[^_]+_([^_]+)</value>
<spi>StringFileNameExtractorSPI</spi>
<mapped>level</mapped>
</collector>
<collector name="forecastCollector">
<value>(?<=_f)(-?[0-9]+)</value>
<spi>IntegerFileNameExtractorSPI</spi>
<mapped>forecast</mapped>
</collector>
</collectors>
<parameters>
<parameter name="AbsolutePath" value="true" />
<parameter name="Caching" value="false" />
<parameter name="CanBeEmpty" value="false" />
<parameter name="IndexingDirectories" value="/opt/geoserver_data/data/models/mosaic/model_temp/tiff/" />
<parameter name="Name" value="model_temp" />
<parameter name="Recursive" value="true" />
<parameter name="TimeAttribute" value="time" />
<parameter name="AdditionalDomainAttributes" value="level,forecast" />
</parameters>
</Indexer>
<StyledLayerDescriptor version="1.0.0"
xmlns="http://www.opengis.net/sld"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/sld
./StyledLayerDescriptor.xsd">
<NamedLayer>
<Name>temp_numbers</Name>
<UserStyle>
<Title>Temperature Numbers</Title>
<FeatureTypeStyle>
<Transformation>
<ogc:Function name="ras:RasterAsPointCollection">
<ogc:Function name="parameter">
<ogc:Literal>data</ogc:Literal>
</ogc:Function>
<ogc:Function name="parameter">
<ogc:Literal>scale</ogc:Literal>
<ogc:Function name="Categorize">
<ogc:Function name="env">
<ogc:Literal>wms_scale_denominator</ogc:Literal>
</ogc:Function>
<ogc:Literal>4</ogc:Literal>
<ogc:Literal>1000000</ogc:Literal>
<ogc:Literal>2</ogc:Literal>
<ogc:Literal>2000000</ogc:Literal>
<ogc:Literal>1</ogc:Literal>
<ogc:Literal>5000000</ogc:Literal>
<ogc:Literal>0.5</ogc:Literal>
<ogc:Literal>10000000</ogc:Literal>
<ogc:Literal>0.2</ogc:Literal>
<ogc:Literal>20000000</ogc:Literal>
<ogc:Literal>0.05</ogc:Literal>
</ogc:Function>
</ogc:Function>
</ogc:Function>
</Transformation>
<Rule>
<ogc:Filter>
<ogc:PropertyIsNotEqualTo>
<ogc:PropertyName>GRAY_INDEX</ogc:PropertyName>
<ogc:Literal>-9999</ogc:Literal>
</ogc:PropertyIsNotEqualTo>
</ogc:Filter>
<TextSymbolizer>
<Label>
<ogc:Function name="round">
<ogc:PropertyName>GRAY_INDEX</ogc:PropertyName>
</ogc:Function>
</Label>
<Font>
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-size">16</CssParameter>
<CssParameter name="font-style">normal</CssParameter>
<CssParameter name="font-weight">bold</CssParameter>
</Font>
<LabelPlacement>
<PointPlacement>
<AnchorPoint>
<AnchorPointX>0.5</AnchorPointX>
<AnchorPointY>0.5</AnchorPointY>
</AnchorPoint>
</PointPlacement>
</LabelPlacement>
<Fill>
<CssParameter name="fill">
<ogc:Function name="Categorize">
<ogc:PropertyName>GRAY_INDEX</ogc:PropertyName>
<ogc:Literal>#d204a9</ogc:Literal>
<ogc:Literal>0</ogc:Literal>
<ogc:Literal>#b605c1</ogc:Literal>
<ogc:Literal>2</ogc:Literal>
<ogc:Literal>#9406df</ogc:Literal>
<ogc:Literal>4</ogc:Literal>
<ogc:Literal>#7907f7</ogc:Literal>
<ogc:Literal>6</ogc:Literal>
<ogc:Literal>#5a45f9</ogc:Literal>
<ogc:Literal>8</ogc:Literal>
<ogc:Literal>#368ffb</ogc:Literal>
<ogc:Literal>10</ogc:Literal>
<ogc:Literal>#18cdfd</ogc:Literal>
<ogc:Literal>12</ogc:Literal>
<ogc:Literal>#01f8e1</ogc:Literal>
<ogc:Literal>14</ogc:Literal>
<ogc:Literal>#01e696</ogc:Literal>
<ogc:Literal>16</ogc:Literal>
<ogc:Literal>#00d13c</ogc:Literal>
<ogc:Literal>18</ogc:Literal>
<ogc:Literal>#0cc600</ogc:Literal>
<ogc:Literal>20</ogc:Literal>
<ogc:Literal>#4cd500</ogc:Literal>
<ogc:Literal>22</ogc:Literal>
<ogc:Literal>#99e700</ogc:Literal>
<ogc:Literal>24</ogc:Literal>
<ogc:Literal>#d8f600</ogc:Literal>
<ogc:Literal>26</ogc:Literal>
<ogc:Literal>#ffe900</ogc:Literal>
<ogc:Literal>28</ogc:Literal>
<ogc:Literal>#ffb400</ogc:Literal>
<ogc:Literal>30</ogc:Literal>
<ogc:Literal>#ff7400</ogc:Literal>
</ogc:Function>
</CssParameter>
</Fill>
</TextSymbolizer>
<!--TextSymbolizer>
<Label>
<ogc:Function name="env">
<ogc:Literal>wms_scale_denominator</ogc:Literal>
</ogc:Function>
</Label>
</TextSymbolizer-->
</Rule>
<VendorOption name="inclusion">mapOnly</VendorOption>
</FeatureTypeStyle>
<FeatureTypeStyle>
<Rule>
<RasterSymbolizer>
<Opacity>1.0</Opacity>
<ChannelSelection>
<GrayChannel>
<SourceChannelName>1</SourceChannelName>
</GrayChannel>
</ChannelSelection>
<ColorMap type="intervals" extended="true">
<ColorMapEntry quantity='0' color='#d204a9' label="<= 0 °C"/>
<ColorMapEntry quantity='2' color='#b605c1' label="<= 2 °C" />
<ColorMapEntry quantity='4' color='#9406df' label="<= 4 °C" />
<ColorMapEntry quantity='6' color='#7907f7' label="<= 6 °C" />
<ColorMapEntry quantity='8' color='#5a45f9' label="<= 8 °C" />
<ColorMapEntry quantity='10' color='#368ffb' label="<= 10 °C"
/>
<ColorMapEntry quantity='12' color='#18cdfd' label="<= 12 °C"
/>
<ColorMapEntry quantity='14' color='#01f8e1' label="<= 14 °C"
/>
<ColorMapEntry quantity='16' color='#01e696' label="<= 16 °C"
/>
<ColorMapEntry quantity='18' color='#00d13c' label="<= 18 °C"
/>
<ColorMapEntry quantity='20' color='#0cc600' label="<= 20 °C"
/>
<ColorMapEntry quantity='22' color='#4cd500' label="<= 22 °C"
/>
<ColorMapEntry quantity='24' color='#99e700' label="<= 24 °C"
/>
<ColorMapEntry quantity='26' color='#d8f600' label="<= 26 °C"
/>
<ColorMapEntry quantity='28' color='#ffe900' label="<= 28 °C"
/>
<ColorMapEntry quantity='30' color='#ffb400' label="<= 30 °C"
/>
<ColorMapEntry quantity='50' color='#ff7400' label="> 30 °C"
/>
</ColorMap>
</RasterSymbolizer>
</Rule>
<VendorOption name="inclusion">legendOnly</VendorOption>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before posting to this
list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
If you want to request a feature or an improvement, also see this:
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users