span8
span4
您还可以在python调用程序中使用python工厂,并且能够使用VertexCreatorFactory。
请参考答案这个问题看看怎么做。
你的工厂字符串将看起来像这样:
FACTORY_DEF * VertexCreatorFactory \ FACTORY_NAME VertexCreator \输入特性_type Input_Port \ MODE REPLACE_AT_INDEX \ INDEX\ CONTINUE_ON_ERROR YES \ XVAL " “\yval” “\zval” “\output output feature_type vertexator_output输出
必须动态替换
问候,
拉里
嗨@jdh除了python调用者脚本,我没有其他想法。
import fme import fmeobjects class FeatureProcessor(object): def _init__(self): self。points = [] self。polygons = [] def input(self, feature): geomType = feature.getGeometryType() if geomType == fmeobjects.FME_GEOM_POINT: self.points.append(feature) elif geomType == fmeobjects.FME_GEOM_POLYGON: self.polygons.append(feature) def close(self): points = set([p.getCoordinate(0) for p in self.points]) for polygon in self.polygons: vertices = polygon.getAllCoordinates() vertices = [p for p in vertices if p not in points] if vertices[0] != vertices[-1]: vertices.append(vertices[0]) boundary = fmeobjects.FMELine(vertices) polygon.setGeometry(fmeobjects.FMEPolygon(boundary)) self.pyoutput(polygon)
©2019安全亚搏在线软件公司法律