urbanopt-geojson 0.5.1 → 0.6.2

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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +32 -0
  3. data/Gemfile +1 -1
  4. data/LICENSE.md +29 -17
  5. data/Rakefile +16 -6
  6. data/doc_templates/LICENSE.md +27 -17
  7. data/doc_templates/copyright_erb.txt +40 -30
  8. data/doc_templates/copyright_js.txt +1 -1
  9. data/doc_templates/copyright_ruby.txt +17 -7
  10. data/docs/package-lock.json +2520 -1581
  11. data/docs/package.json +8 -2
  12. data/lib/measures/urban_geometry_creation/LICENSE.md +27 -17
  13. data/lib/measures/urban_geometry_creation/measure.rb +16 -6
  14. data/lib/measures/urban_geometry_creation_zoning/LICENSE.md +27 -17
  15. data/lib/measures/urban_geometry_creation_zoning/measure.rb +16 -6
  16. data/lib/urbanopt-geojson.rb +16 -6
  17. data/lib/urbanopt/geojson.rb +16 -6
  18. data/lib/urbanopt/geojson/building.rb +16 -6
  19. data/lib/urbanopt/geojson/derived_extension.rb +16 -6
  20. data/lib/urbanopt/geojson/district_system.rb +16 -6
  21. data/lib/urbanopt/geojson/feature.rb +24 -11
  22. data/lib/urbanopt/geojson/geo_file.rb +16 -6
  23. data/lib/urbanopt/geojson/helper.rb +22 -9
  24. data/lib/urbanopt/geojson/logging.rb +16 -6
  25. data/lib/urbanopt/geojson/mapper_classes.rb +16 -6
  26. data/lib/urbanopt/geojson/model.rb +11 -1
  27. data/lib/urbanopt/geojson/region.rb +11 -1
  28. data/lib/urbanopt/geojson/scale_area.rb +11 -1
  29. data/lib/urbanopt/geojson/schema/building_properties.json +47 -6
  30. data/lib/urbanopt/geojson/schema/electrical_connector_properties.json +23 -14
  31. data/lib/urbanopt/geojson/schema/thermal_connector_properties.json +1 -1
  32. data/lib/urbanopt/geojson/schema/thermal_junction_properties.json +1 -1
  33. data/lib/urbanopt/geojson/update_areas.rb +11 -1
  34. data/lib/urbanopt/geojson/validate_geojson.rb +11 -1
  35. data/lib/urbanopt/geojson/version.rb +12 -2
  36. data/lib/urbanopt/geojson/zoning.rb +11 -1
  37. data/urbanopt-geojson-gem.gemspec +3 -3
  38. metadata +9 -9
data/docs/package.json CHANGED
@@ -13,13 +13,17 @@
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
28
  "lodash": ">=4.17.19",
25
29
  "lodash.template": ">=4.5.0",
@@ -27,6 +31,8 @@
27
31
  "mixin-deep": "^2.0.1",
28
32
  "serialize-javascript": "^5.0.1",
29
33
  "set-value": "^3.0.2",
30
- "yargs-parser": ">=18.1.1"
34
+ "ssri": "^8.0.1",
35
+ "webpack": "^4.46.0",
36
+ "yargs-parser": "^20.2.3"
31
37
  }
32
38
  }
@@ -1,27 +1,37 @@
1
- URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
1
+ URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
2
  contributors. All rights reserved.
3
3
 
4
- Redistribution and use in source and binary forms, with or without modification,
4
+ Redistribution and use in source and binary forms, with or without modification,
5
5
  are permitted provided that the following conditions are met:
6
6
 
7
- Redistributions of source code must retain the above copyright notice, this list
7
+ Redistributions of source code must retain the above copyright notice, this list
8
8
  of conditions and the following disclaimer.
9
9
 
10
- Redistributions in binary form must reproduce the above copyright notice, this
11
- list of conditions and the following disclaimer in the documentation and/or other
10
+ Redistributions in binary form must reproduce the above copyright notice, this
11
+ list of conditions and the following disclaimer in the documentation and/or other
12
12
  materials provided with the distribution.
13
-
14
- Neither the name of the copyright holder nor the names of its contributors may be
15
- used to endorse or promote products derived from this software without specific
13
+
14
+ Neither the name of the copyright holder nor the names of its contributors may be
15
+ used to endorse or promote products derived from this software without specific
16
16
  prior written permission.
17
17
 
18
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21
- IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23
- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26
- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
18
+ Redistribution of this software, without modification, must refer to the software
19
+ by the same designation. Redistribution of a modified version of this software
20
+ (i) may not refer to the modified version by the same designation, or by any
21
+ confusingly similar designation, and (ii) must refer to the underlying software
22
+ originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
23
+ the term “URBANopt”, or any confusingly similar designation may not be used to
24
+ refer to any modified version of this software or any modified version of the
25
+ underlying software originally provided by Alliance without the prior written
26
+ consent of Alliance.
27
+
28
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
29
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
30
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
31
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
32
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
33
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
35
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
36
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
27
37
  OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,23 +1,33 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # *********************************************************************************
4
- # URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
4
+ # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
5
5
  # contributors. All rights reserved.
6
- #
6
+
7
7
  # Redistribution and use in source and binary forms, with or without modification,
8
8
  # are permitted provided that the following conditions are met:
9
- #
9
+
10
10
  # Redistributions of source code must retain the above copyright notice, this list
11
11
  # of conditions and the following disclaimer.
12
- #
12
+
13
13
  # Redistributions in binary form must reproduce the above copyright notice, this
14
14
  # list of conditions and the following disclaimer in the documentation and/or other
