Add the building/city_objects hierarchy to the city

This commit is contained in:
Guille Gutierrez 2020-06-16 16:19:14 -04:00
parent 5bbfa23c48
commit 523c96216a
13 changed files with 91 additions and 67 deletions

View File

@ -10,8 +10,8 @@ class BixiFeature(CityObject):
""" """
BixiFeature(CityObject) class BixiFeature(CityObject) class
""" """
def __init__(self, lod, surfaces, feature_type, length): def __init__(self, lod, surfaces, name, feature_type, length):
super().__init__(lod, surfaces) super().__init__(lod, surfaces, name)
self._feature_type = feature_type self._feature_type = feature_type
self._length = length self._length = length

View File

@ -3,8 +3,7 @@ Building module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
""" """
from pathlib import Path from typing import List
from typing import Union, List
import matplotlib.patches as patches import matplotlib.patches as patches
import numpy as np import numpy as np
@ -25,8 +24,7 @@ class Building(CityObject):
""" """
def __init__(self, name, lod, surfaces, terrains, year_of_construction, function, lower_corner, attic_heated=0, def __init__(self, name, lod, surfaces, terrains, year_of_construction, function, lower_corner, attic_heated=0,
basement_heated=0): basement_heated=0):
super().__init__(lod, surfaces) super().__init__(lod, surfaces, name)
self._name = name
self._basement_heated = basement_heated self._basement_heated = basement_heated
self._attic_heated = attic_heated self._attic_heated = attic_heated
self._terrains = terrains self._terrains = terrains
@ -137,22 +135,8 @@ class Building(CityObject):
City object heated volume in cubic meters City object heated volume in cubic meters
:return: float :return: float
""" """
if self._polyhedron is None:
self._polyhedron = Polyhedron(self.surfaces)
# ToDo: this need to be the calculated based on the basement and attic heated values # ToDo: this need to be the calculated based on the basement and attic heated values
return self._polyhedron.volume return self.volume
def stl_export(self, path):
"""
Export the city object to stl file (city_object_name.stl) to the given path
:param path: str
:return: None
"""
# todo: this is a method just for debugging, it will be soon removed
if self._polyhedron is None:
self._polyhedron = Polyhedron(self.surfaces)
full_path = (Path(path) / (self._name + '.stl')).resolve()
self._polyhedron.export(full_path)
@property @property
def year_of_construction(self): def year_of_construction(self):
@ -266,13 +250,3 @@ class Building(CityObject):
:return: str :return: str
""" """
return self._type return self._type
@property
def max_height(self):
"""
City object maximal height in meters
:return: float
"""
if self._polyhedron is None:
self._polyhedron = Polyhedron(self.surfaces)
return self._polyhedron.max_z

View File

@ -3,6 +3,7 @@ CityObject module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
""" """
from pathlib import Path
from typing import List, Union from typing import List, Union
from city_model_structure.surface import Surface from city_model_structure.surface import Surface
from helpers.geometry_helper import GeometryHelper from helpers.geometry_helper import GeometryHelper
@ -13,7 +14,8 @@ class CityObject:
""" """
class CityObject class CityObject
""" """
def __init__(self, lod, surfaces): def __init__(self, lod, surfaces, name):
self._name = name
self._lod = lod self._lod = lod
self._surfaces = surfaces self._surfaces = surfaces
self._polyhedron = None self._polyhedron = None
@ -65,3 +67,25 @@ class CityObject:
if self._polyhedron is None: if self._polyhedron is None:
self._polyhedron = Polyhedron(self.surfaces) self._polyhedron = Polyhedron(self.surfaces)
return self._polyhedron.centroid return self._polyhedron.centroid
def stl_export(self, path):
"""
Export the city object to stl file (city_object_name.stl) to the given path
:param path: str
:return: None
"""
# todo: this is a method just for debugging, it will be soon removed
if self._polyhedron is None:
self._polyhedron = Polyhedron(self.surfaces)
full_path = (Path(path) / (self._name + '.stl')).resolve()
self._polyhedron.export(full_path)
@property
def max_height(self):
"""
City object maximal height in meters
:return: float
"""
if self._polyhedron is None:
self._polyhedron = Polyhedron(self.surfaces)
return self._polyhedron.max_z

