urbanopt-geojson 0.5.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
data/docs/package.json CHANGED
@@ -13,21 +13,26 @@
13
13
  "highlight.js": "^10.4.1",
14
14
  "json-schema-ref-parser": "^9.0.6",
15
15
  "json-schema-view-js": "git+https://git@github.com/bgschiller/json-schema-view-js.git",
16
- "vuepress": "^1.5.4",
16
+ "vuepress": "^1.8.2",
17
17
  "webpack-dev-middleware": "^3.6.0"
18
18
  },
19
19
  "devDependencies": {
20
20
  "braces": "^3.0.2",
21
+ "chokidar": "^3.5.1",
21
22
  "dot-prop": ">=5.1.1",
23
+ "fsevents": "^2.3.2",
22
24
  "gh-pages": "^3.1.0",
25
+ "ini": "^2.0.0",
26
+ "is-svg": "^4.3.1",
23
27
  "js-yaml": ">=3.13.1",
24
- "lodash": ">=4.17.19",
28
+ "lodash": ">=4.17.21",
25
29
  "lodash.template": ">=4.5.0",
26
30
  "minimist": ">=1.2.3",
27
31
  "mixin-deep": "^2.0.1",
28
32
  "serialize-javascript": "^5.0.1",
29
33
  "set-value": "^3.0.2",
30
- "yargs-parser": "^20.2.3",
31
- "ini": "^2.0.0"
34
+ "ssri": "^8.0.1",
35
+ "webpack": "^4.46.0",
36
+ "yargs-parser": "^20.2.3"
32
37
  }
33
38
  }
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>urban_geometry_creation</name>
5
5
  <uid>5ab85d6b-c9af-4361-8ab9-613ee99a5666</uid>
6
- <version_id>2e224aaa-0d77-486f-b8ef-c25121fabd91</version_id>
7
- <version_modified>20201208T232103Z</version_modified>
6
+ <version_id>9eeca0c7-ef9d-4829-aa2c-b2c138a963c1</version_id>
7
+ <version_modified>20210602T203055Z</version_modified>
8
8
  <xml_checksum>D254E772</xml_checksum>
9
9
  <class_name>UrbanGeometryCreation</class_name>
10
10
  <display_name>UrbanGeometryCreation</display_name>
@@ -116,23 +116,29 @@
116
116
  <usage_type>test</usage_type>
117
117
  <checksum>40290298</checksum>
118
118
  </file>
119
+ <file>
120
+ <filename>README.md</filename>
121
+ <filetype>md</filetype>
122
+ <usage_type>readme</usage_type>
123
+ <checksum>74F54DC5</checksum>
124
+ </file>
119
125
  <file>
120
126
  <filename>LICENSE.md</filename>
121
127
  <filetype>md</filetype>
122
128
  <usage_type>license</usage_type>
123
- <checksum>D8541540</checksum>
129
+ <checksum>03523BF4</checksum>
124
130
  </file>
125
131
  <file>
126
132
  <filename>shadowed_tests.rb</filename>
127
133
  <filetype>rb</filetype>
128
134
  <usage_type>test</usage_type>
129
- <checksum>F656F8DE</checksum>
135
+ <checksum>682820CD</checksum>
130
136
  </file>
131
137
  <file>
132
138
  <filename>urban_geometry_creation_test.rb</filename>
133
139
  <filetype>rb</filetype>
134
140
  <usage_type>test</usage_type>
135
- <checksum>B4A7376B</checksum>
141
+ <checksum>FD5181F7</checksum>
136
142
  </file>
137
143
  <file>
138
144
  <version>
@@ -143,13 +149,7 @@
143
149
  <filename>measure.rb</filename>
144
150
  <filetype>rb</filetype>
145
151
  <usage_type>script</usage_type>
146
- <checksum>791A977E</checksum>
147
- </file>
148
- <file>
149
- <filename>README.md</filename>
150
- <filetype>md</filetype>
151
- <usage_type>readme</usage_type>
152
- <checksum>74F54DC5</checksum>
152
+ <checksum>3667C98F</checksum>
153
153
  </file>
154
154
  </files>
155
155
  </measure>
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>urban_geometry_creation_zoning</name>
5
5
  <uid>96ea1317-76ac-4670-b51d-71ee3f4fdd65</uid>
6
- <version_id>0c0d1135-a50f-40c6-82fb-fc357e46dd02</version_id>
7
- <version_modified>20201208T232103Z</version_modified>
6
+ <version_id>c115c875-0e04-4ac9-990b-011811df23bb</version_id>
7
+ <version_modified>20210602T203056Z</version_modified>
8
8
  <xml_checksum>D254E772</xml_checksum>
