-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
if-statemnent unit conversion. read_geoms generalize for file type #419
Conversation
hydromt_fiat/fiat.py
Outdated
@@ -1286,19 +1286,24 @@ def read_geoms(self): | |||
|
|||
fns = glob.glob(Path(self.root, "geoms", "*.geojson").as_posix()) | |||
if self.spatial_joins["aggregation_areas"]: | |||
fns_aggregation = glob.glob(Path(self.root, "geoms", "aggregation_areas","*.geojson").as_posix()) | |||
fns.append(fns_aggregation[0]) | |||
fns_aggregation = glob.glob(Path(self.root, "geoms", "aggregation_areas/*").as_posix()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this now work if this is a shapefile wiht multiple files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a shapefile with multiple layers or multiple files in the folder?
I tested it with 2 files in the aggregation areas and that seemed to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The shapefile seems to work fine, but I noticed something in the way that you read in the paths of the geometries that puzzled me. See commnet above
hydromt_fiat/fiat.py
Outdated
fns = glob.glob(Path(self.root, "geoms", "*.geojson").as_posix()) | ||
if self.spatial_joins["aggregation_areas"]: | ||
fns_aggregation = glob.glob(Path(self.root, "geoms", "aggregation_areas","*.geojson").as_posix()) | ||
fns.append(fns_aggregation[0]) | ||
fns_aggregation = glob.glob(Path(self.root, "geoms", "aggregation_areas/*").as_posix()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont understand why you are reading the location of the geometries from this pre-defined path, while these should be saved in the spatial_joins obejct. You could just read the paths from there right?
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.