urbanopt-geojson 0.3.1 → 0.5.3

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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/pull_request_template.md +2 -2
  3. data/CHANGELOG.md +48 -4
  4. data/CONTRIBUTING.md +1 -1
  5. data/LICENSE.md +29 -17
  6. data/RDOC_MAIN.md +26 -22
  7. data/README.md +2 -2
  8. data/Rakefile +16 -6
  9. data/doc_templates/LICENSE.md +27 -17
  10. data/doc_templates/copyright_erb.txt +40 -30
  11. data/doc_templates/copyright_js.txt +1 -1
  12. data/doc_templates/copyright_ruby.txt +17 -7
  13. data/docs/.vuepress/components/InnerJsonSchema.vue +7 -11
  14. data/docs/.vuepress/config.js +11 -1
  15. data/docs/.vuepress/highlight.js +1 -1
  16. data/docs/.vuepress/json-schema-deref-loader.js +22 -0
  17. data/docs/README.md +3 -4
  18. data/docs/package-lock.json +5280 -6960
  19. data/docs/package.json +10 -8
  20. data/lib/measures/urban_geometry_creation/LICENSE.md +27 -17
  21. data/lib/measures/urban_geometry_creation/README.md +8 -0
  22. data/lib/measures/urban_geometry_creation/measure.rb +34 -9
  23. data/lib/measures/urban_geometry_creation/measure.xml +33 -14
  24. data/lib/measures/urban_geometry_creation_zoning/LICENSE.md +27 -17
  25. data/lib/measures/urban_geometry_creation_zoning/measure.rb +16 -8
  26. data/lib/measures/urban_geometry_creation_zoning/measure.xml +11 -11
  27. data/lib/urbanopt-geojson.rb +16 -6
  28. data/lib/urbanopt/geojson.rb +17 -6
  29. data/lib/urbanopt/geojson/building.rb +76 -15
  30. data/lib/urbanopt/geojson/derived_extension.rb +16 -6
  31. data/lib/urbanopt/geojson/district_system.rb +16 -6
  32. data/lib/urbanopt/geojson/feature.rb +102 -9
  33. data/lib/urbanopt/geojson/geo_file.rb +18 -8
  34. data/lib/urbanopt/geojson/helper.rb +52 -7
  35. data/lib/urbanopt/geojson/logging.rb +16 -6
  36. data/lib/urbanopt/geojson/mapper_classes.rb +16 -6
  37. data/lib/urbanopt/geojson/model.rb +1 -1
  38. data/lib/urbanopt/geojson/region.rb +1 -1
  39. data/lib/urbanopt/geojson/scale_area.rb +95 -0
  40. data/lib/urbanopt/geojson/schema/building_properties.json +57 -13
  41. data/lib/urbanopt/geojson/schema/electrical_connector_properties.json +24 -15
  42. data/lib/urbanopt/geojson/schema/thermal_connector_properties.json +1 -1
  43. data/lib/urbanopt/geojson/schema/thermal_junction_properties.json +1 -1
  44. data/lib/urbanopt/geojson/update_areas.rb +1 -1
  45. data/lib/urbanopt/geojson/validate_geojson.rb +1 -1
  46. data/lib/urbanopt/geojson/version.rb +2 -2
  47. data/lib/urbanopt/geojson/zoning.rb +21 -16
  48. data/urbanopt-geojson-gem.gemspec +4 -8
  49. metadata +12 -24
@@ -105,4 +105,4 @@
105
105
  ]
106
106
  }
107
107
  }
108
- }
108
+ }
@@ -80,4 +80,4 @@
80
80
  ]
81
81
  }
82
82
  }
83
- }
83
+ }
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt (tm), Copyright (c) 2019-2020, 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,
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt (tm), Copyright (c) 2019-2020, 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,
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt (tm), Copyright (c) 2019-2020, 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,
@@ -30,6 +30,6 @@
30
30
 
31
31
  module URBANopt
32
32
  module GeoJSON
33
- VERSION = '0.3.1'.freeze
33
+ VERSION = '0.5.3'.freeze
34
34
  end
35
35
  end
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt (tm), Copyright (c) 2019-2020, 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,
@@ -41,7 +41,8 @@ module URBANopt
41
41
  # * +floor_print+ - _Type:Array_ - An instance of +OpenStudio::Point3dVector.new+ .
42
42
  # * +perimeter_depth+ - _Type:Float_ - Represents perimeter depth.
43
43
  # * +runner+ - _Type:String_ - Measure run's instance of +OpenStudio::Measure::OSRunner+ .
44
- def self.divide_floor_print(floor_print, perimeter_depth, runner)
44
+ # * +scale+ - _Type:Boolean_ - Checks whether floor print is to be scaled. Default is false.
45
+ def self.divide_floor_print(floor_print, perimeter_depth, runner, scale = false)
45
46
  result = []
46
47
  t_inv = OpenStudio::Transformation.alignFace(floor_print)
47
48
  t = t_inv.inverse
@@ -86,21 +87,25 @@ module URBANopt
86
87
  if self_intersects
87
88
  runner.registerWarning('Self intersecting surface result, will not divide')
88
89
  end
89
- result << t_inv * new_vertices
90
- (0...n).each do |i|
91
- perim_vertices = OpenStudio::Point3dVector.new
92
- if i == (n - 1)
93
- perim_vertices << vertices[i]
94
- perim_vertices << vertices[0]
95
- perim_vertices << new_vertices[0]
96
- perim_vertices << new_vertices[i]
97
- else
98
- perim_vertices << vertices[i]
99
- perim_vertices << vertices[i + 1]
100
- perim_vertices << new_vertices[i + 1]
101
- perim_vertices << new_vertices[i]
90
+ if scale == true
91
+ result = t_inv * new_vertices
92
+ else
93
+ result << t_inv * new_vertices
94
+ (0...n).each do |i|
95
+ perim_vertices = OpenStudio::Point3dVector.new
96
+ if i == (n - 1)
97
+ perim_vertices << vertices[i]
98
+ perim_vertices << vertices[0]
99
+ perim_vertices << new_vertices[0]
100
+ perim_vertices << new_vertices[i]
101
+ else
102
+ perim_vertices << vertices[i]
103
+ perim_vertices << vertices[i + 1]
104
+ perim_vertices << new_vertices[i + 1]
105
+ perim_vertices << new_vertices[i]
106
+ end
107
+ result << t_inv * perim_vertices
102
108
  end
103
- result << t_inv * perim_vertices
104
109
  end
105
110
  return result
106
111
  end
@@ -9,9 +9,10 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ['Tanushree Charan', 'Nicholas Long', 'Dan Macumber']
10
10
  spec.email = ['tanushree.charan@nrel.gov', 'nicholas.long@nrel.gov', 'daniel.macumber@nrel.gov']
11
11
 
12
- spec.summary = 'Library and measures to translate URBANopt GeoJSON format to OpenStudio'
12
+ spec.summary = 'Translate URBANopt GeoJSON format to OpenStudio'
13
13
  spec.description = 'Library and measures to translate URBANopt GeoJSON format to OpenStudio'
14
14
  spec.homepage = 'https://github.com/urbanopt/urbanopt-geojson-gem'
15
+ spec.licenses = 'Nonstandard'
15
16
 
16
17
  # Specify which files should be added to the gem when it is released.
17
18
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -28,11 +29,6 @@ Gem::Specification.new do |spec|
28
29
  spec.add_development_dependency 'rake', '~> 13.0'
29
30
  spec.add_development_dependency 'rspec', '~> 3.7'
30
31
 
