Skip to content

Commit

Permalink
Error importing existing profiles when using mask/AOI clip #472
Browse files Browse the repository at this point in the history
  • Loading branch information
KellyMWhitehead committed Sep 17, 2024
1 parent 0b1127c commit 306c7dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gp/feature_class_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ def import_existing(source_path: str, dest_path: str, dest_layer_name: str, outp
geom.Transform(transform)
if clip_geom is not None:
geom = clip_geom.Intersection(geom)
if geom.IsEmpty() or geom.GetArea() == 0.0:
if geom.IsEmpty() or geom is None:
continue
if geom.GetGeometryType() in [ogr.wkbPolygon, ogr.wkbMultiPolygon] and geom.GetArea() == 0.0:
continue
if geom.GetGeometryType() in [ogr.wkbLineString, ogr.wkbMultiLineString] and geom.Length() == 0.0:
continue

dst_feature = ogr.Feature(dst_layer_def)
Expand Down

0 comments on commit 306c7dc

Please sign in to comment.