partial geojson implementation
This commit is contained in:
parent
13fa69b438
commit
991e3df240
|
@ -4,7 +4,7 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Guillermo Gutierrez Guillermo.GutierrezMorote@concordia.ca
|
||||
"""
|
||||
|
||||
import geopandas
|
||||
import trimesh
|
||||
import trimesh.exchange.load
|
||||
import trimesh.geometry
|
||||
|
@ -24,27 +24,16 @@ import helpers.constants as cte
|
|||
|
||||
class Geojson:
|
||||
"""
|
||||
GeoPandas class
|
||||
Geojson class
|
||||
"""
|
||||
|
||||
def __init__(self, path):
|
||||
"""
|
||||
"""
|
||||
|
||||
self._srs_name = srs_name
|
||||
def __init__(self, path, extrusion_height=None, year_of_construction=None, function=None):
|
||||
self._city = None
|
||||
self._scene = dataframe
|
||||
self._scene = self._scene.to_crs(self._srs_name)
|
||||
min_x, min_y, max_x, max_y = self._scene.total_bounds
|
||||
self._lower_corner = [min_x, min_y, 0]
|
||||
self._upper_corner = [max_x, max_y, 0]
|
||||
self._extrusion_height = extrusion_height
|
||||
self._year_of_construction = year_of_construction
|
||||
self._function = function
|
||||
self._geo_dataframe = geopandas.read_file(path)
|
||||
|
||||
@property
|
||||
def scene(self) -> Scene:
|
||||
"""
|
||||
Get GeoPandas scene
|
||||
"""
|
||||
return self._scene
|
||||
|
||||
@property
|
||||
def city(self) -> City:
|
||||
|
@ -52,7 +41,7 @@ class Geojson:
|
|||
Get city out of a GeoPandas Table
|
||||
"""
|
||||
if self._city is None:
|
||||
self._city = City(self._lower_corner, self._upper_corner, self._srs_name)
|
||||
self._city = City(None, None, self._srs_name)
|
||||
for scene_index, bldg in self._scene.iterrows():
|
||||
geom = bldg.geom
|
||||
polygon = ShapelyPoly(geom['coordinates'][0])
|
||||
|
|
Loading…
Reference in New Issue
Block a user