Skip to content

Commit

Permalink
fix a function error gdal geometry type
Browse files Browse the repository at this point in the history
  • Loading branch information
changliao1025 committed Jul 29, 2023
1 parent 488f882 commit 62295b5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pyflowline/external/pyearth/gis/gdal/gdal_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,14 @@ def read_mesh_boundary(sFilename_boundary_in):


def get_geometry_coords(geometry):
if geometry.GetGeometryType() == ogr.wkbPolygon:
return get_polygon_exterior_coords(geometry)
elif geometry.GetGeometryType() == ogr.wkbLineString:
return get_linestring_coords(geometry)
elif geometry.GetGeometryType() == ogr.wkbPoint:

sGeometry_type = geometry.GetGeometryName()
if sGeometry_type =='POINT':
return get_point_coords(geometry)
elif sGeometry_type == 'LINESTRING':
return get_linestring_coords(geometry)
elif sGeometry_type =='POLYGON':
return get_polygon_exterior_coords(geometry)
else:
raise ValueError("Unsupported geometry type.")

Expand Down

0 comments on commit 62295b5

Please sign in to comment.