View File

@ -10,8 +10,8 @@ class CompostingPlant(CityObject):
""" """
CompostingPlant(CityObject) class CompostingPlant(CityObject) class
""" """
def __init__(self, lod, surfaces, waste_type, capacity): def __init__(self, lod, surfaces, name, waste_type, capacity):
super().__init__(lod, surfaces) super().__init__(lod, surfaces, name)
self._waste_type = waste_type self._waste_type = waste_type
self._capacity = capacity self._capacity = capacity

View File

@ -10,8 +10,8 @@ class Tree(CityObject):
""" """
Tree(CityObject) class Tree(CityObject) class
""" """
def __init__(self, lod, surfaces, height, canopy): def __init__(self, lod, surfaces, name, height, canopy):
super().__init__(lod, surfaces) super().__init__(lod, surfaces, name)
self._height = height self._height = height
self._canopy = canopy self._canopy = canopy

Binary file not shown.

Binary file not shown.

View File

@ -197,6 +197,14 @@
<span class="n">z_max</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">bounds</span><span class="p">[:,</span> <span class="mi">2</span><span class="p">])</span> <span class="n">z_max</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">bounds</span><span class="p">[:,</span> <span class="mi">2</span><span class="p">])</span>
<span class="k">return</span> <span class="n">z_max</span> <span class="k">return</span> <span class="n">z_max</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">centroid</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Polyhedron centroid</span>
<span class="sd"> :return: [x,y,z]</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_polyhedron_mesh</span><span class="o">.</span><span class="n">centroid</span>
<div class="viewcode-block" id="Polyhedron.export"><a class="viewcode-back" href="../../index.html#city_model_structure.polyhedron.Polyhedron.export">[docs]</a> <span class="k">def</span> <span class="nf">export</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">full_path</span><span class="p">):</span> <div class="viewcode-block" id="Polyhedron.export"><a class="viewcode-back" href="../../index.html#city_model_structure.polyhedron.Polyhedron.export">[docs]</a> <span class="k">def</span> <span class="nf">export</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">full_path</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span> <span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Export the polyhedron to stl given file</span> <span class="sd"> Export the polyhedron to stl given file</span>

View File

@ -195,6 +195,8 @@
<li><a href="index.html#city_model_structure.tree.Tree.canopy">canopy() (city_model_structure.tree.Tree property)</a> <li><a href="index.html#city_model_structure.tree.Tree.canopy">canopy() (city_model_structure.tree.Tree property)</a>
</li> </li>
<li><a href="index.html#city_model_structure.composting_plant.CompostingPlant.capacity">capacity() (city_model_structure.composting_plant.CompostingPlant property)</a> <li><a href="index.html#city_model_structure.composting_plant.CompostingPlant.capacity">capacity() (city_model_structure.composting_plant.CompostingPlant property)</a>
</li>
<li><a href="index.html#city_model_structure.polyhedron.Polyhedron.centroid">centroid() (city_model_structure.polyhedron.Polyhedron property)</a>
</li> </li>
<li><a href="index.html#city_model_structure.city.City">City (class in city_model_structure.city)</a> <li><a href="index.html#city_model_structure.city.City">City (class in city_model_structure.city)</a>
</li> </li>
@ -473,6 +475,8 @@
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#city_model_structure.bixi_feature.BixiFeature.length">length() (city_model_structure.bixi_feature.BixiFeature property)</a> <li><a href="index.html#city_model_structure.bixi_feature.BixiFeature.length">length() (city_model_structure.bixi_feature.BixiFeature property)</a>
</li>
<li><a href="index.html#city_model_structure.city_object.CityObject.location">location() (city_model_structure.city_object.CityObject property)</a>
</li> </li>
<li><a href="index.html#city_model_structure.city_object.CityObject.lod">lod() (city_model_structure.city_object.CityObject property)</a> <li><a href="index.html#city_model_structure.city_object.CityObject.lod">lod() (city_model_structure.city_object.CityObject property)</a>
</li> </li>
@ -642,9 +646,9 @@
</li> </li>
<li><a href="index.html#city_model_structure.surface.Surface">Surface (class in city_model_structure.surface)</a> <li><a href="index.html#city_model_structure.surface.Surface">Surface (class in city_model_structure.surface)</a>
</li> </li>
<li><a href="index.html#city_model_structure.building.Building.surface">surface() (city_model_structure.building.Building method)</a> <li><a href="index.html#city_model_structure.city_object.CityObject.surface">surface() (city_model_structure.city_object.CityObject method)</a>
</li> </li>
<li><a href="index.html#city_model_structure.building.Building.surfaces">surfaces() (city_model_structure.building.Building property)</a> <li><a href="index.html#city_model_structure.city_object.CityObject.surfaces">surfaces() (city_model_structure.city_object.CityObject property)</a>
<ul> <ul>
<li><a href="index.html#city_model_structure.thermal_zone.ThermalZone.surfaces">(city_model_structure.thermal_zone.ThermalZone property)</a> <li><a href="index.html#city_model_structure.thermal_zone.ThermalZone.surfaces">(city_model_structure.thermal_zone.ThermalZone property)</a>
@ -737,7 +741,7 @@
</li> </li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#city_model_structure.building.Building.volume">volume() (city_model_structure.building.Building property)</a> <li><a href="index.html#city_model_structure.city_object.CityObject.volume">volume() (city_model_structure.city_object.CityObject property)</a>
<ul> <ul>
<li><a href="index.html#city_model_structure.polyhedron.Polyhedron.volume">(city_model_structure.polyhedron.Polyhedron property)</a> <li><a href="index.html#city_model_structure.polyhedron.Polyhedron.volume">(city_model_structure.polyhedron.Polyhedron property)</a>

