Skip to content

Commit

Permalink
Merge pull request #38 from USEPE-SesarJU/cleanup-code
Browse files Browse the repository at this point in the history
Cleanup code in usepe.city_model package
  • Loading branch information
joakimrydberg authored Dec 22, 2022
2 parents 8a22b72 + 116f5f2 commit a2fdbf0
Show file tree
Hide file tree
Showing 12 changed files with 3 additions and 759 deletions.
12 changes: 0 additions & 12 deletions usepe/city_model/building_height.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ def readSector( path ):
footprint = polygon_face
deviation_min = face_deviation

# coord_building += coord.text.split( sep=' ' )
coord_building += footprint

else:
Expand All @@ -142,11 +141,9 @@ def readSector( path ):
footprint = polygon_face
deviation_min = face_deviation

# coord_building += coord.text.split( sep=' ' )
coord_building += footprint

footprint_duplicates = footprintListOfLists( coord_building )
# building_footprint = removeDuplicatesList( footprint_duplicates )
building_footprint = footprint_duplicates
building_height = float( building.find( "{http://www.opengis.net/citygml/building/2.0}"
"measuredHeight" ).text )
Expand Down Expand Up @@ -230,12 +227,3 @@ def readCity( directory ):

if __name__ == '__main__':
pass
# # path = r"C:\Users\jbueno\Desktop\Stadtmodell_Hannover_CityGML_LoD1\CityGML_LoD1\5410_5806.gml"
# # print( readSector( path ) )
# # directory = r"C:\Users\jbueno\Desktop\Stadtmodell_Hannover_CityGML_LoD1\CityGML_LoD1"
# directory = r"C:\workspace3\USEPE_test\src\resources\cityModels\Stadtmodell_Hannover_CityGML_LoD1"
# # directory = r"C:\Users\jbueno\Desktop\Stadtmodell_Hannover_CityGML_LoD1\Tests"
# building_dict = readCity( directory )
# print( len( building_dict ) )
# print( building_dict )

9 changes: 0 additions & 9 deletions usepe/city_model/city_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,3 @@ def cityGraph( config ):

if __name__ == '__main__':
pass
# config_path = "C:/workspace3/bluesky/nommon/city_model/settings.cfg"
# print( 'config path correct?', os.path.isfile( config_path ) )
# G = cityGraph( config_path )
# G = ox.speed.add_edge_speeds( G, fallback=10 )
# G = ox.speed.add_edge_travel_times( G )
# edges = ox.graph_to_gdfs( G, nodes=False )
# edges["segment"] = edges["segment"].astype( str )
# print( edges.groupby( "segment" )[["length", "speed_kph", "travel_time"]].mean().round( 1 ) )
# print( edges.groupby( "segment" ) )
9 changes: 0 additions & 9 deletions usepe/city_model/city_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,3 @@ def mainSectorsLimit( lon_min, lon_max, lat_min, lat_max, divisions, building_di

if __name__ == '__main__':
pass
# from usepe.city_model.building_height import readCity
# directory = r"C:\Users\jbueno\Desktop\Stadtmodell_Hannover_CityGML_LoD1\Tests"
# building_dict = readCity( directory )
# print( building_dict )
# result = mainSectorsLimit( 9, 10, 40, 60, 4, building_dict )
# sectors = result[0]
# building_dict = result [1]
# print( building_dict )
# print( sectors )
7 changes: 0 additions & 7 deletions usepe/city_model/corridors_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,23 +132,16 @@ def corridorCreation( G, segments, corridor_coordinates, altitude, speed, capaci
segments (DataFrame): segments updated with the corridors
'''

# segments = defineSegment( segments, 0, 0, 0, 0, 0, 0, speed, capacity, name )
# segments[name]['updated'] = False
# segments[name]['new'] = False

index = 0
# nodes_G = []
nodes_corridor = []
for point in corridor_coordinates:
index += 1
nodes_corridor += [name + '_' + str( index )]
point_lon = point[0]
point_lat = point[1]

# nodes_G += [insertionNode( G, point_lon, point_lat, altitude )]

G.addNodeAltitude( nodes_corridor[-1], point_lat, point_lon, altitude, name )
# G.add_node( nodes_corridor[-1], y=point_lat, x=point_lon, z=altitude, segment=name )

# Adds corridor edges to G
if len( nodes_corridor ) == 1:
Expand Down
24 changes: 0 additions & 24 deletions usepe/city_model/dynamic_segments.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,27 +403,3 @@ def dynamicSegments( G, config, segments=None, deleted_segments=None ):

if __name__ == '__main__':
pass
# filepath = "./data/hannover.graphml"
#
# from utils import read_my_graphml
# from multi_di_graph_3D import MultiDiGrpah3D
#
# G = read_my_graphml( filepath )
# G = MultiDiGrpah3D( G )
# segments = divideAirspaceSegments( 0, 20, 50, 54, 0, 250, 4, 4, 2 )
# G = assignSegmet2Edge( G, segments )
# G = updateSegmentVelocity( G, segments )
# edges = ox.graph_to_gdfs( G, nodes=False )
# print( edges['segment'] )
# print( edges.columns )
# print( edges['speed'] )
# print( segments['segment_1_2_0'] )
# G = addTravelTimes( G )
#
# from usepe.city_model.path_planning import trajectoryCalculation
# orig = ( 9.74 , 52.36 )
# dest = ( 9.78 , 53.38 )
# print( trajectoryCalculation( G, orig, dest ) )



223 changes: 0 additions & 223 deletions usepe/city_model/main_e3.py

This file was deleted.

Loading

0 comments on commit a2fdbf0

Please sign in to comment.