.set_keep_osm_ways_outside_bounding_box(+)
OsmNetworkReaderSettings method
Description
By default the entire OSM file that is provided will be parsed, unless the user specifies a smaller bounding box via .set_bounding_box(+)
in which case only entities within this bounding box are parsed. Via this method OSM ways that fall (partially) outside this bounding box can still be parsed in full, instead of being truncated.
To find out which OSM ways are truncated in the first place, run the reader with only the bounding box in place and check the logs for information on the OSM ways affected.
Signature
.set_keep_osm_ways_outside_bounding_box(osmWays)
with
Parameter | Type | Unit | Default | Description |
---|---|---|---|---|
osmWays |
List of Long |
None |
N/A | The OSM ways (partially) outside the bounding box to keep in full |
Return type
N/A
Example 1
from planit import *
# create a network converter
planit_instance = Planit()
network_converter = planit_instance.converter_factory.create(ConverterType.NETWORK)
# Open Street Map (OSM) network reader
osm_reader = network_converter.create_reader(NetworkReaderType.OSM, "<country_name>")
osm_reader.settings.set_input_file("<path_to_input_file>")
# set bounding box and mark some ways to be kept even though they partially fall outside this box
osm_reader.settings.set_bounding_box(144.948083, 144.975849, -37.823582, -37.808292)
osm_reader.settings.set_keep_osm_ways_outside_bounding_box([28919629,45526180])
See also
Source code
Class OsmNetworkReaderSettingsWrapper
in converterwrappers.py