Skip to content
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

Merged
merged 5 commits into from
Nov 27, 2024

Conversation

Santonia27
Copy link
Collaborator

No description provided.

@Santonia27 Santonia27 requested a review from panosatha November 21, 2024 14:51
@@ -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())
Copy link
Collaborator

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?

Copy link
Collaborator Author

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

Copy link
Collaborator

@panosatha panosatha left a 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

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())
Copy link
Collaborator

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?

Copy link

Copy link
Collaborator

@panosatha panosatha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Santonia27 Santonia27 merged commit bf773f2 into main Nov 27, 2024
6 checks passed
@Santonia27 Santonia27 deleted the bugfixs branch November 27, 2024 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants