Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Debugging Analyses

Details

Anchor
styleMinMax
styleMinMax

could not update ranged style: error in min/max calculation

This error occurs with the following stack trace:

Code Block
55579 - [StyleXMLUtils]:  could not update ranged style: error in min/max calculation
java.lang.IllegalStateException: Must visit before min value is ready!
	at org.geotools.feature.visitor.MinVisitor.getResult(MinVisitor.java:110)
	at org.geotools.filter.function.Collection_MinFunction.calculateMin(Collection_MinFunction.java:84)
	at ncsa.gis.util.StyleXMLUtils.updateRangedStyle(StyleXMLUtils.java:175)
	at ncsa.gis.StyleProvider.createStyle(StyleProvider.java:66)
	at ncsa.gis.datasets.factories.ShapefileDatasetFactory.initializeDataset(ShapefileDatasetFactory.java:209)

This error is most likely caused by the PropertyName in the gisStyle having not matching a field name in the dataset. This often occurs due to mismatched cases.

Example

Code Block
<ogc:Filter>
  <ogc:And>
    <ogc:PropertyIsGreaterThanOrEqualTo>
      <ogc:PropertyName>MeanDamage</ogc:PropertyName>
      <ogc:Literal>0.0</ogc:Literal>
    </ogc:PropertyIsGreaterThanOrEqualTo>
    <ogc:PropertyIsLessThan>
      <ogc:PropertyName>MeanDamage</ogc:PropertyName>
      <ogc:Literal>0.2</ogc:Literal>
    </ogc:PropertyIsLessThan>
  </ogc:And>
</ogc:Filter>

Resolution

The PropertyName of MeanDamage should be all lowercase. Find/Replace MeanDamage with meandamage.