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

estimate-area command #104

Merged
merged 21 commits into from
Oct 19, 2020
Merged

estimate-area command #104

merged 21 commits into from
Oct 19, 2020

Conversation

allisonzheng
Copy link
Contributor

@allisonzheng allisonzheng commented Oct 12, 2020

The estimate-area command inputs features and a precision and outputs the total area in square kilometers.

@allisonzheng
Copy link
Contributor Author

allisonzheng commented Oct 12, 2020

The build failures for most commits were before a merge with master which upgraded the Click version and fixed AssertionError quote issues from the existing code.

Copy link

@ericcarlschwartz ericcarlschwartz left a comment

Choose a reason for hiding this comment

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

hey @allisonzheng, looks great! just had a couple questions to help myself understand what's going on here and a couple small suggestions

mapbox_tilesets/scripts/cli.py Outdated Show resolved Hide resolved
mapbox_tilesets/scripts/cli.py Show resolved Hide resolved
mapbox_tilesets/scripts/cli.py Outdated Show resolved Hide resolved
mapbox_tilesets/utils.py Outdated Show resolved Hide resolved
tests/test_cli_estimate_area.py Show resolved Hide resolved
tests/test_cli_estimate_area.py Show resolved Hide resolved
Copy link
Contributor

@dnomadb dnomadb left a comment

Choose a reason for hiding this comment

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

@allisonzheng looks good! I added a few suggestions for changes. My biggest comment is that we should focus on unit testing the methods you've written instead of CLI tests -- they are harder to write and more prone to weirdness with things like string escaping. Some CLI tests should exist for usage, but the coverage of logical edge cases should be in module tests.

mapbox_tilesets/utils.py Outdated Show resolved Hide resolved
mapbox_tilesets/utils.py Outdated Show resolved Hide resolved
mapbox_tilesets/scripts/cli.py Outdated Show resolved Hide resolved
mapbox_tilesets/utils.py Outdated Show resolved Hide resolved
tests/fixtures/precisionTesting.ldgeojson Outdated Show resolved Hide resolved
tests/test_utils.py Show resolved Hide resolved
Copy link

@ericcarlschwartz ericcarlschwartz left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my comments/questions!

Copy link
Contributor

@dnomadb dnomadb left a comment

Choose a reason for hiding this comment

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

Looks good! Just left one small documentation suggestion.

🙇 @allisonzheng !

@allisonzheng
Copy link
Contributor Author

allisonzheng commented Oct 15, 2020

Additional Testing
Using Mode the 99th percentile for upload sizes is ~245MB in the last year

I uploaded a ~440MB geonjson file converted from US census data and verified that the CLI processed it and calculated the area correctly
Screen Shot 2020-10-15 at 4 29 41 PM

Mapbox Studio
Screen Shot 2020-10-15 at 2 59 34 PM
Tilesets CLI
Screen Shot 2020-10-15 at 2 59 55 PM

@allisonzheng allisonzheng merged commit 1aff431 into master Oct 19, 2020
@allisonzheng allisonzheng deleted the estimate-area branch October 19, 2020 17:37
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.

3 participants