Skip to content

Commit

Permalink
fix(model): Ensure that Model geoJSON id is a string
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey authored and Chris Mackey committed Mar 10, 2020
1 parent db780f2 commit 5fa8adc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dragonfly/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def to_geojson(self, location, point=Point2D(0, 0), folder=None, tolerance=0.01)
feature_dict['properties']['floor_area'] = bldg.floor_area
feature_dict['properties']['footprint_area'] = \
sum((face.area for face in footprint))
feature_dict['properties']['id'] = i
feature_dict['properties']['id'] = str(i + 1)
feature_dict['properties']['name'] = bldg.name
feature_dict['properties']['number_of_stories'] = bldg.story_count
feature_dict['properties']['type'] = 'Building'
Expand Down
6 changes: 3 additions & 3 deletions tests/geojson/NewDevelopment.geojson
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"building_type": "Mixed use",
"floor_area": 600.0,
"footprint_area": 200.0,
"id": 0,
"id": "1",
"name": "ResidenceBuilding",
"number_of_stories": 3,
"type": "Building",
Expand Down Expand Up @@ -81,7 +81,7 @@
"building_type": "Mixed use",
"floor_area": 200.0,
"footprint_area": 200.0,
"id": 1,
"id": "2",
"name": "RetailBuildingBig",
"number_of_stories": 1,
"type": "Building",
Expand Down Expand Up @@ -185,7 +185,7 @@
"building_type": "Mixed use",
"floor_area": 1625.0,
"footprint_area": 325.0,
"id": 2,
"id": "3",
"name": "OfficeBuilding",
"number_of_stories": 5,
"type": "Building",
Expand Down

0 comments on commit 5fa8adc

Please sign in to comment.