[polygons] Separating out simplify polygon into a method in RTree index
This commit is contained in:
@@ -46,11 +46,12 @@ class RTreePolygonIndex(object):
|
||||
def index_polygon(self, id, polygon):
|
||||
self.index.insert(id, polygon.bounds)
|
||||
|
||||
def add_polygon(self, poly, properties, simplify_tolerance=0.0001, preserve_topology=True):
|
||||
poly = poly.simplify(simplify_tolerance, preserve_topology=preserve_topology)
|
||||
def simplify_polygon(self, poly, simplify_tolerance=0.0001, preserve_topology=True):
|
||||
return poly.simplify(simplify_tolerance, preserve_topology=preserve_topology)
|
||||
|
||||
def add_polygon(self, poly, properties):
|
||||
if self.include_only_properties:
|
||||
properties = {k: v for k, v in properties.iteritems() if k in self.include_only_properties}
|
||||
|
||||
self.polygons.append((properties, prep(poly)))
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user