Permalink
Browse files

ensure empty layers don't cause an error on indexing

  • Loading branch information...
1 parent c3f2d11 commit a8a4caa3e1631649ad883bbd0cbdd5c7d1705623 @ischneider ischneider committed May 16, 2012
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/GeoNodePy/geonode/simplesearch/models.py
@@ -85,8 +85,15 @@ def index_layer(index, obj):
return
min_x, min_y, max_x, max_y = wms_metadata.boundingBoxWGS84
- index.extent = Envelope(min_x,min_y,max_x,max_y).wkt;
- index.save()
+
+ if wms_metadata.boundingBoxWGS84 != (0.0,0.0,-1.0,-1.0):
+ try:
+ index.extent = Envelope(min_x,min_y,max_x,max_y).wkt;
+ except Exception,ex:
+ _logger.warn('Error computing envelope: %s, bounding box was %s', str(ex),wms_metadata.boundingBoxWGS84)
+ index.save()
+ else:
+ _logger.warn('Bounding box empty, not indexing')
def index_map(index, obj):
time_start = None

0 comments on commit a8a4caa

Please sign in to comment.