Skip to content

Commit

Permalink
fix error on no intersection
Browse files Browse the repository at this point in the history
  • Loading branch information
hambsch committed Jul 8, 2024
1 parent 4ef7747 commit 0df3d4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/guppy/endpoints/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def get_point_value_from_layer(db: Session, layer_name: str, x: float, y: float)
# get the value of the point
point = wkt.loads(f'POINT ({x} {y})')
values = tile_df[tile_df.intersects(point)].drop(columns=['geometry'])
if values.empty:
if not values.empty:
result = {'type': 'point value', 'layer_name': layer_name, 'value': values.to_dict(orient='records')[0]}
logger.info(f'get_point_value_from_raster 200 {time.time() - t}')
return result
Expand Down

0 comments on commit 0df3d4d

Please sign in to comment.