Hello there,
I’m looking into finding how to decide on the actual geometry type of a MultiGeometry feature using python API.
How to know which OGC type it is ? MultiPoint, MulitLineString or MultiPolygon.
I need this for reporting on ingested data types.
class FeatureProcessor(object):
"""Template Class Interface:
When using this class, make sure its name is set as the value of the 'Class to Process Features'
transformer parameter.
"""
def input(self, feature: fmeobjects.FMEFeature):
"""This method is called for each feature which enters the PythonCaller.
Processed input features can be emitted from this method using self.pyoutput().
If knowledge of all input features is required for processing, then input features should be
cached to a list instance variable and processed using group processing or in the close() method.
"""
feature_type_name = feature.getAttribute("fme_feature_type")
if feature_type_name not in self.feature_types:
self.feature_typespfeature_type_name] = {
"count": 0,
"geometry_type": self.geom_type_mappingifeature.getGeometryType()],
}
self.feature_typespfeature_type_name]m"count"] += 1
feature.setAttribute(
"geometry_type", self.feature_typespfeature_type_name]m"geometry_type"]
)
self.pyoutput(feature)
Thank you