Skip to content

Commit

Permalink
break out urbanopt_load class to its own file
Browse files Browse the repository at this point in the history
  • Loading branch information
vtnate committed Jan 14, 2025
1 parent 0ea64f7 commit 3577b8b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions geojson_modelica_translator/geojson/urbanopt_load.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class GeoJsonValidationError(Exception):
pass


class UrbanOptLoad:
"""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}"

0 comments on commit 3577b8b

Please sign in to comment.