Vendor options options map for rules
- Contact: Andrea Aime
- Tracker: https://osgeo-org.atlassian.net/browse/GEOT-6870
- TLDR: Vendor options/options map for rules
The one bit of API change that actually requires a proposal can be summarized in: add an options map to Rule, just like the one already available for FeatureTypeStyle and Symbolizer
public interface Rule {
// ...
/** Determines if a vendor option with the specific key has been set on this Rule. */
boolean hasOption(String key);
/**
* Map of vendor options for the Rule.
*
* <p>Client code looking for the existence of a single option should use {@link
* #hasOption(String)}
*/
Map<String, String> getOptions();
}
The usage in SLD 1.0 and 1.1 will be similar to symbolizers and rules, e.g.:
<Rule>
<Name>Test rule</Name>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">#A66A13</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">#464646</CssParameter>
<CssParameter name="stroke-width">0.6</CssParameter>
</Stroke>
</PolygonSymbolizer>
<VendorOption name="myVendorOption">theValue</VendorOption>
</Rule>
Support will be added in both SLD 1.0 and SLD 1.1 parsers, as well as in the SLD 1.0 encoder (SLD 1.1 encoding support is missing in GeoTools, binding classes are not symmetric).
Assigned to GeoTools 26. Since it's a simple addition to the API, and alternative implementations of Rule (besides RuleImpl) are not known, we might ask for a backport.
Choose one of:
- Under Discussion
- In Progress
- Completed
- Rejected,
- Deferred
Voting:
- Andrea Aime: +1
- Ian Turton: +1
- Jody Garnett: +1
- Nuno Oliveira: +1
- Simone Giannecchini: +0
- Torben Barsballe:
This section is used to make sure your proposal is complete (did you remember documentation?) and has enough paid or volunteer time lined up to be a success. Use initials to indicate volunteer, or
- Update implementation
- Verify with test case
- Remove deprecated code
- Documentation changes
- API change make a note upgrading page.
- Update the user guide with code example
Before:
import org.geotools.filter.Filter;
public void exampleMethod( DataStore store, Filter filter){
FeatureCollection collection = store.getFeatures( filter )
...
}
After:
import org.opengis.filter.Filter;
public void exampleMethod( Source source, Filter filter){
Collection collection = source.content( filter )
...
}