urbanopt-geojson 0.2.0.pre2 → 0.3.1
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 +61 -0
- data/Gemfile +0 -3
- data/Rakefile +1 -1
- data/docs/package-lock.json +15 -15
- data/docs/package.json +3 -1
- data/lib/measures/.rubocop.yml +1 -1
- data/lib/measures/urban_geometry_creation/README.md +1 -1
- data/lib/measures/urban_geometry_creation/measure.rb +4 -0
- data/lib/measures/urban_geometry_creation/measure.xml +17 -20
- data/lib/measures/urban_geometry_creation_zoning/README.md +1 -1
- data/lib/measures/urban_geometry_creation_zoning/measure.rb +6 -3
- data/lib/measures/urban_geometry_creation_zoning/measure.xml +15 -18
- data/lib/urbanopt/geojson/building.rb +22 -19
- data/lib/urbanopt/geojson/feature.rb +37 -1
- data/lib/urbanopt/geojson/geo_file.rb +39 -39
- data/lib/urbanopt/geojson/helper.rb +12 -5
- 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 +244 -77
- data/lib/urbanopt/geojson/schema/electrical_connector_properties.json +8 -8
- data/lib/urbanopt/geojson/schema/electrical_junction_properties.json +4 -5
- data/lib/urbanopt/geojson/schema/thermal_connector_properties.json +1 -1
- data/lib/urbanopt/geojson/schema/thermal_junction_properties.json +1 -1
- 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 +21 -41
- 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: 80cfe0ae8967e2b541207fa35a636db0ed735ca897220bca8b3c7525c635ccae
|
4
|
+
data.tar.gz: 151a2efe67159078c82cc8cdf6edcaec39e777597c11aeb09f678c408b458370
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ee7f22be5bba1aa611dcface714342ec167bb54ad4670fb6d162bbf9da24c25026f033f68dd2641dd6651a3af93dbe736b36a6df84e46f3632c14ffe040691d
|
7
|
+
data.tar.gz: 1670592b66f9dc9d23bd7cfb09fbcf223712cf012cb0273ed619c4b8d1e65cc30a2046efaa6edf939bfeaf897fef8665b23300081e86ae3b87b69722ae17bd32
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,66 @@
|
|
1
1
|
# URBANopt GeoJSON Gem
|
2
2
|
|
3
|
+
## Version 0.3.1
|
4
|
+
Date Range 06/05/20 - 08/07/20
|
5
|
+
|
6
|
+
Accepted Pull Requests: 9
|
7
|
+
- Fixed [#77]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/77 ), Bump acorn from 6.1.1 to 6.4.1 in /docs
|
8
|
+
- Fixed [#92]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/92 ), Adds scaling for building footprint using building area
|
9
|
+
- Fixed [#98]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/98 ), Add method to determine centroid for features
|
10
|
+
- Fixed [#99]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/99 ), Adds test to check footprint area
|
11
|
+
- Fixed [#100]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/100 ), Bump lodash from 4.17.15 to 4.17.19 in /docs
|
12
|
+
- Fixed [#102]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/102 ), make connector-type optional on electrical junction
|
13
|
+
- Fixed [#103]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/103 ), Bump elliptic from 6.4.1 to 6.5.3 in /docs
|
14
|
+
- Fixed [#104]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/104 ), bump minimist and dot-prop versions
|
15
|
+
- Fixed [#108]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/108 ), Schema errors (issues 105, 106, and 107)
|
16
|
+
|
17
|
+
## Version 0.3.0
|
18
|
+
|
19
|
+
Date Range 3/25/20 - 06/04/20
|
20
|
+
|
21
|
+
Updating to use with OpenStudio 3.0 and Ruby 2.5
|
22
|
+
|
23
|
+
Accepted Pull Requests:
|
24
|
+
- Fixed [#60]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/60 ), HPXML-based workflow for residential buildings
|
25
|
+
- Fixed [#83]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/83 ), Add new system types to building properties schema
|
26
|
+
- Fixed [#84]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/84 ), Updated system types with OpenStudio
|
27
|
+
- Fixed [#87]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/87 ), Adds nominal height for stories, test for confirming nominal height
|
28
|
+
- Fixed [#90]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/90 ), Assigns construction correctly for adiabatic surfaces.
|
29
|
+
-Fixed [#95]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/95 ), Exclude measure tests from gem release to reduce size
|
30
|
+
|
31
|
+
## Version 0.2.0
|
32
|
+
|
33
|
+
Date Range: 12/26/19 - 03/25/20
|
34
|
+
|
35
|
+
|
36
|
+
Accepted Pull Requests:
|
37
|
+
- Fixed [#41]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/41 ), Added urbanopt-geojson, this closes #40
|
38
|
+
- Fixed [#45]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/45 ), Add script to ease updates to changelog
|
39
|
+
- Fixed [#46]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/46 ), Use URBANopt standard contributing guidelines
|
40
|
+
- Fixed [#49]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/49 ), adding unspecified to flow_direction enum #48
|
41
|
+
- Fixed [#50]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/50 ), update package-lock file with secure dependency versions
|
42
|
+
- Fixed [#51]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/51 ), update license date to include 2020
|
43
|
+
- Fixed [#52]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/52 ), Addresses issues in GeoJSON gem
|
44
|
+
- Fixed [#53]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/53 ), Remove unused travis CI file
|
45
|
+
- Fixed [#54]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/54 ), Remove Simplecov dependency
|
46
|
+
- Fixed [#55]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/55 ), Add github templates for issues and PRs
|
47
|
+
- Fixed [#56]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/56 ), Use new version of extension gem
|
48
|
+
- Fixed [#58]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/58 ), Require ISSUES for PRs to address. Makes auto-changelog easy
|
49
|
+
- Fixed [#62]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/62 ), modifying wire types enum and fixing json validation
|
50
|
+
error
|
51
|
+
- Fixed [#63]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/63 ), Require ruby < 2.3.0
|
52
|
+
- Fixed [#65]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/65 ), Use pessimistic versioning for dependencies
|
53
|
+
- Fixed [#66]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/66 ), Update Jenkinsfile
|
54
|
+
- Fixed [#68]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/68 ), fix create_other_building functionality and merge site props to feature props
|
55
|
+
- Fixed [#71]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/71 ), Adds methods for converting building class instance to hash.
|
56
|
+
- Fixed [#73]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/73 ), Warning message for number of stories
|
57
|
+
- Fixed [#74]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/74 ), prep for prerelease
|
58
|
+
- Fixed [#75]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/75 ), Fixes bug while creating
|
59
|
+
shading surface for adjacent buildings
|
60
|
+
- Fixed [#76]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/76 ), Changed name of extension file
|
61
|
+
- Fixed [#78]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/78 ), 0.2.0.pre2
|
62
|
+
- Fixed [#80]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/80 ), look for site features in project key instead of Site Origin feature
|
63
|
+
|
3
64
|
## Version 0.1.0
|
4
65
|
|
5
66
|
* 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/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
|
data/docs/package-lock.json
CHANGED
@@ -1180,9 +1180,9 @@
|
|
1180
1180
|
}
|
1181
1181
|
},
|
1182
1182
|
"acorn": {
|
1183
|
-
"version": "6.
|
1184
|
-
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.
|
1185
|
-
"integrity": "sha512-
|
1183
|
+
"version": "6.4.1",
|
1184
|
+
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz",
|
1185
|
+
"integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA=="
|
1186
1186
|
},
|
1187
1187
|
"acorn-dynamic-import": {
|
1188
1188
|
"version": "4.0.0",
|
@@ -3513,9 +3513,9 @@
|
|
3513
3513
|
"integrity": "sha512-p1pgKOSSgcROCRiZoJ5H5wFmhqdA0L3yLL9mlfcmdA4V60IDCrsvhNqN8rLPe9e3B772Gm02kBkL1GM/g2lENg=="
|
3514
3514
|
},
|
3515
3515
|
"elliptic": {
|
3516
|
-
"version": "6.
|
3517
|
-
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.
|
3518
|
-
"integrity": "sha512-
|
3516
|
+
"version": "6.5.3",
|
3517
|
+
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz",
|
3518
|
+
"integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==",
|
3519
3519
|
"requires": {
|
3520
3520
|
"bn.js": "^4.4.0",
|
3521
3521
|
"brorand": "^1.0.1",
|
@@ -5733,9 +5733,9 @@
|
|
5733
5733
|
"integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA=="
|
5734
5734
|
},
|
5735
5735
|
"json-formatter-js": {
|
5736
|
-
"version": "2.
|
5737
|
-
"resolved": "https://registry.npmjs.org/json-formatter-js/-/json-formatter-js-2.
|
5738
|
-
"integrity": "
|
5736
|
+
"version": "2.3.4",
|
5737
|
+
"resolved": "https://registry.npmjs.org/json-formatter-js/-/json-formatter-js-2.3.4.tgz",
|
5738
|
+
"integrity": "sha512-gmAzYRtPRmYzeAT4T7+t3NhTF89JOAIioCVDddl9YDb3ls3kWcskirafw/MZGJaRhEU6fRimGJHl7CC7gaAI2Q=="
|
5739
5739
|
},
|
5740
5740
|
"json-parse-better-errors": {
|
5741
5741
|
"version": "1.0.2",
|
@@ -6050,9 +6050,9 @@
|
|
6050
6050
|
}
|
6051
6051
|
},
|
6052
6052
|
"lodash": {
|
6053
|
-
"version": "4.17.
|
6054
|
-
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.
|
6055
|
-
"integrity": "sha512-
|
6053
|
+
"version": "4.17.19",
|
6054
|
+
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
|
6055
|
+
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ=="
|
6056
6056
|
},
|
6057
6057
|
"lodash._reinterpolate": {
|
6058
6058
|
"version": "3.0.0",
|
@@ -9361,9 +9361,9 @@
|
|
9361
9361
|
"integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc="
|
9362
9362
|
},
|
9363
9363
|
"replace-ext": {
|
9364
|
-
"version": "1.0.
|
9365
|
-
"resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.
|
9366
|
-
"integrity": "
|
9364
|
+
"version": "1.0.1",
|
9365
|
+
"resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz",
|
9366
|
+
"integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw=="
|
9367
9367
|
},
|
9368
9368
|
"request": {
|
9369
9369
|
"version": "2.88.0",
|
data/docs/package.json
CHANGED
@@ -18,10 +18,12 @@
|
|
18
18
|
},
|
19
19
|
"devDependencies": {
|
20
20
|
"braces": ">=2.3.1",
|
21
|
+
"dot-prop": ">=5.1.1",
|
21
22
|
"gh-pages": "^2.0.1",
|
22
23
|
"js-yaml": ">=3.13.1",
|
23
|
-
"lodash": ">=4.17.
|
24
|
+
"lodash": ">=4.17.19",
|
24
25
|
"lodash.template": ">=4.5.0",
|
26
|
+
"minimist": ">=1.2.3",
|
25
27
|
"mixin-deep": ">=1.3.2",
|
26
28
|
"serialize-javascript": ">=2.1.1",
|
27
29
|
"set-value": ">=2.0.1"
|
data/lib/measures/.rubocop.yml
CHANGED
@@ -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
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# *********************************************************************************
|
2
4
|
# URBANopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
|
3
5
|
# contributors. All rights reserved.
|
@@ -77,7 +79,9 @@ class UrbanGeometryCreation < OpenStudio::Measure::ModelMeasure
|
|
77
79
|
end
|
78
80
|
|
79
81
|
# define what happens when the measure is run
|
82
|
+
# rubocop:disable Metrics/AbcSize
|
80
83
|
def run(model, runner, user_arguments)
|
84
|
+
# rubocop:enable Metrics/AbcSize
|
81
85
|
super(model, runner, user_arguments)
|
82
86
|
# use the built-in error checking
|
83
87
|
if !runner.validateUserArguments(arguments(model), user_arguments)
|
@@ -1,14 +1,15 @@
|
|
1
|
+
<?xml version="1.0"?>
|
1
2
|
<measure>
|
2
3
|
<schema_version>3.0</schema_version>
|
3
4
|
<name>urban_geometry_creation</name>
|
4
5
|
<uid>5ab85d6b-c9af-4361-8ab9-613ee99a5666</uid>
|
5
|
-
<version_id>
|
6
|
-
<version_modified>
|
6
|
+
<version_id>e32672b2-91b1-4b62-9770-7712cab86004</version_id>
|
7
|
+
<version_modified>20200807T210717Z</version_modified>
|
7
8
|
<xml_checksum>D254E772</xml_checksum>
|
8
9
|
<class_name>UrbanGeometryCreation</class_name>
|
9
10
|
<display_name>UrbanGeometryCreation</display_name>
|
10
11
|
<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
|
12
|
+
<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
13
|
<arguments>
|
13
14
|
<argument>
|
14
15
|
<name>geojson_file</name>
|
@@ -43,15 +44,11 @@
|
|
43
44
|
<value>ShadingOnly</value>
|
44
45
|
<display_name>ShadingOnly</display_name>
|
45
46
|
</choice>
|
46
|
-
<choice>
|
47
|
-
<value>All</value>
|
48
|
-
<display_name>All</display_name>
|
49
|
-
</choice>
|
50
47
|
</choices>
|
51
48
|
</argument>
|
52
49
|
</arguments>
|
53
|
-
<outputs/>
|
54
|
-
<provenances/>
|
50
|
+
<outputs />
|
51
|
+
<provenances />
|
55
52
|
<tags>
|
56
53
|
<tag>Envelope.Form</tag>
|
57
54
|
</tags>
|
@@ -94,35 +91,35 @@
|
|
94
91
|
<usage_type>readmeerb</usage_type>
|
95
92
|
<checksum>703C9964</checksum>
|
96
93
|
</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
94
|
<file>
|
104
95
|
<filename>LICENSE.md</filename>
|
105
96
|
<filetype>md</filetype>
|
106
97
|
<usage_type>license</usage_type>
|
107
|
-
<checksum>
|
98
|
+
<checksum>EA283B74</checksum>
|
108
99
|
</file>
|
109
100
|
<file>
|
110
101
|
<filename>nrel_stm_footprints.geojson</filename>
|
111
102
|
<filetype>geojson</filetype>
|
112
103
|
<usage_type>test</usage_type>
|
113
|
-
<checksum>
|
104
|
+
<checksum>40290298</checksum>
|
105
|
+
</file>
|
106
|
+
<file>
|
107
|
+
<filename>README.md</filename>
|
108
|
+
<filetype>md</filetype>
|
109
|
+
<usage_type>readme</usage_type>
|
110
|
+
<checksum>A09F345D</checksum>
|
114
111
|
</file>
|
115
112
|
<file>
|
116
113
|
<filename>shadowed_tests.rb</filename>
|
117
114
|
<filetype>rb</filetype>
|
118
115
|
<usage_type>test</usage_type>
|
119
|
-
<checksum>
|
116
|
+
<checksum>4E51A05C</checksum>
|
120
117
|
</file>
|
121
118
|
<file>
|
122
119
|
<filename>urban_geometry_creation_test.rb</filename>
|
123
120
|
<filetype>rb</filetype>
|
124
121
|
<usage_type>test</usage_type>
|
125
|
-
<checksum>
|
122
|
+
<checksum>DDAD6BFA</checksum>
|
126
123
|
</file>
|
127
124
|
<file>
|
128
125
|
<version>
|
@@ -133,7 +130,7 @@
|
|
133
130
|
<filename>measure.rb</filename>
|
134
131
|
<filetype>rb</filetype>
|
135
132
|
<usage_type>script</usage_type>
|
136
|
-
<checksum>
|
133
|
+
<checksum>2F8C09F7</checksum>
|
137
134
|
</file>
|
138
135
|
</files>
|
139
136
|
</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
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# *********************************************************************************
|
2
4
|
# URBANopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
|
3
5
|
# contributors. All rights reserved.
|
@@ -81,7 +83,9 @@ class UrbanGeometryCreationZoning < OpenStudio::Measure::ModelMeasure
|
|
81
83
|
end
|
82
84
|
|
83
85
|
# define what happens when the measure is run
|
86
|
+
# rubocop:disable Metrics/AbcSize
|
84
87
|
def run(model, runner, user_arguments)
|
88
|
+
# rubocop:enable Metrics/AbcSize
|
85
89
|
super(model, runner, user_arguments)
|
86
90
|
# use the built-in error checking
|
87
91
|
if !runner.validateUserArguments(arguments(model), user_arguments)
|
@@ -111,8 +115,8 @@ class UrbanGeometryCreationZoning < OpenStudio::Measure::ModelMeasure
|
|
111
115
|
@runner = runner
|
112
116
|
@origin_lat_lon = nil
|
113
117
|
|
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)
|
118
|
+
all_features = URBANopt::GeoJSON::GeoFile.from_file(geojson_file)
|
119
|
+
feature = URBANopt::GeoJSON::GeoFile.from_file(geojson_file).get_feature_by_id(feature_id)
|
116
120
|
|
117
121
|
# EXPOSE NAME
|
118
122
|
name = feature.feature_json[:properties][:name]
|
@@ -153,7 +157,6 @@ class UrbanGeometryCreationZoning < OpenStudio::Measure::ModelMeasure
|
|
153
157
|
convert_to_shades = feature.create_other_buildings(surrounding_buildings, all_features.json, model, @origin_lat_lon, @runner)
|
154
158
|
end
|
155
159
|
|
156
|
-
|
157
160
|
# intersect surfaces in this building with others
|
158
161
|
@runner.registerInfo('Intersecting surfaces')
|
159
162
|
spaces.each do |space|
|
@@ -1,13 +1,14 @@
|
|
1
|
+
<?xml version="1.0"?>
|
1
2
|
<measure>
|
2
3
|
<schema_version>3.0</schema_version>
|
3
4
|
<name>urban_geometry_creation_zoning</name>
|
4
5
|
<uid>96ea1317-76ac-4670-b51d-71ee3f4fdd65</uid>
|
5
|
-
<version_id>
|
6
|
-
<version_modified>
|
6
|
+
<version_id>884d6eb0-6517-40dc-96ca-ac4db7c2ad7d</version_id>
|
7
|
+
<version_modified>20200807T210718Z</version_modified>
|
7
8
|
<xml_checksum>D254E772</xml_checksum>
|
8
9
|
<class_name>UrbanGeometryCreationZoning</class_name>
|
9
10
|
<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>
|
11
|
+
<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
12
|
<modeler_description></modeler_description>
|
12
13
|
<arguments>
|
13
14
|
<argument>
|
@@ -43,15 +44,11 @@
|
|
43
44
|
<value>ShadingOnly</value>
|
44
45
|
<display_name>ShadingOnly</display_name>
|
45
46
|
</choice>
|
46
|
-
<choice>
|
47
|
-
<value>All</value>
|
48
|
-
<display_name>All</display_name>
|
49
|
-
</choice>
|
50
47
|
</choices>
|
51
48
|
</argument>
|
52
49
|
</arguments>
|
53
|
-
<outputs/>
|
54
|
-
<provenances/>
|
50
|
+
<outputs />
|
51
|
+
<provenances />
|
55
52
|
<tags>
|
56
53
|
<tag>Envelope.Form</tag>
|
57
54
|
</tags>
|
@@ -104,19 +101,13 @@
|
|
104
101
|
<filename>LICENSE.md</filename>
|
105
102
|
<filetype>md</filetype>
|
106
103
|
<usage_type>license</usage_type>
|
107
|
-
<checksum>
|
104
|
+
<checksum>EA283B74</checksum>
|
108
105
|
</file>
|
109
106
|
<file>
|
110
107
|
<filename>README.md</filename>
|
111
108
|
<filetype>md</filetype>
|
112
109
|
<usage_type>readme</usage_type>
|
113
|
-
<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>
|
110
|
+
<checksum>0458EE16</checksum>
|
120
111
|
</file>
|
121
112
|
<file>
|
122
113
|
<version>
|
@@ -127,7 +118,13 @@
|
|
127
118
|
<filename>measure.rb</filename>
|
128
119
|
<filetype>rb</filetype>
|
129
120
|
<usage_type>script</usage_type>
|
130
|
-
<checksum>
|
121
|
+
<checksum>2505C43D</checksum>
|
122
|
+
</file>
|
123
|
+
<file>
|
124
|
+
<filename>urban_geometry_creation_zoning_test.rb</filename>
|
125
|
+
<filetype>rb</filetype>
|
126
|
+
<usage_type>test</usage_type>
|
127
|
+
<checksum>986CB63E</checksum>
|
131
128
|
</file>
|
132
129
|
</files>
|
133
130
|
</measure>
|
@@ -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,7 +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.
|
90
|
+
# +false+. Zoning is set to False by default.
|
92
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.
|
93
92
|
def create_building(create_method, model, origin_lat_lon, runner, zoning = false, other_building = @feature_json)
|
94
93
|
number_of_stories = other_building[:properties][:number_of_stories]
|
@@ -277,14 +276,13 @@ module URBANopt
|
|
277
276
|
result[:mixed_type_3_percentage] = @mixed_type_3_percentage if @mixed_type_3_percentage
|
278
277
|
result[:mixed_type_4] = @mixed_type_4 if @mixed_type_4
|
279
278
|
result[:mixed_type_4_percentage] = @mixed_type_4_percentage if @mixed_type_4_percentage
|
280
|
-
return result
|
279
|
+
return result
|
281
280
|
end
|
282
281
|
|
283
|
-
|
284
282
|
private
|
285
283
|
|
286
284
|
##
|
287
|
-
# Returns an array of instances of +OpenStudio::Model::Space+ per building
|
285
|
+
# Returns an array of instances of +OpenStudio::Model::Space+ per building.
|
288
286
|
#
|
289
287
|
# [Parameters]
|
290
288
|
# * +min_elevation+ - _Type:Integer_ - Indicates minimum elevation across all buildings.
|
@@ -294,7 +292,9 @@ module URBANopt
|
|
294
292
|
# * +runner+ - _Type:String_ - An instance of +Openstudio::Measure::OSRunner+ for the measure run.
|
295
293
|
# * +zoning+ - _Type:Boolean_ - Value is +true+ if utilizing detailed zoning, else
|
296
294
|
# +false+. Zoning is set to False by default.
|
295
|
+
# rubocop:disable Style/OptionalArguments, Style/CommentedKeyword
|
297
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
298
|
if other_building
|
299
299
|
geometry = other_building[:geometry]
|
300
300
|
properties = other_building[:properties]
|
@@ -338,7 +338,7 @@ module URBANopt
|
|
338
338
|
result << space
|
339
339
|
end
|
340
340
|
return result
|
341
|
-
|
341
|
+
end
|
342
342
|
|
343
343
|
##
|
344
344
|
# Returns an array of instances of +OpenStudio::Model::Space+ per floor.
|
@@ -352,8 +352,10 @@ module URBANopt
|
|
352
352
|
# origin's latitude and longitude.
|
353
353
|
# * +runner+ - _Type:String_ - An instance of +Openstudio::Measure::OSRunner+ for the measure run.
|
354
354
|
# * +zoning+ - _Type:Boolean_ - Value is +true+ if utilizing detailed zoning, else
|
355
|
-
# +false+. Zoning is set to False by default.
|
355
|
+
# +false+. Zoning is set to False by default.
|
356
|
+
# rubocop:disable Style/CommentedKeyword
|
356
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
|
357
359
|
geometry = @feature_json[:geometry]
|
358
360
|
properties = @feature_json[:properties]
|
359
361
|
floor_prints = []
|
@@ -367,7 +369,7 @@ module URBANopt
|
|
367
369
|
floor_print = URBANopt::GeoJSON::Helper.floor_print_from_polygon(polygon, elevation, origin_lat_lon, runner, zoning)
|
368
370
|
if floor_print
|
369
371
|
if zoning
|
370
|
-
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)
|
371
373
|
floor_prints.concat(this_floor_prints)
|
372
374
|
else
|
373
375
|
floor_prints << floor_print
|
@@ -377,8 +379,8 @@ module URBANopt
|
|
377
379
|
end
|
378
380
|
# Subsequent polygons are holes, and are not supported.
|
379
381
|
break
|
380
|
-
end
|
381
|
-
end
|
382
|
+
end
|
383
|
+
end
|
382
384
|
spaces = []
|
383
385
|
floor_prints.each do |floor_print|
|
384
386
|
space = OpenStudio::Model::Space.fromFloorPrint(floor_print, floor_to_floor_height, model)
|
@@ -394,22 +396,23 @@ module URBANopt
|
|
394
396
|
surface.setOutsideBoundaryCondition('Ground')
|
395
397
|
end
|
396
398
|
end
|
397
|
-
end
|
399
|
+
end
|
398
400
|
spaces << space
|
399
|
-
end
|
400
|
-
|
401
|
+
end
|
402
|
+
|
401
403
|
building_story = OpenStudio::Model::BuildingStory.new(model)
|
402
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)
|
403
407
|
spaces.each do |space|
|
404
408
|
space.setBuildingStory(building_story)
|
405
409
|
thermal_zone = OpenStudio::Model::ThermalZone.new(model)
|
406
410
|
thermal_zone.setName("Building Story #{story_number} ThermalZone")
|
407
411
|
space.setThermalZone(thermal_zone)
|
408
|
-
end
|
409
|
-
|
412
|
+
end
|
413
|
+
|
410
414
|
return spaces
|
411
415
|
end
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
end
|
416
|
+
end
|
417
|
+
end
|
418
|
+
end
|