urbanopt-geojson 0.2.0.pre1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +47 -0
- data/Gemfile +0 -3
- data/RDOC_MAIN.md +13 -7
- data/README.md +3 -3
- data/Rakefile +1 -1
- data/lib/measures/urban_geometry_creation/README.md +1 -1
- data/lib/measures/urban_geometry_creation/measure.rb +2 -0
- data/lib/measures/urban_geometry_creation/measure.xml +20 -18
- data/lib/measures/urban_geometry_creation_zoning/README.md +1 -1
- data/lib/measures/urban_geometry_creation_zoning/measure.rb +4 -3
- data/lib/measures/urban_geometry_creation_zoning/measure.xml +23 -21
- data/lib/urbanopt/geojson.rb +1 -1
- data/lib/urbanopt/geojson/building.rb +33 -28
- data/lib/urbanopt/geojson/{extension.rb → derived_extension.rb} +0 -0
- data/lib/urbanopt/geojson/feature.rb +6 -1
- data/lib/urbanopt/geojson/geo_file.rb +40 -39
- data/lib/urbanopt/geojson/helper.rb +5 -6
- data/lib/urbanopt/geojson/mapper_classes.rb +46 -46
- data/lib/urbanopt/geojson/model.rb +2 -3
- data/lib/urbanopt/geojson/schema/building_properties.json +241 -80
- data/lib/urbanopt/geojson/update_areas.rb +1 -1
- data/lib/urbanopt/geojson/validate_geojson.rb +2 -0
- data/lib/urbanopt/geojson/version.rb +1 -1
- data/lib/urbanopt/geojson/workflows/building.osw.out +4 -4
- data/urbanopt-geojson-gem.gemspec +9 -13
- metadata +22 -43
- data/lib/change_log.rb +0 -147
- data/lib/measures/urban_geometry_creation/tests/nrel_stm_footprints.geojson +0 -3238
- data/lib/measures/urban_geometry_creation/tests/shadowed_tests.rb +0 -80
- data/lib/measures/urban_geometry_creation/tests/urban_geometry_creation_test.rb +0 -139
- data/lib/measures/urban_geometry_creation_zoning/tests/nrel_stm_footprints.geojson +0 -3238
- data/lib/measures/urban_geometry_creation_zoning/tests/urban_geometry_creation_zoning_test.rb +0 -139
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 10b59cfe6793461aa576b46a244409a271515262b58da7b2c2927eac78714c36
|
4
|
+
data.tar.gz: e1c9e8000666ba3daea0f6e93aad3af9df87d637d268ba3c856bea7709111d21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4d16b3b4e08d93bbb3c9d070928ee29cafcb34f101fa61d6532d819d4adbf44e956e5bc02d45558b05fc1d0a8ba0fcf9c10b6bc5a0ee09b9616e540e75c5ebb
|
7
|
+
data.tar.gz: 0115c244f9bf66bf41d4a46bfafa9341b071b543cf773ee7de813316c4ebb23755468b6b1a37efc92a6a94639c07080d7b26f6133cfde5c6d8098bae21d4a531
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,52 @@
|
|
1
1
|
# URBANopt GeoJSON Gem
|
2
2
|
|
3
|
+
## Version 0.3.0
|
4
|
+
|
5
|
+
Date Range 3/25/20 - 06/04/20
|
6
|
+
|
7
|
+
Updating to use with OpenStudio 3.0 and Ruby 2.5
|
8
|
+
|
9
|
+
Accepted Pull Requests:
|
10
|
+
- Fixed [#60]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/60 ), HPXML-based workflow for residential buildings
|
11
|
+
- Fixed [#83]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/83 ), Add new system types to building properties schema
|
12
|
+
- Fixed [#84]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/84 ), Updated system types with OpenStudio
|
13
|
+
- Fixed [#87]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/87 ), Adds nominal height for stories, test for confirming nominal height
|
14
|
+
- Fixed [#90]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/90 ), Assigns construction correctly for adiabatic surfaces.
|
15
|
+
-Fixed [#95]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/95 ), Exclude measure tests from gem release to reduce size
|
16
|
+
|
17
|
+
## Version 0.2.0
|
18
|
+
|
19
|
+
Date Range: 12/26/19 - 03/25/20
|
20
|
+
|
21
|
+
|
22
|
+
Accepted Pull Requests:
|
23
|
+
- Fixed [#41]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/41 ), Added urbanopt-geojson, this closes #40
|
24
|
+
- Fixed [#45]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/45 ), Add script to ease updates to changelog
|
25
|
+
- Fixed [#46]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/46 ), Use URBANopt standard contributing guidelines
|
26
|
+
- Fixed [#49]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/49 ), adding unspecified to flow_direction enum #48
|
27
|
+
- Fixed [#50]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/50 ), update package-lock file with secure dependency versions
|
28
|
+
- Fixed [#51]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/51 ), update license date to include 2020
|
29
|
+
- Fixed [#52]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/52 ), Addresses issues in GeoJSON gem
|
30
|
+
- Fixed [#53]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/53 ), Remove unused travis CI file
|
31
|
+
- Fixed [#54]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/54 ), Remove Simplecov dependency
|
32
|
+
- Fixed [#55]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/55 ), Add github templates for issues and PRs
|
33
|
+
- Fixed [#56]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/56 ), Use new version of extension gem
|
34
|
+
- Fixed [#58]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/58 ), Require ISSUES for PRs to address. Makes auto-changelog easy
|
35
|
+
- Fixed [#62]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/62 ), modifying wire types enum and fixing json validation
|
36
|
+
error
|
37
|
+
- Fixed [#63]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/63 ), Require ruby < 2.3.0
|
38
|
+
- Fixed [#65]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/65 ), Use pessimistic versioning for dependencies
|
39
|
+
- Fixed [#66]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/66 ), Update Jenkinsfile
|
40
|
+
- Fixed [#68]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/68 ), fix create_other_building functionality and merge site props to feature props
|
41
|
+
- Fixed [#71]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/71 ), Adds methods for converting building class instance to hash.
|
42
|
+
- Fixed [#73]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/73 ), Warning message for number of stories
|
43
|
+
- Fixed [#74]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/74 ), prep for prerelease
|
44
|
+
- Fixed [#75]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/75 ), Fixes bug while creating
|
45
|
+
shading surface for adjacent buildings
|
46
|
+
- Fixed [#76]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/76 ), Changed name of extension file
|
47
|
+
- Fixed [#78]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/78 ), 0.2.0.pre2
|
48
|
+
- Fixed [#80]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/80 ), look for site features in project key instead of Site Origin feature
|
49
|
+
|
3
50
|
## Version 0.1.0
|
4
51
|
|
5
52
|
* Initial release of the URBANopt GeoJSON Gem
|
data/Gemfile
CHANGED
@@ -22,6 +22,3 @@ if allow_local && File.exist?('../urbanopt-core-gem')
|
|
22
22
|
elsif allow_local
|
23
23
|
gem 'urbanopt-core', github: 'URBANopt/urbanopt-core-gem', branch: 'develop'
|
24
24
|
end
|
25
|
-
|
26
|
-
# simplecov has an unnecessary dependency on native json gem, use fork that does not require this
|
27
|
-
gem 'simplecov', github: 'NREL/simplecov'
|
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
|
data/Rakefile
CHANGED
@@ -37,7 +37,7 @@ RSpec::Core::RakeTask.new(:spec)
|
|
37
37
|
require 'openstudio/extension/rake_task'
|
38
38
|
require 'urbanopt/geojson'
|
39
39
|
rake_task = OpenStudio::Extension::RakeTask.new
|
40
|
-
rake_task.set_extension_class(URBANopt::GeoJSON::Extension)
|
40
|
+
rake_task.set_extension_class(URBANopt::GeoJSON::Extension, 'urbanopt/urbanopt-geojson-gem')
|
41
41
|
|
42
42
|
require 'rubocop/rake_task'
|
43
43
|
RuboCop::RakeTask.new
|
@@ -8,7 +8,7 @@
|
|
8
8
|
This measure reads an URBANopt GeoJSON and creates geometry for a particular building. Surrounding buildings are included as shading structures.
|
9
9
|
|
10
10
|
## Modeler Description
|
11
|
-
|
11
|
+
This measure takes in the GeoJSON file, the feature_id of the building and the surrounding buildings as arguments and add has methods to create space types and add default construction sets.
|
12
12
|
|
13
13
|
## Measure Type
|
14
14
|
ModelMeasure
|
@@ -77,7 +77,9 @@ class UrbanGeometryCreation < OpenStudio::Measure::ModelMeasure
|
|
77
77
|
end
|
78
78
|
|
79
79
|
# define what happens when the measure is run
|
80
|
+
# rubocop:disable Metrics/AbcSize
|
80
81
|
def run(model, runner, user_arguments)
|
82
|
+
# rubocop:enable Metrics/AbcSize
|
81
83
|
super(model, runner, user_arguments)
|
82
84
|
# use the built-in error checking
|
83
85
|
if !runner.validateUserArguments(arguments(model), user_arguments)
|
@@ -2,13 +2,13 @@
|
|
2
2
|
<schema_version>3.0</schema_version>
|
3
3
|
<name>urban_geometry_creation</name>
|
4
4
|
<uid>5ab85d6b-c9af-4361-8ab9-613ee99a5666</uid>
|
5
|
-
<version_id>
|
6
|
-
<version_modified>
|
5
|
+
<version_id>cf023329-6ef3-43b3-a316-b08fabb47cd2</version_id>
|
6
|
+
<version_modified>20200327T211951Z</version_modified>
|
7
7
|
<xml_checksum>D254E772</xml_checksum>
|
8
8
|
<class_name>UrbanGeometryCreation</class_name>
|
9
9
|
<display_name>UrbanGeometryCreation</display_name>
|
10
10
|
<description>This measure reads an URBANopt GeoJSON and creates geometry for a particular building. Surrounding buildings are included as shading structures.</description>
|
11
|
-
<modeler_description
|
11
|
+
<modeler_description>This measure takes in the GeoJSON file, the feature_id of the building and the surrounding buildings as arguments and add has methods to create space types and add default construction sets.</modeler_description>
|
12
12
|
<arguments>
|
13
13
|
<argument>
|
14
14
|
<name>geojson_file</name>
|
@@ -43,10 +43,6 @@
|
|
43
43
|
<value>ShadingOnly</value>
|
44
44
|
<display_name>ShadingOnly</display_name>
|
45
45
|
</choice>
|
46
|
-
<choice>
|
47
|
-
<value>All</value>
|
48
|
-
<display_name>All</display_name>
|
49
|
-
</choice>
|
50
46
|
</choices>
|
51
47
|
</argument>
|
52
48
|
</arguments>
|
@@ -94,35 +90,29 @@
|
|
94
90
|
<usage_type>readmeerb</usage_type>
|
95
91
|
<checksum>703C9964</checksum>
|
96
92
|
</file>
|
97
|
-
<file>
|
98
|
-
<filename>README.md</filename>
|
99
|
-
<filetype>md</filetype>
|
100
|
-
<usage_type>readme</usage_type>
|
101
|
-
<checksum>D339FA87</checksum>
|
102
|
-
</file>
|
103
93
|
<file>
|
104
94
|
<filename>LICENSE.md</filename>
|
105
95
|
<filetype>md</filetype>
|
106
96
|
<usage_type>license</usage_type>
|
107
|
-
<checksum>
|
97
|
+
<checksum>EA283B74</checksum>
|
108
98
|
</file>
|
109
99
|
<file>
|
110
100
|
<filename>nrel_stm_footprints.geojson</filename>
|
111
101
|
<filetype>geojson</filetype>
|
112
102
|
<usage_type>test</usage_type>
|
113
|
-
<checksum>
|
103
|
+
<checksum>40290298</checksum>
|
114
104
|
</file>
|
115
105
|
<file>
|
116
106
|
<filename>shadowed_tests.rb</filename>
|
117
107
|
<filetype>rb</filetype>
|
118
108
|
<usage_type>test</usage_type>
|
119
|
-
<checksum>
|
109
|
+
<checksum>861137CF</checksum>
|
120
110
|
</file>
|
121
111
|
<file>
|
122
112
|
<filename>urban_geometry_creation_test.rb</filename>
|
123
113
|
<filetype>rb</filetype>
|
124
114
|
<usage_type>test</usage_type>
|
125
|
-
<checksum>
|
115
|
+
<checksum>6DED5C96</checksum>
|
126
116
|
</file>
|
127
117
|
<file>
|
128
118
|
<version>
|
@@ -133,7 +123,19 @@
|
|
133
123
|
<filename>measure.rb</filename>
|
134
124
|
<filetype>rb</filetype>
|
135
125
|
<usage_type>script</usage_type>
|
136
|
-
<checksum>
|
126
|
+
<checksum>1A6BAAFA</checksum>
|
127
|
+
</file>
|
128
|
+
<file>
|
129
|
+
<filename>out.txt</filename>
|
130
|
+
<filetype>txt</filetype>
|
131
|
+
<usage_type>test</usage_type>
|
132
|
+
<checksum>C5B18B73</checksum>
|
133
|
+
</file>
|
134
|
+
<file>
|
135
|
+
<filename>README.md</filename>
|
136
|
+
<filetype>md</filetype>
|
137
|
+
<usage_type>readme</usage_type>
|
138
|
+
<checksum>A09F345D</checksum>
|
137
139
|
</file>
|
138
140
|
</files>
|
139
141
|
</measure>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# UrbanGeometryCreationZoning
|
6
6
|
|
7
7
|
## Description
|
8
|
-
This measure reads an URBANopt GeoJSON and creates geometry for a particular building. Surrounding buildings are included as shading structures.
|
8
|
+
This measure reads an URBANopt GeoJSON and creates geometry with zoning for a particular building. Surrounding buildings are included as shading structures.
|
9
9
|
|
10
10
|
## Modeler Description
|
11
11
|
|
@@ -81,7 +81,9 @@ class UrbanGeometryCreationZoning < OpenStudio::Measure::ModelMeasure
|
|
81
81
|
end
|
82
82
|
|
83
83
|
# define what happens when the measure is run
|
84
|
+
# rubocop:disable Metrics/AbcSize
|
84
85
|
def run(model, runner, user_arguments)
|
86
|
+
# rubocop:enable Metrics/AbcSize
|
85
87
|
super(model, runner, user_arguments)
|
86
88
|
# use the built-in error checking
|
87
89
|
if !runner.validateUserArguments(arguments(model), user_arguments)
|
@@ -111,8 +113,8 @@ class UrbanGeometryCreationZoning < OpenStudio::Measure::ModelMeasure
|
|
111
113
|
@runner = runner
|
112
114
|
@origin_lat_lon = nil
|
113
115
|
|
114
|
-
all_features = URBANopt::GeoJSON::GeoFile.from_file(geojson_file)
|
115
|
-
feature = URBANopt::GeoJSON::GeoFile.from_file(geojson_file).get_feature_by_id(feature_id)
|
116
|
+
all_features = URBANopt::GeoJSON::GeoFile.from_file(geojson_file)
|
117
|
+
feature = URBANopt::GeoJSON::GeoFile.from_file(geojson_file).get_feature_by_id(feature_id)
|
116
118
|
|
117
119
|
# EXPOSE NAME
|
118
120
|
name = feature.feature_json[:properties][:name]
|
@@ -153,7 +155,6 @@ class UrbanGeometryCreationZoning < OpenStudio::Measure::ModelMeasure
|
|
153
155
|
convert_to_shades = feature.create_other_buildings(surrounding_buildings, all_features.json, model, @origin_lat_lon, @runner)
|
154
156
|
end
|
155
157
|
|
156
|
-
|
157
158
|
# intersect surfaces in this building with others
|
158
159
|
@runner.registerInfo('Intersecting surfaces')
|
159
160
|
spaces.each do |space|
|
@@ -2,12 +2,12 @@
|
|
2
2
|
<schema_version>3.0</schema_version>
|
3
3
|
<name>urban_geometry_creation_zoning</name>
|
4
4
|
<uid>96ea1317-76ac-4670-b51d-71ee3f4fdd65</uid>
|
5
|
-
<version_id>
|
6
|
-
<version_modified>
|
5
|
+
<version_id>5109b19e-6300-4068-900e-8a989b9762c8</version_id>
|
6
|
+
<version_modified>20200327T211951Z</version_modified>
|
7
7
|
<xml_checksum>D254E772</xml_checksum>
|
8
8
|
<class_name>UrbanGeometryCreationZoning</class_name>
|
9
9
|
<display_name>UrbanGeometryCreationZoning</display_name>
|
10
|
-
<description>This measure reads an URBANopt GeoJSON and creates geometry for a particular building. Surrounding buildings are included as shading structures.</description>
|
10
|
+
<description>This measure reads an URBANopt GeoJSON and creates geometry with zoning for a particular building. Surrounding buildings are included as shading structures.</description>
|
11
11
|
<modeler_description></modeler_description>
|
12
12
|
<arguments>
|
13
13
|
<argument>
|
@@ -43,10 +43,6 @@
|
|
43
43
|
<value>ShadingOnly</value>
|
44
44
|
<display_name>ShadingOnly</display_name>
|
45
45
|
</choice>
|
46
|
-
<choice>
|
47
|
-
<value>All</value>
|
48
|
-
<display_name>All</display_name>
|
49
|
-
</choice>
|
50
46
|
</choices>
|
51
47
|
</argument>
|
52
48
|
</arguments>
|
@@ -104,19 +100,7 @@
|
|
104
100
|
<filename>LICENSE.md</filename>
|
105
101
|
<filetype>md</filetype>
|
106
102
|
<usage_type>license</usage_type>
|
107
|
-
<checksum>
|
108
|
-
</file>
|
109
|
-
<file>
|
110
|
-
<filename>README.md</filename>
|
111
|
-
<filetype>md</filetype>
|
112
|
-
<usage_type>readme</usage_type>
|
113
|
-
<checksum>15702F0A</checksum>
|
114
|
-
</file>
|
115
|
-
<file>
|
116
|
-
<filename>urban_geometry_creation_test.rb</filename>
|
117
|
-
<filetype>rb</filetype>
|
118
|
-
<usage_type>test</usage_type>
|
119
|
-
<checksum>111178B3</checksum>
|
103
|
+
<checksum>EA283B74</checksum>
|
120
104
|
</file>
|
121
105
|
<file>
|
122
106
|
<version>
|
@@ -127,7 +111,25 @@
|
|
127
111
|
<filename>measure.rb</filename>
|
128
112
|
<filetype>rb</filetype>
|
129
113
|
<usage_type>script</usage_type>
|
130
|
-
<checksum>
|
114
|
+
<checksum>EF1B3E84</checksum>
|
115
|
+
</file>
|
116
|
+
<file>
|
117
|
+
<filename>out.txt</filename>
|
118
|
+
<filetype>txt</filetype>
|
119
|
+
<usage_type>test</usage_type>
|
120
|
+
<checksum>7FAF05F3</checksum>
|
121
|
+
</file>
|
122
|
+
<file>
|
123
|
+
<filename>urban_geometry_creation_zoning_test.rb</filename>
|
124
|
+
<filetype>rb</filetype>
|
125
|
+
<usage_type>test</usage_type>
|
126
|
+
<checksum>60BFE46B</checksum>
|
127
|
+
</file>
|
128
|
+
<file>
|
129
|
+
<filename>README.md</filename>
|
130
|
+
<filetype>md</filetype>
|
131
|
+
<usage_type>readme</usage_type>
|
132
|
+
<checksum>0458EE16</checksum>
|
131
133
|
</file>
|
132
134
|
</files>
|
133
135
|
</measure>
|
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'
|
@@ -33,7 +33,6 @@ require 'urbanopt/geojson/feature'
|
|
33
33
|
module URBANopt
|
34
34
|
module GeoJSON
|
35
35
|
class Building < URBANopt::GeoJSON::Feature
|
36
|
-
|
37
36
|
##
|
38
37
|
# Used to initialize the feature. This method is inherited from the Feature class.
|
39
38
|
def initialize(feature = {})
|
@@ -88,8 +87,7 @@ module URBANopt
|
|
88
87
|
# * +origin_lat_lon+ - _Type:Float_ - An instance of +OpenStudio::PointLatLon+ indicating the latitude and longitude of the origin.
|
89
88
|
# * +runner+ - _Type:String_ - An instance of +OpenStudio::Measure::OSRunner+ for the measure run.
|
90
89
|
# * +zoning+ - _Type:Boolean_ - Value is +true+ if utilizing detailed zoning, else
|
91
|
-
# +false+. Zoning is set to False by default.
|
92
|
-
# supported.
|
90
|
+
# +false+. Zoning is set to False by default.
|
93
91
|
# * +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
92
|
def create_building(create_method, model, origin_lat_lon, runner, zoning = false, other_building = @feature_json)
|
95
93
|
number_of_stories = other_building[:properties][:number_of_stories]
|
@@ -134,7 +132,7 @@ module URBANopt
|
|
134
132
|
spaces.concat(new_spaces)
|
135
133
|
end
|
136
134
|
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)
|
135
|
+
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
136
|
end
|
139
137
|
return spaces
|
140
138
|
end
|
@@ -278,14 +276,13 @@ module URBANopt
|
|
278
276
|
result[:mixed_type_3_percentage] = @mixed_type_3_percentage if @mixed_type_3_percentage
|
279
277
|
result[:mixed_type_4] = @mixed_type_4 if @mixed_type_4
|
280
278
|
result[:mixed_type_4_percentage] = @mixed_type_4_percentage if @mixed_type_4_percentage
|
281
|
-
return result
|
279
|
+
return result
|
282
280
|
end
|
283
281
|
|
284
|
-
|
285
282
|
private
|
286
283
|
|
287
284
|
##
|
288
|
-
# Returns an array of instances of +OpenStudio::Model::Space+ per building
|
285
|
+
# Returns an array of instances of +OpenStudio::Model::Space+ per building.
|
289
286
|
#
|
290
287
|
# [Parameters]
|
291
288
|
# * +min_elevation+ - _Type:Integer_ - Indicates minimum elevation across all buildings.
|
@@ -294,18 +291,24 @@ module URBANopt
|
|
294
291
|
# * +origin_lat_lon+ - _Type:Float_ - An instance of +OpenStudio::PointLatLon+ indicating the latidude and longitude of the origin.
|
295
292
|
# * +runner+ - _Type:String_ - An instance of +Openstudio::Measure::OSRunner+ for the measure run.
|
296
293
|
# * +zoning+ - _Type:Boolean_ - Value is +true+ if utilizing detailed zoning, else
|
297
|
-
# +false+. Zoning is set to False by default.
|
298
|
-
#
|
299
|
-
def create_space_per_building(min_elevation, max_elevation, model, origin_lat_lon, runner, zoning = false) #:doc:
|
300
|
-
|
301
|
-
|
294
|
+
# +false+. Zoning is set to False by default.
|
295
|
+
# rubocop:disable Style/OptionalArguments, Style/CommentedKeyword
|
296
|
+
def create_space_per_building(min_elevation, max_elevation, model, origin_lat_lon, runner, zoning = false, other_building) #:doc:
|
297
|
+
# rubocop: enable Style/OptionalArguments, Style/CommentedKeyword
|
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')
|
@@ -335,7 +338,7 @@ module URBANopt
|
|
335
338
|
result << space
|
336
339
|
end
|
337
340
|
return result
|
338
|
-
|
341
|
+
end
|
339
342
|
|
340
343
|
##
|
341
344
|
# Returns an array of instances of +OpenStudio::Model::Space+ per floor.
|
@@ -349,9 +352,10 @@ 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
|
-
#
|
355
|
+
# +false+. Zoning is set to False by default.
|
356
|
+
# rubocop:disable Style/CommentedKeyword
|
354
357
|
def create_space_per_floor(story_number, floor_to_floor_height, model, origin_lat_lon, runner, zoning = false) #:doc:
|
358
|
+
# rubocop:enable Style/CommentedKeyword
|
355
359
|
geometry = @feature_json[:geometry]
|
356
360
|
properties = @feature_json[:properties]
|
357
361
|
floor_prints = []
|
@@ -365,7 +369,7 @@ module URBANopt
|
|
365
369
|
floor_print = URBANopt::GeoJSON::Helper.floor_print_from_polygon(polygon, elevation, origin_lat_lon, runner, zoning)
|
366
370
|
if floor_print
|
367
371
|
if zoning
|
368
|
-
this_floor_prints = URBANopt::GeoJSON::Zoning.divide_floor_print(floor_print, 4.0, runner)
|
372
|
+
this_floor_prints = URBANopt::GeoJSON::Zoning.divide_floor_print(floor_print, 4.0, runner)
|
369
373
|
floor_prints.concat(this_floor_prints)
|
370
374
|
else
|
371
375
|
floor_prints << floor_print
|
@@ -375,8 +379,8 @@ module URBANopt
|
|
375
379
|
end
|
376
380
|
# Subsequent polygons are holes, and are not supported.
|
377
381
|
break
|
378
|
-
end
|
379
|
-
end
|
382
|
+
end
|
383
|
+
end
|
380
384
|
spaces = []
|
381
385
|
floor_prints.each do |floor_print|
|
382
386
|
space = OpenStudio::Model::Space.fromFloorPrint(floor_print, floor_to_floor_height, model)
|
@@ -392,22 +396,23 @@ module URBANopt
|
|
392
396
|
surface.setOutsideBoundaryCondition('Ground')
|
393
397
|
end
|
394
398
|
end
|
395
|
-
end
|
399
|
+
end
|
396
400
|
spaces << space
|
397
|
-
end
|
398
|
-
|
401
|
+
end
|
402
|
+
|
399
403
|
building_story = OpenStudio::Model::BuildingStory.new(model)
|
400
404
|
building_story.setName("Building Story #{story_number}")
|
405
|
+
building_story.setNominalZCoordinate(story_number * floor_to_floor_height)
|
406
|
+
building_story.setNominalFloortoFloorHeight(floor_to_floor_height)
|
401
407
|
spaces.each do |space|
|
402
408
|
space.setBuildingStory(building_story)
|
403
409
|
thermal_zone = OpenStudio::Model::ThermalZone.new(model)
|
404
410
|
thermal_zone.setName("Building Story #{story_number} ThermalZone")
|
405
411
|
space.setThermalZone(thermal_zone)
|
406
|
-
end
|
407
|
-
|
412
|
+
end
|
413
|
+
|
408
414
|
return spaces
|
409
415
|
end
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
end
|
416
|
+
end
|
417
|
+
end
|
418
|
+
end
|