9
9
  <class_name>UrbanGeometryCreationZoning</class_name>
10
10
  <display_name>UrbanGeometryCreationZoning</display_name>
@@ -97,11 +97,17 @@
97
97
  <usage_type>test</usage_type>
98
98
  <checksum>40290298</checksum>
99
99
  </file>
100
+ <file>
101
+ <filename>README.md</filename>
102
+ <filetype>md</filetype>
103
+ <usage_type>readme</usage_type>
104
+ <checksum>0458EE16</checksum>
105
+ </file>
100
106
  <file>
101
107
  <filename>LICENSE.md</filename>
102
108
  <filetype>md</filetype>
103
109
  <usage_type>license</usage_type>
104
- <checksum>D8541540</checksum>
110
+ <checksum>03523BF4</checksum>
105
111
  </file>
106
112
  <file>
107
113
  <version>
@@ -112,19 +118,31 @@
112
118
  <filename>measure.rb</filename>
113
119
  <filetype>rb</filetype>
114
120
  <usage_type>script</usage_type>
115
- <checksum>3E6D4653</checksum>
121
+ <checksum>290A59E6</checksum>
116
122
  </file>
117
123
  <file>
118
124
  <filename>urban_geometry_creation_zoning_test.rb</filename>
119
125
  <filetype>rb</filetype>
120
126
  <usage_type>test</usage_type>
121
- <checksum>D609CD4C</checksum>
127
+ <checksum>20775652</checksum>
122
128
  </file>
123
129
  <file>
124
- <filename>README.md</filename>
125
- <filetype>md</filetype>
126
- <usage_type>readme</usage_type>
127
- <checksum>0458EE16</checksum>
130
+ <filename>example_project_combined.json</filename>
131
+ <filetype>json</filetype>
132
+ <usage_type>test</usage_type>
133
+ <checksum>9BC47B41</checksum>
134
+ </file>
135
+ <file>
136
+ <filename>out.txt</filename>
137
+ <filetype>txt</filetype>
138
+ <usage_type>test</usage_type>
139
+ <checksum>7FAF05F3</checksum>
140
+ </file>
141
+ <file>
142
+ <filename>OV_Buildings_Update_090420_res_eui_test.json</filename>
143
+ <filetype>json</filetype>
144
+ <usage_type>test</usage_type>
145
+ <checksum>F611B1E8</checksum>
128
146
  </file>
129
147
  </files>
130
148
  </measure>
@@ -261,10 +261,12 @@ module URBANopt
261
261
  end
262
262
 
263
263
  ##
264
- # Used to determine the centroid for the feature's coordinates.
264
+ # Used to determine the centroid for the feature's geojson coordinates.
265
265
  #
266
266
  # [Parameters]
267
267
  # * +vertices+ - The first set polygon vertices in the array of feature coordinates.
268
+ # [Returns]
269
+ # Returns Feature centroid coordinates [long, lat]
268
270
  def find_feature_center(vertices)
269
271
  number_of_locations = vertices.length
270
272
 
@@ -288,8 +290,9 @@ module URBANopt
288
290
  central_square_root = Math.sqrt(x * x + y * y)
289
291
  central_latitude = Math.atan2(z, central_square_root)
290
292
 
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
+
293
296
  end
294
297
 
295
298
  private
@@ -308,8 +308,11 @@ module URBANopt
308
308
  # find the polygon of the other_building by passing it to the get_multi_polygons method
309
309
  other_building_points = building.other_points(other_building, other_height, origin_lat_lon, runner, zoning)
310
310
  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
311
314
  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)
313
316
  if new_building.nil? || new_building.empty?
314
317
  runner.registerWarning("Failed to create spaces for other building '#{name}'")
315
318
  end
@@ -331,23 +334,27 @@ module URBANopt
331
334
  # * +origin_lat_lon+ _Type:Float_ - An instance of OpenStudio::PointLatLon indicating the origin's
332
335
  # latitude and longitude.
333
336
  def self.is_shadowed(potentially_shaded, potential_shader, origin_lat_lon)
334
- all_pairs = []
337
+ # not using origin_lat_lon but have not removed it yet
338
+ min_distance = nil
339
+ min_pair = nil
335
340
  potentially_shaded.each do |building_point|
336
341
  potential_shader.each do |other_building_point|
337
342
  vector = other_building_point - building_point
