-
Notifications
You must be signed in to change notification settings - Fork 11
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
Expand capability of geojson class #694
Open
vtnate
wants to merge
12
commits into
develop
Choose a base branch
from
more-geojson-parsing
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0ea64f7
put uo-des geojson methods into main gmt geojson class
vtnate 3577b8b
break out urbanopt_load class to its own file
vtnate 9c53799
add types and returns for mypy
vtnate 6bd7ca6
remove what mypy said was unnecessary type hinting
vtnate 1a87d98
add error catching in geojson class
vtnate 48d807e
WIP tests for methods moved into geojson class from uo-des repo
vtnate 2ca7211
Merge branch 'develop' into more-geojson-parsing
vtnate cf92d5b
add logging, errors, and a docstring comment to geojson class
vtnate 14819f8
finish adding tests for geojson class
vtnate 5454481
add empty files to force testfolder creation on windows
vtnate d977556
test getting site lat/lon from geojson
vtnate 17de6f9
improve docstring for geojson lat-lon method
vtnate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class GeoJsonValidationError(Exception): | ||
pass | ||
|
||
|
||
class UrbanOptLoad: | ||
vtnate marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"""An UrbanOptLoad is a container for holding Building-related data in a dictionary. This object | ||
does not do much work on the GeoJSON definition of the data at the moment, rather it creates | ||
an isolation layer between the GeoJSON data and the GMT. | ||
""" | ||
|
||
def __init__(self, feature): | ||
self.feature = feature | ||
self.id = feature.get("properties", {}).get("id", None) | ||
|
||
# do some validation | ||
if self.id is None: | ||
raise GeoJsonValidationError("GeoJSON feature requires an ID property but value was null") | ||
|
||
def __str__(self): | ||
return f"ID: {self.id}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'm now importing this class back into urbanopt_geojson, not inheriting. Is that the right pattern we should use?