Skip to content

Commit 96f0009

Browse files
authored
Merge pull request #160 from urbanopt/develop
Version 0.6.1
2 parents 81b62e6 + 1498f7a commit 96f0009

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# URBANopt GeoJSON Gem
22

3+
## Version 0.6.1
4+
5+
Date Range: 04/27/21 - 04/29/21
6+
7+
- Fixed [#155]( https://github.com/urbanopt/urbanopt-geojson-gem/issues/155 ), Adjacent buildings do not show up as shading objects
8+
- Fixed [#158]( https://github.com/urbanopt/urbanopt-geojson-gem/issues/158 ), Fix coordinates
9+
310
## Version 0.6.0
411

512
Date Range: 04/02/21 - 04/26/21

lib/urbanopt/geojson/feature.rb

+6-3
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,12 @@ def create_origin_lat_lon(runner)
261261
end
262262

263263
##
264-
# Used to determine the centroid for the feature's coordinates.
264+
# Used to determine the centroid for the feature's geojson coordinates.
265265
#
266266
# [Parameters]
267267
# * +vertices+ - The first set polygon vertices in the array of feature coordinates.
268+
# [Returns]
269+
# Returns Feature centroid coordinates [long, lat]
268270
def find_feature_center(vertices)
269271
number_of_locations = vertices.length
270272

@@ -288,8 +290,9 @@ def find_feature_center(vertices)
288290
central_square_root = Math.sqrt(x * x + y * y)
289291
central_latitude = Math.atan2(z, central_square_root)
290292

291-
[central_latitude * 180 / Math::PI,
292-
central_longitude * 180 / Math::PI]
293+
[central_longitude * 180 / Math::PI,
294+
central_latitude * 180 / Math::PI]
295+
293296
end
294297

295298
private

lib/urbanopt/geojson/helper.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,11 @@ def self.process_other_buildings(building, other_building_type, other_buildings,
308308
# find the polygon of the other_building by passing it to the get_multi_polygons method
309309
other_building_points = building.other_points(other_building, other_height, origin_lat_lon, runner, zoning)
310310
shadowed = URBANopt::GeoJSON::Helper.is_shadowed(feature_points, other_building_points, origin_lat_lon)
311+
if shadowed
312+
runner.registerInfo("Feature #{other_building[:properties][:id]} is acting as shading object for #{building.id}")
313+
end
311314
next unless shadowed
312-
new_building = building.create_other_building(:space_per_building, model, origin_lat_lon, runner, zoning, other_building)
315+
new_building = building.create_other_building(:space_per_building, model, origin_lat_lon, runner, zoning, 0, other_building)
313316
if new_building.nil? || new_building.empty?
314317
runner.registerWarning("Failed to create spaces for other building '#{name}'")
315318
end

lib/urbanopt/geojson/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@
4040

4141
module URBANopt
4242
module GeoJSON
43-
VERSION = '0.6.0'.freeze
43+
VERSION = '0.6.1'.freeze
4444
end
4545
end

0 commit comments

Comments
 (0)