338
- all_pairs << {
339
- building_point: building_point,
340
- other_building_point: other_building_point,
341
- vector: vector,
342
- distance: vector.length
343
- }
343
+ distance = Math.sqrt(vector.x * vector.x + vector.y * vector.y)
344
+ if min_distance.nil? || distance < min_distance
345
+ min_distance = distance
346
+ min_pair = {
347
+ building_point: building_point,
348
+ other_building_point: other_building_point,
349
+ vector: vector,
350
+ distance: vector.length
351
+ }
352
+ end
344
353
  end
345
354
  end
346
- all_pairs.sort! { |x, y| x[:distance] <=> y[:distance] }
347
- all_pairs.each do |pair|
348
- if is_shaded(pair[:building_point], pair[:other_building_point], origin_lat_lon)
349
- return true
350
- end
355
+
356
+ if is_shaded(min_pair[:building_point], min_pair[:other_building_point], origin_lat_lon)
357
+ return true
351
358
  end
352
359
  return false
353
360
  end
@@ -361,34 +368,27 @@ module URBANopt
361
368
  # * +origin_lat_lon+ - _Type:Float_ - An instance of +OpenStudio::PointLatLon+ indicating the
362
369
  # origin's latitude and longitude.
363
370
  def self.is_shaded(building_point, other_building_point, origin_lat_lon)
371
+ # not using origin_lat_lon but have not removed it yet
364
372
  vector = other_building_point - building_point
365
- height = vector.z
366
373
  distance = Math.sqrt(vector.x * vector.x + vector.y * vector.y)
367
374
  if distance < 1
368
375
  return true
369
376
  end
370
- hour_angle_rad = Math.atan2(-vector.x, -vector.y)
371
- hour_angle = OpenStudio.radToDeg(hour_angle_rad)
372
- latitude_rad = OpenStudio.degToRad(origin_lat_lon.lat)
373
- result = false
374
- (-24..24).each do |declination|
375
- declination_rad = OpenStudio.degToRad(declination)
376
- zenith_angle_rad = Math.acos(Math.sin(latitude_rad) * Math.sin(declination_rad) + Math.cos(latitude_rad) * Math.cos(declination_rad) * Math.cos(hour_angle_rad))
377
- zenith_angle = OpenStudio.radToDeg(zenith_angle_rad)
378
- elevation_angle = 90 - zenith_angle
379
- apparent_angle_rad = Math.atan2(height, distance)
380
- apparent_angle = OpenStudio.radToDeg(apparent_angle_rad)
381
- if elevation_angle > 0 && elevation_angle < apparent_angle
382
- result = true
383
- break
384
- end
377
+ elevation_angle = 2.5 #not sure of best value maybe allow as project level argument
378
+ height = vector.z
379
+ apparent_angle_rad = Math.atan2(height, distance)
380
+ apparent_angle = OpenStudio.radToDeg(apparent_angle_rad)
381
+ if elevation_angle < apparent_angle
382
+ result = true
383
+ else
384
+ result = false
385
385
  end
386
386
  return result
387
387
  end
388
388
 
389
- class << self
390
- private :is_shaded
389
+ class << self
390
+ private :is_shaded
391
+ end
392
+ end
393
+ end
391
394
  end
392
- end
393
- end
394
- end
@@ -1,21 +1,31 @@
1
1
  # *********************************************************************************
2
- # URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
- #
4
+
5
5
  # Redistribution and use in source and binary forms, with or without modification,
6
6
  # are permitted provided that the following conditions are met:
7
- #
7
+
8
8
  # Redistributions of source code must retain the above copyright notice, this list
9
9
  # of conditions and the following disclaimer.
10
- #
10
+
11
11
  # Redistributions in binary form must reproduce the above copyright notice, this
12
12
  # list of conditions and the following disclaimer in the documentation and/or other
13
13
  # materials provided with the distribution.
14
- #
14
+
15
15
  # Neither the name of the copyright holder nor the names of its contributors may be
16
16
  # used to endorse or promote products derived from this software without specific
17
17
  # prior written permission.
18
- #
18
+
19
+ # Redistribution of this software, without modification, must refer to the software
20
+ # by the same designation. Redistribution of a modified version of this software
21
+ # (i) may not refer to the modified version by the same designation, or by any
22
+ # confusingly similar designation, and (ii) must refer to the underlying software
23
+ # originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
24
+ # the term “URBANopt”, or any confusingly similar designation may not be used to
25
+ # refer to any modified version of this software or any modified version of the
26
+ # underlying software originally provided by Alliance without the prior written
27
+ # consent of Alliance.
28
+
19
29
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
30
  # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
31
  # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@@ -1,21 +1,31 @@
1
1
  # *********************************************************************************