31
- # lock the version of these dependencies due to using older version of Ruby.
32
- # spec.add_dependency 'public_suffix', '3.1.1'
33
-
34
- # other dependencies
35
- spec.add_dependency 'json-schema'
36
- spec.add_dependency 'openstudio-extension', '~> 0.2.3'
37
- spec.add_dependency 'urbanopt-core', '~> 0.3.0'
32
+ spec.add_runtime_dependency 'json-schema', '~> 2.8'
33
+ spec.add_runtime_dependency 'urbanopt-core', '~> 0.5.1'
38
34
  end
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.3.1
4
+ version: 0.5.3
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-08-07 00:00:00.000000000 Z
13
+ date: 2021-04-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -56,46 +56,32 @@ dependencies:
56
56
  version: '3.7'
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: json-schema
59
- requirement: !ruby/object:Gem::Requirement
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: '0'
64
- type: :runtime
65
- prerelease: false
66
- version_requirements: !ruby/object:Gem::Requirement
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- version: '0'
71
- - !ruby/object:Gem::Dependency
72
- name: openstudio-extension
73
59
  requirement: !ruby/object:Gem::Requirement
74
60
  requirements:
75
61
  - - "~>"
76
62
  - !ruby/object:Gem::Version
77
- version: 0.2.3
63
+ version: '2.8'
78
64
  type: :runtime
79
65
  prerelease: false
80
66
  version_requirements: !ruby/object:Gem::Requirement
81
67
  requirements:
82
68
  - - "~>"
83
69
  - !ruby/object:Gem::Version
84
- version: 0.2.3
70
+ version: '2.8'
85
71
  - !ruby/object:Gem::Dependency
86
72
  name: urbanopt-core
87
73
  requirement: !ruby/object:Gem::Requirement
88
74
  requirements:
89
75
  - - "~>"
90
76
  - !ruby/object:Gem::Version
91
- version: 0.3.0
77
+ version: 0.5.1
92
78
  type: :runtime
93
79
  prerelease: false
94
80
  version_requirements: !ruby/object:Gem::Requirement
95
81
  requirements:
96
82
  - - "~>"
97
83
  - !ruby/object:Gem::Version
98
- version: 0.3.0
84
+ version: 0.5.1
99
85
  description: Library and measures to translate URBANopt GeoJSON format to OpenStudio
100
86
  email:
101
87
  - tanushree.charan@nrel.gov
@@ -141,6 +127,7 @@ files:
141
127
  - docs/.vuepress/components/ThermalJunctionProperties.vue
142
128
  - docs/.vuepress/config.js
143
129
  - docs/.vuepress/highlight.js
130
+ - docs/.vuepress/json-schema-deref-loader.js
144
131
  - docs/.vuepress/public/custom_rdoc_styles.css
145
132
  - docs/.vuepress/utils.js
146
133
  - docs/README.md
@@ -179,6 +166,7 @@ files:
179
166
  - lib/urbanopt/geojson/mapper_classes.rb
180
167
  - lib/urbanopt/geojson/model.rb
181
168
  - lib/urbanopt/geojson/region.rb
169
+ - lib/urbanopt/geojson/scale_area.rb
182
170
  - lib/urbanopt/geojson/schema/building_properties.json
183
171
  - lib/urbanopt/geojson/schema/district_system_properties.json
184
172
  - lib/urbanopt/geojson/schema/electrical_connector_properties.json
@@ -199,7 +187,8 @@ files:
199
187
  - package-lock.json
200
188
  - urbanopt-geojson-gem.gemspec
201
189
  homepage: https://github.com/urbanopt/urbanopt-geojson-gem
202
- licenses: []
190
+ licenses:
191
+ - Nonstandard
203
192
  metadata: {}
204
193
  post_install_message:
205
194
  rdoc_options: []
@@ -216,9 +205,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
205
  - !ruby/object:Gem::Version
217
206
  version: '0'
218
207
  requirements: []
219
- rubyforge_project:
220
- rubygems_version: 2.7.6
208
+ rubygems_version: 3.1.4
221
209
  signing_key:
222
210
  specification_version: 4
223
- summary: Library and measures to translate URBANopt GeoJSON format to OpenStudio
211
+ summary: Translate URBANopt GeoJSON format to OpenStudio
224
212
  test_files: []