urbanopt-geojson 0.2.0.pre1 → 0.2.0.pre2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/RDOC_MAIN.md +13 -7
- data/README.md +3 -3
- data/lib/measures/urban_geometry_creation/tests/urban_geometry_creation_test.rb +1 -1
- data/lib/urbanopt/geojson/building.rb +13 -11
- data/lib/urbanopt/geojson/{extension.rb → derived_extension.rb} +0 -0
- data/lib/urbanopt/geojson/helper.rb +3 -3
- data/lib/urbanopt/geojson/version.rb +1 -1
- data/lib/urbanopt/geojson.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ad031bd7b8b2d22974781fa200d6fc6c233c7cf
|
4
|
+
data.tar.gz: a6bab4394e0bf97c15e86bdc054c37420648c184
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d07f450de4bc75b28452c6d18e5ab4207139fab076a3298ec10b36e13d5eab6ac4dbc002a78dc59adb0dca4770ed4d402deaf3247905df8ae926dc7fc64444d2
|
7
|
+
data.tar.gz: 82905227028b1112170d0fe8f9d411af2ba5d275690178ce1d67178952752b13ede774242e115d39cf54260da7f6532e3a4cd23ab61e9b7ff447b9e351240272
|
data/RDOC_MAIN.md
CHANGED
@@ -7,13 +7,19 @@ The URBANopt GeoJSON Gem has been developed by restructuring methods extracted f
|
|
7
7
|
and
|
8
8
|
[urban_geometry_creation_zoning.](https://github.com/NREL/openstudio-urban-measures/tree/develop/measures/urban_geometry_creation_zoning)
|
9
9
|
|
10
|
-
The +urban_geometry_creation+ measure can be used to create an OpenStudio Model for
|
11
|
-
building feature and create the surrounding buildings
|
12
|
-
|
13
|
-
The
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
The +urban_geometry_creation+ measure can be used to create an OpenStudio Model for a
|
11
|
+
building feature from the feature file and create the surrounding buildings that are shading the
|
12
|
+
building feature as shading objects.
|
13
|
+
The arguments used in the measure are the +GeoJSON File+, +Feature ID+ of the building and +Surrounding Buildings+. The
|
14
|
+
Surrounding Buildings argument takes two possible choices - None or Shading Only. The None choice
|
15
|
+
would create no other buildings adjacent to the building feature while the Shading Only option
|
16
|
+
determines what other buildings are shading the building feature and creates them as OpenStudio Shading Surfaces.
|
17
|
+
|
18
|
+
The +urban_geometry_creation_zoning+ measure has the same capabilities as the
|
19
|
+
+urban_geometry_creation+ measure, however it also creates core and perimeter zones for the spaces
|
20
|
+
in the OpenStudio Model. It takes in the same arguments as the +urban_geometry_creation+ measure.
|
21
|
+
|
22
|
+
The main components of the gem are:
|
17
23
|
|
18
24
|
- geojson.rb : Base gem file that imports all modules and classes.
|
19
25
|
- extension.rb : The extension class inherits from OpenStudio::Extension::Extension, and
|
data/README.md
CHANGED
@@ -26,9 +26,9 @@ for describing geospatial data related to the built environment.
|
|
26
26
|
|
27
27
|
The current functionalities of the URBANopt GeoJSON gem include:
|
28
28
|
|
29
|
-
* Validate a GeoJSON file
|
30
|
-
*
|
31
|
-
|
29
|
+
* Validate a GeoJSON file against schema.
|
30
|
+
* Translate Building Feature to an OpenStudio Model and create zones within OpenStudio Spaces within
|
31
|
+
the Model.
|
32
32
|
* Translate Building Feature to OpenStudio Shading Objects.
|
33
33
|
|
34
34
|
# Releasing
|
@@ -98,7 +98,7 @@ class UrbanGeometryCreationTest < MiniTest::Unit::TestCase
|
|
98
98
|
|
99
99
|
geojson_file = File.absolute_path(File.join(File.dirname(__FILE__), 'nrel_stm_footprints.geojson'))
|
100
100
|
|
101
|
-
feature_id = '59a9ce2b42f7d007c059d2f0'
|
101
|
+
feature_id = '59a9ce2b42f7d007c059d2f0'
|
102
102
|
|
103
103
|
surrounding_buildings = 'ShadingOnly'
|
104
104
|
|
@@ -88,8 +88,7 @@ module URBANopt
|
|
88
88
|
# * +origin_lat_lon+ - _Type:Float_ - An instance of +OpenStudio::PointLatLon+ indicating the latitude and longitude of the origin.
|
89
89
|
# * +runner+ - _Type:String_ - An instance of +OpenStudio::Measure::OSRunner+ for the measure run.
|
90
90
|
# * +zoning+ - _Type:Boolean_ - Value is +true+ if utilizing detailed zoning, else
|
91
|
-
# +false+. Zoning is set to False by default.
|
92
|
-
# supported.
|
91
|
+
# +false+. Zoning is set to False by default.
|
93
92
|
# * +other_building+ - _Type:URBANopt::GeoJSON::Feature - Optional, allow the user to pass in a different building to process. This is used for creating the other buildings for shading.
|
94
93
|
def create_building(create_method, model, origin_lat_lon, runner, zoning = false, other_building = @feature_json)
|
95
94
|
number_of_stories = other_building[:properties][:number_of_stories]
|
@@ -134,7 +133,7 @@ module URBANopt
|
|
134
133
|
spaces.concat(new_spaces)
|
135
134
|
end
|
136
135
|
elsif create_method == :space_per_building
|
137
|
-
spaces = create_space_per_building(-number_of_stories_below_ground * floor_to_floor_height, number_of_stories_above_ground * floor_to_floor_height, model, origin_lat_lon, runner, zoning)
|
136
|
+
spaces = create_space_per_building(-number_of_stories_below_ground * floor_to_floor_height, number_of_stories_above_ground * floor_to_floor_height, model, origin_lat_lon, runner, zoning, other_building)
|
138
137
|
end
|
139
138
|
return spaces
|
140
139
|
end
|
@@ -294,18 +293,22 @@ module URBANopt
|
|
294
293
|
# * +origin_lat_lon+ - _Type:Float_ - An instance of +OpenStudio::PointLatLon+ indicating the latidude and longitude of the origin.
|
295
294
|
# * +runner+ - _Type:String_ - An instance of +Openstudio::Measure::OSRunner+ for the measure run.
|
296
295
|
# * +zoning+ - _Type:Boolean_ - Value is +true+ if utilizing detailed zoning, else
|
297
|
-
# +false+. Zoning is set to False by default.
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
296
|
+
# +false+. Zoning is set to False by default.
|
297
|
+
def create_space_per_building(min_elevation, max_elevation, model, origin_lat_lon, runner, zoning = false, other_building) #:doc:
|
298
|
+
if other_building
|
299
|
+
geometry = other_building[:geometry]
|
300
|
+
properties = other_building[:properties]
|
301
|
+
else
|
302
|
+
geometry = @feature_json[:geometry]
|
303
|
+
properties = @feature_json[:properties]
|
304
|
+
end
|
302
305
|
if zoning
|
303
306
|
name = properties[:id]
|
304
307
|
else
|
305
308
|
name = properties[:name]
|
306
309
|
end
|
307
310
|
floor_prints = []
|
308
|
-
multi_polygons = get_multi_polygons
|
311
|
+
multi_polygons = get_multi_polygons(other_building)
|
309
312
|
multi_polygons.each do |multi_polygon|
|
310
313
|
if multi_polygon.size > 1
|
311
314
|
runner.registerWarning('Ignoring holes in polygon')
|
@@ -349,8 +352,7 @@ module URBANopt
|
|
349
352
|
# origin's latitude and longitude.
|
350
353
|
# * +runner+ - _Type:String_ - An instance of +Openstudio::Measure::OSRunner+ for the measure run.
|
351
354
|
# * +zoning+ - _Type:Boolean_ - Value is +true+ if utilizing detailed zoning, else
|
352
|
-
# +false+. Zoning is set to False by default.
|
353
|
-
# supported.
|
355
|
+
# +false+. Zoning is set to False by default.
|
354
356
|
def create_space_per_floor(story_number, floor_to_floor_height, model, origin_lat_lon, runner, zoning = false) #:doc:
|
355
357
|
geometry = @feature_json[:geometry]
|
356
358
|
properties = @feature_json[:properties]
|
File without changes
|
@@ -222,8 +222,7 @@ module URBANopt
|
|
222
222
|
# * +origin_lat_lon+ - _Type:Float_ - An instance of +OpenStudio::PointLatLon+ indicating the latitude and longitude of the origin.
|
223
223
|
# * +runner+ - _Type:String_ - An instance of +Openstudio::Measure::OSRunner+ for the measure run.
|
224
224
|
# * +zoning+ - _Type:Boolean_ - Value is +true+ if utilizing detailed zoning, else
|
225
|
-
# +false+. Zoning is set to false by default.
|
226
|
-
# only supported.
|
225
|
+
# +false+. Zoning is set to false by default.
|
227
226
|
def self.process_other_buildings(building, other_building_type, other_buildings, model, origin_lat_lon, runner, zoning = false)
|
228
227
|
# Empty array to store the new OpenStudio model spaces that need to be converted to shading objects
|
229
228
|
feature_points = building.feature_points(origin_lat_lon, runner, zoning)
|
@@ -233,7 +232,8 @@ module URBANopt
|
|
233
232
|
other_buildings[:features].each do |other_building|
|
234
233
|
other_id = other_building[:properties][:id]
|
235
234
|
next if other_id == building.id
|
236
|
-
if
|
235
|
+
# Consider building, if other building type is ShadingOnly and other id is not equal to building id
|
236
|
+
if other_building_type == 'ShadingOnly' && other_id != building.id
|
237
237
|
# Checks if any building point is shaded by any other building point.
|
238
238
|
roof_elevation = other_building[:properties][:roof_elevation]
|
239
239
|
number_of_stories = other_building[:properties][:number_of_stories]
|
data/lib/urbanopt/geojson.rb
CHANGED
@@ -37,5 +37,5 @@ require 'urbanopt/geojson/helper'
|
|
37
37
|
require 'urbanopt/geojson/model'
|
38
38
|
require 'urbanopt/geojson/zoning'
|
39
39
|
require 'urbanopt/geojson/model'
|
40
|
-
require 'urbanopt/geojson/
|
40
|
+
require 'urbanopt/geojson/derived_extension'
|
41
41
|
require 'urbanopt/geojson/logging'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: urbanopt-geojson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0.
|
4
|
+
version: 0.2.0.pre2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tanushree Charan
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-03-
|
13
|
+
date: 2020-03-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -189,8 +189,8 @@ files:
|
|
189
189
|
- lib/urbanopt-geojson.rb
|
190
190
|
- lib/urbanopt/geojson.rb
|
191
191
|
- lib/urbanopt/geojson/building.rb
|
192
|
+
- lib/urbanopt/geojson/derived_extension.rb
|
192
193
|
- lib/urbanopt/geojson/district_system.rb
|
193
|
-
- lib/urbanopt/geojson/extension.rb
|
194
194
|
- lib/urbanopt/geojson/feature.rb
|
195
195
|
- lib/urbanopt/geojson/files/electrical_database.json
|
196
196
|
- lib/urbanopt/geojson/geo_file.rb
|