15
15
  # materials provided with the distribution.
16
- #
16
+
17
17
  # Neither the name of the copyright holder nor the names of its contributors may be
18
18
  # used to endorse or promote products derived from this software without specific
19
19
  # prior written permission.
20
- #
20
+
21
+ # Redistribution of this software, without modification, must refer to the software
22
+ # by the same designation. Redistribution of a modified version of this software
23
+ # (i) may not refer to the modified version by the same designation, or by any
24
+ # confusingly similar designation, and (ii) must refer to the underlying software
25
+ # originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
26
+ # the term “URBANopt”, or any confusingly similar designation may not be used to
27
+ # refer to any modified version of this software or any modified version of the
28
+ # underlying software originally provided by Alliance without the prior written
29
+ # consent of Alliance.
30
+
21
31
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22
32
  # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23
33
  # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@@ -1,27 +1,37 @@
1
- URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
1
+ URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
2
  contributors. All rights reserved.
3
3
 
4
- Redistribution and use in source and binary forms, with or without modification,
4
+ Redistribution and use in source and binary forms, with or without modification,
5
5
  are permitted provided that the following conditions are met:
6
6
 
7
- Redistributions of source code must retain the above copyright notice, this list
7
+ Redistributions of source code must retain the above copyright notice, this list
8
8
  of conditions and the following disclaimer.
9
9
 
10
- Redistributions in binary form must reproduce the above copyright notice, this
11
- list of conditions and the following disclaimer in the documentation and/or other
10
+ Redistributions in binary form must reproduce the above copyright notice, this
11
+ list of conditions and the following disclaimer in the documentation and/or other
12
12
  materials provided with the distribution.
13
-
14
- Neither the name of the copyright holder nor the names of its contributors may be
15
- used to endorse or promote products derived from this software without specific
13
+
14
+ Neither the name of the copyright holder nor the names of its contributors may be
15
+ used to endorse or promote products derived from this software without specific
16
16
  prior written permission.
17
17
 
18
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21
- IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23
- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26
- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
18
+ Redistribution of this software, without modification, must refer to the software
19
+ by the same designation. Redistribution of a modified version of this software
20
+ (i) may not refer to the modified version by the same designation, or by any
21
+ confusingly similar designation, and (ii) must refer to the underlying software
22
+ originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
23
+ the term “URBANopt”, or any confusingly similar designation may not be used to
24
+ refer to any modified version of this software or any modified version of the
25
+ underlying software originally provided by Alliance without the prior written
26
+ consent of Alliance.
27
+
28
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
29
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
30
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
31
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
32
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
33
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
35
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
36
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
27
37
  OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,23 +1,33 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # *********************************************************************************
4
- # URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
4
+ # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
5
5
  # contributors. All rights reserved.
6
- #
6
+
7
7
  # Redistribution and use in source and binary forms, with or without modification,
8
8
  # are permitted provided that the following conditions are met:
9
- #
9
+
10
10
  # Redistributions of source code must retain the above copyright notice, this list
11
11
  # of conditions and the following disclaimer.
12
- #
12
+
13
13
  # Redistributions in binary form must reproduce the above copyright notice, this
14
14
  # list of conditions and the following disclaimer in the documentation and/or other
15
15
  # materials provided with the distribution.
16
- #
16
+
17
17
  # Neither the name of the copyright holder nor the names of its contributors may be
18
18
  # used to endorse or promote products derived from this software without specific
19
19
  # prior written permission.
20
- #
20
+
21
+ # Redistribution of this software, without modification, must refer to the software
22
+ # by the same designation. Redistribution of a modified version of this software
23
+ # (i) may not refer to the modified version by the same designation, or by any
24
+ # confusingly similar designation, and (ii) must refer to the underlying software
25
+ # originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
26
+ # the term “URBANopt”, or any confusingly similar designation may not be used to
27
+ # refer to any modified version of this software or any modified version of the
28
+ # underlying software originally provided by Alliance without the prior written
29
+ # consent of Alliance.
30
+
21
31
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22
32
  # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23
33
  # 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.
@@ -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.
@@ -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.
@@ -251,10 +261,12 @@ module URBANopt
251
261
  end
252
262
 
253
263
  ##
254
- # Used to determine the centroid for the feature's coordinates.
264
+ # Used to determine the centroid for the feature's geojson coordinates.
255
265
  #
256
266
  # [Parameters]
257
267
  # * +vertices+ - The first set polygon vertices in the array of feature coordinates.
268
+ # [Returns]
269
+ # Returns Feature centroid coordinates [long, lat]
258
270
  def find_feature_center(vertices)
259
271
  number_of_locations = vertices.length
260
272
 
@@ -262,8 +274,8 @@ module URBANopt
262
274
 
263
275
  x = y = z = 0.0
264
276
  vertices.each do |station|
265
- latitude = station[0] * Math::PI / 180
266
- longitude = station[1] * Math::PI / 180
277
+ latitude = station[1] * Math::PI / 180
278
+ longitude = station[0] * Math::PI / 180
267
279
 
268
280
  x += Math.cos(latitude) * Math.cos(longitude)
269
281
  y += Math.cos(latitude) * Math.sin(longitude)
@@ -278,8 +290,9 @@ module URBANopt
278
290
  central_square_root = Math.sqrt(x * x + y * y)
279
291
  central_latitude = Math.atan2(z, central_square_root)
280
292
 
281
- [central_latitude * 180 / Math::PI,
282
- central_longitude * 180 / Math::PI]
293
+ [central_longitude * 180 / Math::PI,
294
+ central_latitude * 180 / Math::PI]
295
+
283
296
  end
284
297
 
285
298
  private