Skip to content

Commit

Permalink
Fix panic when bounding box cannot be reprojected
Browse files Browse the repository at this point in the history
  • Loading branch information
lnicola authored and pka committed Feb 7, 2018
1 parent cddf45c commit d389fd2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion t-rex-gdal/src/gdal_ds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,13 @@ impl DatasourceInput for GdalDatasource {
// Spatial filter must be in layer SRS
let layer_srid = layer.srid.unwrap_or(grid.srid);
if layer_srid != grid.srid {
bbox_extent = transform_extent(&bbox_extent, grid.srid, layer_srid).unwrap()
match transform_extent(&bbox_extent, grid.srid, layer_srid) {
Ok(extent) => bbox_extent = extent,
Err(e) => {
error!("Unable to transform {:?}: {}", bbox_extent, e);
return;
}
}
};
let bbox = Geometry::bbox(bbox_extent.minx,
bbox_extent.miny,
Expand Down

0 comments on commit d389fd2

Please sign in to comment.