urbanopt-geojson 0.2.0.pre2 → 0.2.0.pre3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/urbanopt/geojson/geo_file.rb +24 -23
- data/lib/urbanopt/geojson/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10a192e307d2e97310601a894c2eac28caba1061
|
4
|
+
data.tar.gz: 09a0ec17fbc7a1a5ee6101094dc6be6749d4fcee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9064d122b7786d2e3b0549f4d44015267dbbbde25935c13f5397a9b82758134df8b88659fd565ae45d9340bdf7ce473f055f7a3ed30bfc902f4677df4012b633
|
7
|
+
data.tar.gz: 7c4f7ffe616d5f33f22769ac9f8981db669e7b74afeb9d58a06fbd34bda8a5d47e3250c10a660a2c49e0a1ceceb04a01f8db34e8bd5cd5972a1ba1c922699bf8
|
@@ -178,33 +178,34 @@ module URBANopt
|
|
178
178
|
# [Parameters]
|
179
179
|
# +feature+ - _Type:Hash_ - feature object.
|
180
180
|
def merge_site_properties(feature)
|
181
|
-
|
182
|
-
if
|
183
|
-
|
184
|
-
|
185
|
-
# this maps site properties to building/district system properties.
|
186
|
-
add_props = [
|
187
|
-
{site: :surface_elevation, feature: :surface_elevation},
|
188
|
-
{site: :timesteps_per_hour, feature: :timesteps_per_hour},
|
189
|
-
{site: :begin_date, feature: :begin_date},
|
190
|
-
{site: :end_date, feature: :end_date},
|
191
|
-
{site: :cec_climate_zone, feature: :cec_climate_zone},
|
192
|
-
{site: :climate_zone, feature: :climate_zone},
|
193
|
-
{site: :default_template, feature: :template},
|
194
|
-
{site: :weather_filename, feature: :weather_filename},
|
195
|
-
{site: :tariff_filename, feature: :tariff_filename}
|
196
|
-
]
|
181
|
+
project = {}
|
182
|
+
if @geojson_file.key?(:project)
|
183
|
+
project = @geojson_file[:project]
|
184
|
+
end
|
197
185
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
186
|
+
# this maps site properties to building/district system properties.
|
187
|
+
add_props = [
|
188
|
+
{site: :surface_elevation, feature: :surface_elevation},
|
189
|
+
{site: :timesteps_per_hour, feature: :timesteps_per_hour},
|
190
|
+
{site: :begin_date, feature: :begin_date},
|
191
|
+
{site: :end_date, feature: :end_date},
|
192
|
+
{site: :cec_climate_zone, feature: :cec_climate_zone},
|
193
|
+
{site: :climate_zone, feature: :climate_zone},
|
194
|
+
{site: :default_template, feature: :template},
|
195
|
+
{site: :weather_filename, feature: :weather_filename},
|
196
|
+
{site: :tariff_filename, feature: :tariff_filename}
|
197
|
+
]
|
198
|
+
|
199
|
+
add_props.each do |prop|
|
200
|
+
if project.key?(prop[:site]) and project[prop[:site]]
|
201
|
+
# property exists in site
|
202
|
+
if !feature[:properties].key?(prop[:feature]) or feature[:properties][prop[:feature]].nil? or feature[:properties][prop[:feature]].empty?
|
203
|
+
# property does not exist in feature or is nil: add site property (don't overwrite)
|
204
|
+
feature[:properties][prop[:feature]] = project[prop[:site]]
|
205
205
|
end
|
206
206
|
end
|
207
207
|
end
|
208
|
+
|
208
209
|
return feature
|
209
210
|
end
|
210
211
|
|
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.pre3
|
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-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|