Skip to content

Commit

Permalink
Fix annotation type check
Browse files Browse the repository at this point in the history
  • Loading branch information
erikogabrielsson committed Feb 21, 2024
1 parent e764c36 commit 139a887
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,10 +678,10 @@ def asap_to_geometries(cls, dictionary: Dict[str, Any]) -> List[Geometry]:
def annotation_to_sectra(
annotation: Annotation,
) -> Tuple[str, List[Dict[str, float]]]:
if isinstance(annotation.geometry, Polyline):
geometry_type = "Polyline"
elif isinstance(annotation.geometry, Polygon):
if isinstance(annotation.geometry, Polygon):
geometry_type = "Area"
elif isinstance(annotation.geometry, Polyline):
geometry_type = "Polyline"
else:
raise NotImplementedError()
group_coordinates = [
Expand All @@ -703,8 +703,8 @@ def sectra_to_geometry(dictionary: Dict[str, Any]) -> Geometry:
def annotation_to_shapely(annotation: Annotation):
if isinstance(annotation.geometry, Point):
return ShapelyPoint(annotation.geometry.to_coords())
elif isinstance(annotation.geometry, Polyline):
return ShapelyLineString(annotation.geometry.to_coords())
elif isinstance(annotation.geometry, Polygon):
if isinstance(annotation.geometry, Polygon):
return ShapelyPolygon(annotation.geometry.to_coords())
if isinstance(annotation.geometry, Polyline):
return ShapelyLineString(annotation.geometry.to_coords())
raise NotImplementedError(annotation)

0 comments on commit 139a887

Please sign in to comment.