How andgem/osmtoroadgraph works
Main Components and Structure
The system should be represented with these key components:
a) Input Processing Layer:
• OSM XML Parser (osm/ directory)
• Configuration Handler (configuration.py)
• Input Sanitization (osm/sanitize_input.py)
b) Core Processing Layer:
• Graph Construction (graph/ directory)
• Graph Algorithms (graph/algorithms.py)
• Graph Conversion (graph/convert_graph.py)
• Graph Contraction (graph/contract_graph.py)
c) Output Generation Layer:
• Graph Writer (output/write_graph.py)
• Multiple Output Formats (.pycgr, .json for NetworkX)
Data Flow and Relationships
Input → Processing → Output
[OSM XML/BZ2] → [Parser] → [Graph Construction] → [Output Formats]
Component Details
For each major component, include:
a) Input Processing:
• XML Handler (osm/xml_handler.py)
• Way Parser (osm/way_parser_helper.py)
• OSM Types Definition (osm/osm_types.py)
b) Graph Processing:
• Graph Factory (graph/graphfactory.py)
• Graph Types (graph/graph_types.py)
• Core Graph Logic (graph/graph.py)
c) Utility Components:
• Geo Tools (utils/geo_tools.py)
• Performance Timer (utils/timer.py)
Special Features to Highlight
• Network type handling (pedestrian, bicycle, car)
• Graph contraction capability
• Multiple output format support
• Indoor path processing (optional feature)
Implementation Details
Relationships:
• Configuration influence on graph construction
• Graph type selection flow
• Contraction process flow (optional)
• Output format selection
Top: Input Layer (OSM Data)
↓
Middle: Processing Layer (Graph Construction & Manipulation)
↓
Bottom: Output Layer (Multiple Formats)
Additional Elements
Include:
• Version information (v.0.6.0)
• Supported Python versions (3.7+)
• Optional dependencies (NetworkX)
This design should help developers understand both the high-level architecture and the specific components that make up the system, while maintaining clarity about the data transformation process from OSM input to the final graph output formats.