jiawlu / OSM2GMNS

GNU General Public License v3.0
89 stars 41 forks source link

print out the total processing time at the end of the process #13

Open asu-trans-ai-lab opened 1 year ago

asu-trans-ai-lab commented 1 year ago

Currently, only the information below is given, but we need to know the total processing time for large networks. -- Building Network from OSM file reading osm file parsing osm network generating nodes and links number of nodes: 52820, number of links: 75395, number of pois: 0 Consolidating Complex Intersections 1324 intersections have been consolidated Outputting Network Files

qyanswerai commented 1 month ago

Is anything printed after ‘Outputting Network Files’? My code keeps running indefinitely even when dealing with a small map file.

jiawlu commented 1 month ago

Is anything printed after ‘Outputting Network Files’? My code keeps running indefinitely even when dealing with a small map file.

@qyanswerai can you provide the OS version, osm2gmns version, and the commands you are using?

qyanswerai commented 1 month ago

thank you, I use windows and the osm2gmns version is 0.7.6 the code is as follows:

`import osm2gmns as og

class NetworkOSM: @staticmethod def network_data_pbf(file_name, save_path):

download .osm.pbf from Geofabrik:https://download.geofabrik.de/asia/china.html

    net = og.getNetFromFile(filename=file_name, network_types='auto',
                            link_types={'motorway', 'trunk'},
                            strict_mode=False, combine=True)
    og.consolidateComplexIntersections(net, auto_identify=True)
    og.outputNetToCSV(net, output_folder=f'{save_path}', encoding='utf_8_sig')

if name == 'main':

以上海市为例,根据OSM文件提取links、nodes

file_name = f'data/shanghai-latest.osm.pbf'
NetworkOSM.network_data_pbf(file_name=file_name, save_path='network_data')`

Additional note: 1、The program has the following log information and the file can be generated normally Building Network from OSM file reading osm file parsing osm network generating nodes and links combining links before: 13828 nodes, 14894 links after: 5717 nodes, 6783 links number of nodes: 5717, number of links: 6783, number of pois: 0 Consolidating Complex Intersections 48 intersections have been consolidated Outputting Network Files 2、however, the number of node.csv lines and links.csv lines are not equal to those in the log (5717 nodes, 6783 links), but very close