View File

@ -215,8 +215,15 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez <a class="reference external" href="mailto:guillermo&#46;gutierrezmorote&#37;&#52;&#48;concordia&#46;ca">guillermo<span>&#46;</span>gutierrezmorote<span>&#64;</span>concordia<span>&#46;</span>ca</a></p> Copyright © 2020 Project Author Guille Gutierrez <a class="reference external" href="mailto:guillermo&#46;gutierrezmorote&#37;&#52;&#48;concordia&#46;ca">guillermo<span>&#46;</span>gutierrezmorote<span>&#64;</span>concordia<span>&#46;</span>ca</a></p>
<dl class="py class"> <dl class="py class">
<dt id="city_model_structure.city_object.CityObject"> <dt id="city_model_structure.city_object.CityObject">
<em class="property">class </em><code class="sig-prename descclassname">city_model_structure.city_object.</code><code class="sig-name descname">CityObject</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">lod</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/city_model_structure/city_object.html#CityObject"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#city_model_structure.city_object.CityObject" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="sig-prename descclassname">city_model_structure.city_object.</code><code class="sig-name descname">CityObject</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">lod</span></em>, <em class="sig-param"><span class="n">surfaces</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/city_model_structure/city_object.html#CityObject"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#city_model_structure.city_object.CityObject" title="Permalink to this definition"></a></dt>
<dd><p>class CityObject</p> <dd><p>class CityObject</p>
<dl class="py method">
<dt id="city_model_structure.city_object.CityObject.location">
<em class="property">property </em><code class="sig-name descname">location</code><a class="headerlink" href="#city_model_structure.city_object.CityObject.location" title="Permalink to this definition"></a></dt>
<dd><p>City object location
:return: [x,y,z]</p>
</dd></dl>
<dl class="py method"> <dl class="py method">
<dt id="city_model_structure.city_object.CityObject.lod"> <dt id="city_model_structure.city_object.CityObject.lod">
<em class="property">property </em><code class="sig-name descname">lod</code><a class="headerlink" href="#city_model_structure.city_object.CityObject.lod" title="Permalink to this definition"></a></dt> <em class="property">property </em><code class="sig-name descname">lod</code><a class="headerlink" href="#city_model_structure.city_object.CityObject.lod" title="Permalink to this definition"></a></dt>
@ -224,6 +231,28 @@ Copyright © 2020 Project Author Guille Gutierrez <a class="reference external"
:return: int</p> :return: int</p>
</dd></dl> </dd></dl>
<dl class="py method">
<dt id="city_model_structure.city_object.CityObject.surface">
<code class="sig-name descname">surface</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">name</span></em><span class="sig-paren">)</span> &#x2192; Optional<span class="p">[</span><a class="reference internal" href="#city_model_structure.surface.Surface" title="city_model_structure.surface.Surface">city_model_structure.surface.Surface</a><span class="p">]</span><a class="reference internal" href="_modules/city_model_structure/city_object.html#CityObject.surface"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#city_model_structure.city_object.CityObject.surface" title="Permalink to this definition"></a></dt>
<dd><p>Get the city object surface with a given name
:param name: str
:return: None or Surface</p>
</dd></dl>
<dl class="py method">
<dt id="city_model_structure.city_object.CityObject.surfaces">
<em class="property">property </em><code class="sig-name descname">surfaces</code><a class="headerlink" href="#city_model_structure.city_object.CityObject.surfaces" title="Permalink to this definition"></a></dt>
<dd><p>City object surfaces
:return: [Surface]</p>
</dd></dl>
<dl class="py method">
<dt id="city_model_structure.city_object.CityObject.volume">
<em class="property">property </em><code class="sig-name descname">volume</code><a class="headerlink" href="#city_model_structure.city_object.CityObject.volume" title="Permalink to this definition"></a></dt>
<dd><p>City object volume in cubic meters
:return: float</p>
</dd></dl>
</dd></dl> </dd></dl>
</div> </div>
@ -234,7 +263,7 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez <a class="reference external" href="mailto:guillermo&#46;gutierrezmorote&#37;&#52;&#48;concordia&#46;ca">guillermo<span>&#46;</span>gutierrezmorote<span>&#64;</span>concordia<span>&#46;</span>ca</a></p> Copyright © 2020 Project Author Guille Gutierrez <a class="reference external" href="mailto:guillermo&#46;gutierrezmorote&#37;&#52;&#48;concordia&#46;ca">guillermo<span>&#46;</span>gutierrezmorote<span>&#64;</span>concordia<span>&#46;</span>ca</a></p>
<dl class="py class"> <dl class="py class">
<dt id="city_model_structure.bixi_feature.BixiFeature"> <dt id="city_model_structure.bixi_feature.BixiFeature">
<em class="property">class </em><code class="sig-prename descclassname">city_model_structure.bixi_feature.</code><code class="sig-name descname">BixiFeature</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">lod</span></em>, <em class="sig-param"><span class="n">feature_type</span></em>, <em class="sig-param"><span class="n">length</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/city_model_structure/bixi_feature.html#BixiFeature"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#city_model_structure.bixi_feature.BixiFeature" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="sig-prename descclassname">city_model_structure.bixi_feature.</code><code class="sig-name descname">BixiFeature</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">lod</span></em>, <em class="sig-param"><span class="n">surfaces</span></em>, <em class="sig-param"><span class="n">feature_type</span></em>, <em class="sig-param"><span class="n">length</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/city_model_structure/bixi_feature.html#BixiFeature"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#city_model_structure.bixi_feature.BixiFeature" title="Permalink to this definition"></a></dt>
<dd><p>BixiFeature(CityObject) class</p> <dd><p>BixiFeature(CityObject) class</p>
<dl class="py method"> <dl class="py method">
<dt id="city_model_structure.bixi_feature.BixiFeature.feature_type"> <dt id="city_model_structure.bixi_feature.BixiFeature.feature_type">
@ -333,21 +362,6 @@ Copyright © 2020 Project Author Guille Gutierrez <a class="reference external"
:return: int</p> :return: int</p>
</dd></dl> </dd></dl>
<dl class="py method">
<dt id="city_model_structure.building.Building.surface">
<code class="sig-name descname">surface</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">name</span></em><span class="sig-paren">)</span> &#x2192; Optional<span class="p">[</span><a class="reference internal" href="#city_model_structure.surface.Surface" title="city_model_structure.surface.Surface">city_model_structure.surface.Surface</a><span class="p">]</span><a class="reference internal" href="_modules/city_model_structure/building.html#Building.surface"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#city_model_structure.building.Building.surface" title="Permalink to this definition"></a></dt>
<dd><p>Get the city object surface with a given name
:param name: str
:return: None or Surface</p>
</dd></dl>
<dl class="py method">
<dt id="city_model_structure.building.Building.surfaces">
<em class="property">property </em><code class="sig-name descname">surfaces</code><a class="headerlink" href="#city_model_structure.building.Building.surfaces" title="Permalink to this definition"></a></dt>
<dd><p>City object surfaces
:return: [Surface]</p>
</dd></dl>
<dl class="py method"> <dl class="py method">
<dt id="city_model_structure.building.Building.terrains"> <dt id="city_model_structure.building.Building.terrains">
<em class="property">property </em><code class="sig-name descname">terrains</code><a class="headerlink" href="#city_model_structure.building.Building.terrains" title="Permalink to this definition"></a></dt> <em class="property">property </em><code class="sig-name descname">terrains</code><a class="headerlink" href="#city_model_structure.building.Building.terrains" title="Permalink to this definition"></a></dt>
@ -376,13 +390,6 @@ Copyright © 2020 Project Author Guille Gutierrez <a class="reference external"
:return: [UsageZone]</p> :return: [UsageZone]</p>
</dd></dl> </dd></dl>
<dl class="py method">
<dt id="city_model_structure.building.Building.volume">
<em class="property">property </em><code class="sig-name descname">volume</code><a class="headerlink" href="#city_model_structure.building.Building.volume" title="Permalink to this definition"></a></dt>
<dd><p>City object volume in cubic meters
:return: float</p>
</dd></dl>
<dl class="py method"> <dl class="py method">
<dt id="city_model_structure.building.Building.year_of_construction"> <dt id="city_model_structure.building.Building.year_of_construction">
<em class="property">property </em><code class="sig-name descname">year_of_construction</code><a class="headerlink" href="#city_model_structure.building.Building.year_of_construction" title="Permalink to this definition"></a></dt> <em class="property">property </em><code class="sig-name descname">year_of_construction</code><a class="headerlink" href="#city_model_structure.building.Building.year_of_construction" title="Permalink to this definition"></a></dt>
@ -400,7 +407,7 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez <a class="reference external" href="mailto:guillermo&#46;gutierrezmorote&#37;&#52;&#48;concordia&#46;ca">guillermo<span>&#46;</span>gutierrezmorote<span>&#64;</span>concordia<span>&#46;</span>ca</a></p> Copyright © 2020 Project Author Guille Gutierrez <a class="reference external" href="mailto:guillermo&#46;gutierrezmorote&#37;&#52;&#48;concordia&#46;ca">guillermo<span>&#46;</span>gutierrezmorote<span>&#64;</span>concordia<span>&#46;</span>ca</a></p>
<dl class="py class"> <dl class="py class">
<dt id="city_model_structure.composting_plant.CompostingPlant"> <dt id="city_model_structure.composting_plant.CompostingPlant">
<em class="property">class </em><code class="sig-prename descclassname">city_model_structure.composting_plant.</code><code class="sig-name descname">CompostingPlant</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">lod</span></em>, <em class="sig-param"><span class="n">waste_type</span></em>, <em class="sig-param"><span class="n">capacity</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/city_model_structure/composting_plant.html#CompostingPlant"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#city_model_structure.composting_plant.CompostingPlant" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="sig-prename descclassname">city_model_structure.composting_plant.</code><code class="sig-name descname">CompostingPlant</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">lod</span></em>, <em class="sig-param"><span class="n">surfaces</span></em>, <em class="sig-param"><span class="n">waste_type</span></em>, <em class="sig-param"><span class="n">capacity</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/city_model_structure/composting_plant.html#CompostingPlant"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#city_model_structure.composting_plant.CompostingPlant" title="Permalink to this definition"></a></dt>
<dd><p>CompostingPlant(CityObject) class</p> <dd><p>CompostingPlant(CityObject) class</p>
<dl class="py method"> <dl class="py method">
<dt id="city_model_structure.composting_plant.CompostingPlant.capacity"> <dt id="city_model_structure.composting_plant.CompostingPlant.capacity">
@ -426,7 +433,7 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez <a class="reference external" href="mailto:guillermo&#46;gutierrezmorote&#37;&#52;&#48;concordia&#46;ca">guillermo<span>&#46;</span>gutierrezmorote<span>&#64;</span>concordia<span>&#46;</span>ca</a></p> Copyright © 2020 Project Author Guille Gutierrez <a class="reference external" href="mailto:guillermo&#46;gutierrezmorote&#37;&#52;&#48;concordia&#46;ca">guillermo<span>&#46;</span>gutierrezmorote<span>&#64;</span>concordia<span>&#46;</span>ca</a></p>
<dl class="py class"> <dl class="py class">
<dt id="city_model_structure.tree.Tree"> <dt id="city_model_structure.tree.Tree">
<em class="property">class </em><code class="sig-prename descclassname">city_model_structure.tree.</code><code class="sig-name descname">Tree</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">lod</span></em>, <em class="sig-param"><span class="n">height</span></em>, <em class="sig-param"><span class="n">canopy</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/city_model_structure/tree.html#Tree"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#city_model_structure.tree.Tree" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="sig-prename descclassname">city_model_structure.tree.</code><code class="sig-name descname">Tree</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">lod</span></em>, <em class="sig-param"><span class="n">surfaces</span></em>, <em class="sig-param"><span class="n">height</span></em>, <em class="sig-param"><span class="n">canopy</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/city_model_structure/tree.html#Tree"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#city_model_structure.tree.Tree" title="Permalink to this definition"></a></dt>
<dd><p>Tree(CityObject) class</p> <dd><p>Tree(CityObject) class</p>
<dl class="py method"> <dl class="py method">
<dt id="city_model_structure.tree.Tree.canopy"> <dt id="city_model_structure.tree.Tree.canopy">
@ -588,6 +595,13 @@ Copyright © 2020 Project Author Guille Gutierrez <a class="reference external"
<dt id="city_model_structure.polyhedron.Polyhedron"> <dt id="city_model_structure.polyhedron.Polyhedron">
<em class="property">class </em><code class="sig-prename descclassname">city_model_structure.polyhedron.</code><code class="sig-name descname">Polyhedron</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">surfaces</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/city_model_structure/polyhedron.html#Polyhedron"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#city_model_structure.polyhedron.Polyhedron" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="sig-prename descclassname">city_model_structure.polyhedron.</code><code class="sig-name descname">Polyhedron</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">surfaces</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/city_model_structure/polyhedron.html#Polyhedron"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#city_model_structure.polyhedron.Polyhedron" title="Permalink to this definition"></a></dt>
<dd><p>Polyhedron class</p> <dd><p>Polyhedron class</p>
<dl class="py method">
<dt id="city_model_structure.polyhedron.Polyhedron.centroid">
<em class="property">property </em><code class="sig-name descname">centroid</code><a class="headerlink" href="#city_model_structure.polyhedron.Polyhedron.centroid" title="Permalink to this definition"></a></dt>
<dd><p>Polyhedron centroid
:return: [x,y,z]</p>
</dd></dl>
<dl class="py method"> <dl class="py method">
<dt id="city_model_structure.polyhedron.Polyhedron.export"> <dt id="city_model_structure.polyhedron.Polyhedron.export">
<code class="sig-name descname">export</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">full_path</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/city_model_structure/polyhedron.html#Polyhedron.export"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#city_model_structure.polyhedron.Polyhedron.export" title="Permalink to this definition"></a></dt> <code class="sig-name descname">export</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">full_path</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/city_model_structure/polyhedron.html#Polyhedron.export"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#city_model_structure.polyhedron.Polyhedron.export" title="Permalink to this definition"></a></dt>

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -32,7 +32,7 @@ class CityGml:
'xmlns="http://www.opengis.net/citygml/2.0': None, 'xmlns="http://www.opengis.net/citygml/2.0': None,
'http://www.opengis.net/citygml/2.0': None 'http://www.opengis.net/citygml/2.0': None
}, force_list=('cityObjectMember', 'curveMember')) }, force_list=('cityObjectMember', 'curveMember'))
self._cityObjects = None self._city_objects = None
self._geometry = GeometryHelper() self._geometry = GeometryHelper()
envelope = self._gml['CityModel']['boundedBy']['Envelope'] envelope = self._gml['CityModel']['boundedBy']['Envelope']
if '#text' in envelope['lowerCorner']: if '#text' in envelope['lowerCorner']: