The polygon path segmenter changes the geometry into path segments, it doesn't actually create any attributes.
What are you trying to get? A line segment count, or the coordinates of each line segment?
@ebygomm I'm after the line segment count....I can see it in the attribute properties which is why I thought I must be able to get it out of there but maybe not. I've tried doing it by vertices but the number is incorrect due to having multiple vertices along one line, which is why the polygon path segmenter works better because I can set the angle. I've tried a path splitter to get the segment count after which gives me nothing...is there something else I can do to get it?
Thanks
@ebygomm I'm after the line segment count....I can see it in the attribute properties which is why I thought I must be able to get it out of there but maybe not. I've tried doing it by vertices but the number is incorrect due to having multiple vertices along one line, which is why the polygon path segmenter works better because I can set the angle. I've tried a path splitter to get the segment count after which gives me nothing...is there something else I can do to get it?
Thanks
I think the part counter after the polygon path segmenter will give you the count of paths/segments
I think the part counter after the polygon path segmenter will give you the count of paths/segments
Although after checking, this doesn't seem to count the parts correctly where the geometry is a polygon made up of path segments. You can coerce to a line first to get the parts correctly (and then back to an area again afterwards) but it may be worth asking the question of safe as to whether the partcounter should count the segments in a polygon made up of paths
I would be tempted to edit the PolygonPathSegmenter to output this number. I think it would be in the AreaBuilder, Generate a list and then ListElementCounter.
In the generic case for counting the number of segments of a polygon, I would use this python snippet.
def processFeature(feature):
geom = feature.getGeometry()
path = geom.getBoundaryAsCurve()
ct = path.numParts()
feature.setAttribute("_segments",ct)