ad debug info
@@ -155,7 +155,9 @@ class GeometryIndexed:
if isinstance(key, BaseGeometry):
bounds = self._get_geometry_bounds(key)
self.fit_bounds(*bounds)
- self.data[self.get_geometry_cells(key, bounds)] = value
+ cells = self.get_geometry_cells(key, bounds)
+ print('setitem: %s' % cells)
+ self.data[cells] = value
return
raise TypeError('GeometryIndexed index must be a shapely geometry, not %s' % type(key).__name__)
@@ -249,8 +251,11 @@ class MapHistory(GeometryIndexed):
def simplify(self):
# remove updates that have no longer any array cells
new_updates = ((i, update, (self.data == i)) for i, update in enumerate(self.updates))
+ logger.info('before simplify: %s' % self.updates)
+ logger.info(str(self.data))
self.updates, new_affected = zip(*((update, affected) for i, update, affected in new_updates
if i == 0 or affected.any()))
+ logger.info('after simplify: %s' % self.updates)
for i, affected in enumerate(new_affected):
self.data[affected] = i
