Skip to content

Load spatial rule borders from a directory - #1827

Closed
otbutz wants to merge 4 commits into
graphhopper:masterfrom
otbutz:geojsonDir
Closed

otbutz wants to merge 4 commits into
graphhopper:masterfrom
otbutz:geojsonDir

Conversation

@otbutz

@otbutz otbutz commented Dec 16, 2019

Copy link
Copy Markdown
Contributor

I've modified the spatial rules handling in order to support loading multiple geojson files. This is the first step towards solving #1808

@karussell karussell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, this looks good to me!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is nice! I can use this für #1776 too.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note that DirectoryStream was added on Android in API level 26 (Android 8.0 Oreo). 🙂

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It is not in the core module, so this should not be a problem.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But it seems there is no simple way to get the file name without file extension and additionally one has to create a Buffer from the Path, so I think I'll keep using the newly introduced Helper.listFiles method https://github.com/graphhopper/graphhopper/pull/1841/files#diff-4e518ca1e483cdb8f16fea150c2fb150R171 (this would also make this code here a few lines shorter due to the catch stuff)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The correct handling of paths makes the Path API superior IMHO:

Path folder = Paths.get("a", "b", "c");
Path file = folder.resolve("d");

No need to worry about OS specific stuff or if there's a missing \ or /.

@karussell karussell added this to the 1.0 milestone Jan 8, 2020
@otbutz

otbutz commented Jan 29, 2020

Copy link
Copy Markdown
Contributor Author

Closing in favor of #1829

@otbutz otbutz closed this Jan 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants