Graphics Reference
In-Depth Information
exterior = polygon[0]
if len(exterior) <= 4:
return
if geometry.deleteVertex(vertex):
self.layer.changeGeometry(feature.id(),
geometry)
self.onGeometryChanged()
Note that the polygon check has to allow for the fact that the first and last points on the
polygon's exterior are the same. This is why we check to see whether a polygon has at
least four coordinates rather than three.
This completes our implementation of the EditTool class for editing LineString and
Polygon geometries. To see this map tool in action along with the other geometry-editing
map tools we defined in this chapter, check out the GeometryEditor program, which is
included in the sample code of this chapter.
Search WWH ::




Custom Search