2
- # URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
- #
4
+
5
5
  # Redistribution and use in source and binary forms, with or without modification,
6
6
  # are permitted provided that the following conditions are met:
7
- #
7
+
8
8
  # Redistributions of source code must retain the above copyright notice, this list
9
9
  # of conditions and the following disclaimer.
10
- #
10
+
11
11
  # Redistributions in binary form must reproduce the above copyright notice, this
12
12
  # list of conditions and the following disclaimer in the documentation and/or other
13
13
  # materials provided with the distribution.
14
- #
14
+
15
15
  # Neither the name of the copyright holder nor the names of its contributors may be
16
16
  # used to endorse or promote products derived from this software without specific
17
17
  # prior written permission.
18
- #
18
+
19
+ # Redistribution of this software, without modification, must refer to the software
20
+ # by the same designation. Redistribution of a modified version of this software
21
+ # (i) may not refer to the modified version by the same designation, or by any
22
+ # confusingly similar designation, and (ii) must refer to the underlying software
23
+ # originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
24
+ # the term “URBANopt”, or any confusingly similar designation may not be used to
25
+ # refer to any modified version of this software or any modified version of the
26
+ # underlying software originally provided by Alliance without the prior written
27
+ # consent of Alliance.
28
+
19
29
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
30
  # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
31
  # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@@ -1,21 +1,31 @@
1
1
  # *********************************************************************************
2
- # URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
- #
4
+
5
5
  # Redistribution and use in source and binary forms, with or without modification,
6
6
  # are permitted provided that the following conditions are met:
7
- #
7
+
8
8
  # Redistributions of source code must retain the above copyright notice, this list
9
9
  # of conditions and the following disclaimer.
10
- #
10
+
11
11
  # Redistributions in binary form must reproduce the above copyright notice, this
12
12
  # list of conditions and the following disclaimer in the documentation and/or other
13
13
  # materials provided with the distribution.
14
- #
14
+
15
15
  # Neither the name of the copyright holder nor the names of its contributors may be
16
16
  # used to endorse or promote products derived from this software without specific
17
17
  # prior written permission.
18
- #
18
+
19
+ # Redistribution of this software, without modification, must refer to the software
20
+ # by the same designation. Redistribution of a modified version of this software
21
+ # (i) may not refer to the modified version by the same designation, or by any
22
+ # confusingly similar designation, and (ii) must refer to the underlying software
23
+ # originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
24
+ # the term “URBANopt”, or any confusingly similar designation may not be used to
25
+ # refer to any modified version of this software or any modified version of the
26
+ # underlying software originally provided by Alliance without the prior written
27
+ # consent of Alliance.
28
+
19
29
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
30
  # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
31
  # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@@ -537,7 +537,8 @@
537
537
  "90.1-2007",
538
538
  "90.1-2010",
539
539
  "90.1-2013",
540
- "NREL ZNE Ready 2017",
540
+ "90.1-2016",
541
+ "90.1-2019",
541
542
  "DEER Pre-1975",
542
543
  "DEER 1985",
543
544
  "DEER 1996",
@@ -130,6 +130,8 @@
130
130
  "Transformer--100KVA PM",
131
131
  "Transformer--150KVA PM",
132
132
  "Transformer--300KVA PM",
133
+ "Transformer--500KVA PM",
134
+ "Transformer--750KVA PM",
133
135
  "Waste Heat Source--Hot Water",
134
136
  "Waste Heat Source--Ambient Water"
135
137
  ]
@@ -219,7 +219,10 @@
219
219
  "UG AL 1000kcmil A",
220
220
  "UG AL 1000kcmil B",
221
221
  "UG AL 1000kcmil C",
222
- "UG AL 1000kcmil N"
222
+ "UG AL 1000kcmil N",
223
+ "UG AL 1000mcm A",
224
+ "UG AL 1000mcm B",
225
+ "UG AL 1000mcm C"
223
226
  ]
224
227
  }
225
228
  }
@@ -75,6 +75,14 @@
75
75
  "description": "Name of utility tariff file in IDF or URDB format.",
76
76
  "type": "string"
77
77
  },
78
+ "underground_cables_ratio": {
79
+ "description": "Ratio of overall cables that are underground vs. overhead for RNM analysis.",
80
+ "type": "number"
81
+ },
82
+ "only_lv_consumers": {
83
+ "description": "If true, only low voltage consumers will be considered in the RNM analysis.",
84
+ "type": "boolean"
85
+ },
78
86
  "user_data": {
79
87
  "description": "Arbitrary user data"
80
88
  }