Skip to content

Commit

Permalink
corrected issue with looking up featuretypes for raster layers
Browse files Browse the repository at this point in the history
  • Loading branch information
turingtestfail committed Jun 11, 2024
1 parent 8cb0505 commit ce16e28
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1832,15 +1832,20 @@ private List<SimpleFeatureType> getFeatureTypes() {
List<SimpleFeatureType> featureTypes = new ArrayList<>();
try {
for (MapLayerInfo mapLayerInfo : mapContent.getRequest().getLayers()) {
if (mapLayerInfo.getFeature() != null
if (mapLayerInfo.getType() == MapLayerInfo.TYPE_VECTOR
&& mapLayerInfo.getFeature() != null
&& mapLayerInfo.getFeature().getFeatureType() != null
&& mapLayerInfo.getFeature().getFeatureType()
instanceof SimpleFeatureType) {
featureTypes.add(
(SimpleFeatureType) mapLayerInfo.getFeature().getFeatureType());
} else if (mapLayerInfo.getType() == MapLayerInfo.TYPE_RASTER) {
LOGGER.fine(
"Templating not supported for raster layers: "
+ mapLayerInfo.getName());
}
}
} catch (IOException e) {
} catch (IOException | ClassCastException e) {
LOGGER.fine("Error getting feature types: " + e.getMessage());
}
return featureTypes;
Expand Down

0 comments on commit ce16e28

Please sign in to comment.