ad debug info
This commit is contained in:
parent
be9ffbbb62
commit
d79a9ed36e
1 changed files with 6 additions and 1 deletions
|
@ -155,7 +155,9 @@ class GeometryIndexed:
|
||||||
if isinstance(key, BaseGeometry):
|
if isinstance(key, BaseGeometry):
|
||||||
bounds = self._get_geometry_bounds(key)
|
bounds = self._get_geometry_bounds(key)
|
||||||
self.fit_bounds(*bounds)
|
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
|
return
|
||||||
|
|
||||||
raise TypeError('GeometryIndexed index must be a shapely geometry, not %s' % type(key).__name__)
|
raise TypeError('GeometryIndexed index must be a shapely geometry, not %s' % type(key).__name__)
|
||||||
|
@ -249,8 +251,11 @@ class MapHistory(GeometryIndexed):
|
||||||
def simplify(self):
|
def simplify(self):
|
||||||
# remove updates that have no longer any array cells
|
# remove updates that have no longer any array cells
|
||||||
new_updates = ((i, update, (self.data == i)) for i, update in enumerate(self.updates))
|
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
|
self.updates, new_affected = zip(*((update, affected) for i, update, affected in new_updates
|
||||||
if i == 0 or affected.any()))
|
if i == 0 or affected.any()))
|
||||||
|
logger.info('after simplify: %s' % self.updates)
|
||||||
for i, affected in enumerate(new_affected):
|
for i, affected in enumerate(new_affected):
|
||||||
self.data[affected] = i
|
self.data[affected] = i
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue