Commit 7c29f143 authored by Cresson Remi's avatar Cresson Remi
Browse files

REFAC: big refactoring

1 merge request!27Index search vector
Pipeline #34953 failed with stages
in 2 minutes and 26 seconds
Showing with 7 additions and 6 deletions
+7 -6
...@@ -88,7 +88,7 @@ class Index: ...@@ -88,7 +88,7 @@ class Index:
if poly_overlap(poly_layer_wgs84, bbox_wgs84_geom) > 0: if poly_overlap(poly_layer_wgs84, bbox_wgs84_geom) > 0:
filtered_indices.append(i) filtered_indices.append(i)
return filtered_indices return filtered_indices
return results_indices return list(results_indices)
def find(self, vector_or_bbox, date_min=None, date_max=None): def find(self, vector_or_bbox, date_min=None, date_max=None):
""" """
......
...@@ -124,6 +124,7 @@ class BoundingBox: ...@@ -124,6 +124,7 @@ class BoundingBox:
""" """
The bounding box class The bounding box class
""" """
def __init__(self, xmin, xmax, ymin, ymax): def __init__(self, xmin, xmax, ymin, ymax):
""" """
Args: Args:
...@@ -163,8 +164,8 @@ class BoundingBox: ...@@ -163,8 +164,8 @@ class BoundingBox:
Returns: an OGR Geometry from the bounding box Returns: an OGR Geometry from the bounding box
""" """
coords = (self.xmin, self.ymin), \ coords = [[self.xmin, self.ymin],
(self.xmax, self.ymin), \ [self.xmax, self.ymin],
(self.xmax, self.ymax), \ [self.xmax, self.ymax],
(self.xmin, self.ymax) [self.xmin, self.ymax]]
return coords2poly(coords) return coords2poly(coords)
...@@ -88,4 +88,4 @@ def reproject_ogr_layer(layer, epsg=4326): ...@@ -88,4 +88,4 @@ def reproject_ogr_layer(layer, epsg=4326):
# apply transformation # apply transformation
poly = poly_union(layer) poly = poly_union(layer)
poly.Transform(transform) poly.Transform(transform)
return ogr.CreateGeometryFromWkb(poly.ExportToWkb()) return poly
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment