Repository navigation
Releases: Yibbzz/networkforge
Release list
NetworkForge 1.3.0
Added
- Measured speeds for traffic:
speed_kph(km/h) wherever afactor
could be given, in road-class bands and on single streets; where a
factor and a speed overlap, the slower wins. - A speed table by OpenStreetMap way id (
--speed-table FILE, a CSV or
a GeoPackage table; Python:speed_table): rows ofosm_id/osmid,
days,time,speed_kphorfactor,direction. The form measured
speeds usually come in. Rows that match nothing are named by row
(--speed-table-id-field, or the row number) in a warning (rows)
and in the done event'sunmatched_rows;table_rowscounts the rows
used. direction = backwardfor single streets and the speed table: only
the direction opposite the drawn line, or the way's own direction.- A warning when Valhalla can only approximate a band (short and much
slower than normal: its compact week of speeds can't hold the dip). - docs/traffic.md: what uses traffic in the Network Analyst plugin
(routes and isochrones in its panel do; matrices and its Processing
tools don't).
Fixed
- A short, deep band (e.g. 64 down to 12 km/h for 90 minutes) unpacked in
Valhalla with speeds near or below zero in its middle, so a trip took
many times longer than given (a 238 m slip road took 14 minutes). Speeds
that would unpack below half of those asked for are now raised before
packing.
NetworkForge 1.2.1
Fixed
networkforge trafficfailed on Windows ("Valhalla could not build a
graph from the OSM file", with no detail): pyvalhalla's programs only
find their libraries there whenpyvalhalla.libsis on PATH, which
the engine now sets for them. Its error messages now give Valhalla's
exit code. The Windows CI job runs the traffic tests in Valhalla.
NetworkForge 1.2.0
Added
networkforge traffic(Python:add_traffic,read_traffic_settings):
time-of-day speeds for Valhalla. A settings file of time bands by road
class ("primary roads at 60% on weekdays from 07:00 to 09:30") is put on
a network as Valhalla's predicted traffic, and Valhalla's graph is
written as a.tarfile (the Network Analyst plugin's "From Tar").
Only routes with a departure or arrival time use it; without a time
every street keeps its normal speed. Needs the newtrafficextra
(pip install "networkforge[traffic]", pyvalhalla 3.9.0). See
docs/traffic.md.networkforge infolists the settings' days, road
classes and factor range undertraffic.- Single streets for traffic (
--streets FILE, Python:street_bands):
a line layer, one row per street and time band (days,time,
factor, optionaldirectionboth/forward andosm_id/osmid).
A line without a way id is matched onto the stretches it runs along,
so it can be part of a long street or a new one. A street with rows of
its own ignores the road-class bands. Lines that match nothing are
named in a warning (--id-field) and in the done event'sunmatched.
NetworkForge 1.1.0
Added
ramp,ramp:wheelchair,ramp:strollerandramp:bicycleare
written for your own lines and for changes to existing streets (they
were dropped), and their values are checked. Valhalla tests record
what 3.9 does with them and with kerbs: nothing yet. Steps with a
ramp still stop a wheelchair, and no kerb does.- A warning names fields that look like OpenStreetMap tags
(tactile_paving,cycleway:surface...) but that NetworkForge
doesn't write, so routers won't see them. Names, sources, notes and
addresses (name:en,source:maxspeed...) aren't warned about. - A warning when a local OSM file (
osm_source=/--osm-source)
doesn't cover the whole area. A region's extract stops at its
boundary, so a box reaching across it quietly lost streets: built from
Geofabrik's Berkshire file, a box around Reading lost about 1,800
streets north of the Thames, with no warning. The build now finds the
part of the area where the file has no streets at all, reaching the
area's edge and covering at least 5% of it, and says where it is.
The sea side of a coastline doesn't count. With--jsonthe warning
event carriesgaps, a[west, south, east, north]box for each part.
Fixed
Found by probing the build with shapes the tests didn't draw
(tests/integration/test_edge_cases.py; the first four changed routes
in Valhalla).
- A custom bridge, tunnel, ferry or line on another
layerwas joined
to a custom road it crosses wherever either had a vertex within
snap_toleranceof the crossing. A vertex of a bridge drawn exactly
on a junction (or of a road on a motorway's node) joined it too. Only
ends join now, as documented. - A line crossing or ending on a street right beside the dead end of
another way (withinsnap_tolerance) was pulled onto the dead end and
never joined the street. - Making a street one-way when its OSM way closes on itself (a loop, a
crescent): drawn against the way's direction it was written the wrong
way round, and the closing stretch was reversed in the GeoPackage
either way. - An existing turn restriction over a via way was dropped, silently,
when any part of one of its ways was changed. It now follows the
pieces, as restrictions with a via node did. (It still goes, rightly,
if part of the via way is removed.) - About one line end in ten moved onto a street mid-block became two
nodes in one place joined by an edge of no length; so did three lines
crossing at one point. --gpkg(or another output) naming the--customfile overwrote the
custom data and reported success. Outputs that would replace an input
or each other are refused, and a missing output folder is reported
before the build rather than after it.- An extent or custom layer in a projection measured in feet (US State
Plane) was built in feet:length_mand travel times 3.28 times too
large. Such projections are replaced by the UTM zone. - Attributes named
index_right/index_leftcrashed the build;fid,
a name differing from another only in capitals, or a GeoPackage
analysis column name (car,length_m...) stopped the GeoPackage
being written. The first and last are set aside with the other
internal names; the others get a trailing underscore in the
GeoPackage. --json: a feature whose--id-fieldis empty was written asNaN,
which is not JSON; it isnull.- Control characters in a tag value made OSM XML that could not be read;
an extent file without features and an infinite--snap-toleranceare
input errors (exit 3), not crashes. - A new line drawn to the pier of an existing ferry that no street
reaches got a node of its own beside the ferry's, so the ferry stayed
out of reach in Valhalla. Its end now joins the ferry. maxspeed=0gave endless travel times (GeoPackage minutes, OSMnx
routing): a speed of 0 is ignored, as routers do, and on a custom
feature it is an error.bridge=0/bridge=false(and the same fortunnel) counted as a
bridge, so the line didn't join the streets it crossed. They mean no.- A change to an existing street drawn ACROSS a block (through the
middle of it) was applied to that block. A feature must now run along
the stretch, within 45 degrees.
Tests
-
Cycling infrastructure is now tested in Valhalla
(tests/valhalla/test_cycling.py): a cycle lane, a track or a
cycleway draws cyclists off a shorter street and nobody else; a lane
added to an existing street makes it cheaper to cycle; unpaved
surfaces close a street to the bicycles that can't take them. -
Wheelchair routing (
tests/valhalla/test_wheelchair.py): steps,
wheelchair=noand gravel turn a wheelchair back and nobody else. -
Less common tags (
tests/valhalla/test_less_common_tags.py):
motorcycles, mopeds and taxis, buses against a one-way street,
roundabouts,maxspeed:hgv, rough surfaces and mountain paths.
Documentation
- network-analyst.md
says which cycling tags Valhalla routes by and which it ignores
(cycleway:both,bicycle_road,cyclestreet). - The tagging guide is now network-rules.md,
"Network rules: how your lines become a network", written for people
using the QGIS plugin. It opens with a short summary of the rules
instead of code, names each setting as the QGIS form does, and ends
with a table of each setting in QGIS, on the command line and in
Python. The code examples are in the README.docs/tagging-guide.md
is now a short page pointing to the new one. Errors'guide(in
--jsonerror events too) now names the file:
network-rules.md#presets, notpresets. - The guide brought up to date. The
quick start shows the command line, the PBF and the GeoPackage, plus
a table of Python options with their CLI flags. Points are allowed in
the layer, and lines that join nothing are kept with a warning (the
guide said both were refused). Attributes that aren't tags are kept in
the GeoPackage. The reserved names list is complete. New:wheelchair,
maxspeed:hgv, time-of-day access, line ends that nearly meet, loops,
an error table for points, and a list of the warnings and what to do
about each.
NetworkForge 1.0.1
Fixed
- On Windows, an OSM file in a folder with accented or other non-English
letters in its name (C:\Users\Zoë\Documents\...) could not be read
("Open failed ... The system cannot find the file specified"), and
.osm.pbf,.osm.gzand.osm.bz2output could not be written to
one. The same went for such letters in the file's own name.
Tests
- The offline tests now also run on Windows on every push.
NetworkForge 1.0.0
The first stable release: every OSM feature a network build needs -
new lines, changed and removed streets, turn restrictions, points on
the network, ferries - tested against Valhalla.
Stability
- The command line (
build,check,presets,info), its exit codes
and its--jsonevents, and the Python API (build_network,
write_osm,write_gpkg, the errors) are now stable. New fields may
be added to the JSON events; none is removed or changes meaning
without a new major version.
Added
- New ferries. A custom line with
route=ferry(or
route=shuttle_train) and nohighwaytag is a ferry, as in
OpenStreetMap. It joins the streets only at its ends, passing over
streets it crosses. Everyone may use it unless an access tag closes
it (motor_vehicle=nofor a foot ferry);duration=hh:mmsets the
crossing time, else 10 km/h - both as Valhalla reads them. In the
GeoPackage every mode takes the ferry's time.info --jsonlists
tag_values.routeandtag_patterns.duration. - Warnings for values routers don't know on
surface,smoothness,
tracktype,sac_scale,sidewalk,cycleway*,segregated,lit,
toll,junction,bridge,tunnelandincline, for new lines and
edits alike, with the likely spelling (surface='asphault' ... did you mean 'asphalt'?). OSM allows any value, so the build carries on.
info --jsonlists the known values intag_values(and
tag_patterns.incline). - Deleting tags from an existing street. On a feature with an OSM
id,remove_tags=maxspeed;motor_vehicledeletes those tags from the
stretch (an empty attribute still means "no change"). Deleting
onewaymakes the street two-way.info --jsonhas
remove_tags_field. - Points: barriers, signals, crossings. A point in the custom layer
with node tags (barrier=bollard,highway=traffic_signals,
crossing=zebra, ...) tags the node it is on (within snap_tolerance)
or cuts the nearest street there with a new node - on new lines,
existing and changed streets alike.remove_tagson a point deletes
an existing node's tags (take out a bollard).layerpicks the street
where a bridge crosses one.check/build --jsonreportpoints/
tagged_nodes. - Via-way turn restrictions. A turn line through two junctions
joined by a street becomes a restriction over that stretch (from way,
via way, to way), e.g. no U-turn across a dual carriageway. Valhalla
obeys it. - Tests for multi-part custom lines: offline (parts that share an end,
cross, nearly meet, stray from the network or collapse; random
multi-part lines in the property tests) and in Valhalla (each part
routable, crossing parts joined, per-part edits and removals,
standalone networks).
Changed
- Point features are accepted in the custom layer (they tag nodes,
see above); only other geometry types are refused, now as "not a line
or point".
Fixed
- A multi-part feature that changes an existing street (
osm_id)
now applies to each part on its own:onewayfollows the direction
each part is drawn in (all parts took the first part's), and a problem
or an unchanged feature is reported once, not once per part. - A new roundabout without
onewayis one-way in the GeoPackage's
car_direction/bike_direction, as OSM and Valhalla treat it. It
was marked two-way there (the PBF was already right). - A line that crosses itself within 1 m of a motorway (or another
grade-separated way) no longer joins it there. The line was cut at the
crossing before snapping, and the cut ends counted as line ends, which
may join a motorway (as slip roads do). Now only the ends you drew do.
Found by the new multi-part property tests; single lines were affected
too.
NetworkForge 0.12.0
Added
- Turn restrictions. A line in the custom layer drawn from one street,
through a junction, onto another, with OSM'srestrictiontag
(no_left_turn,only_straight_on, ...), becomes an OSM turn
restriction relation.restriction:hgv/:bus/:motorcar/
:bicyclelimit it to one kind of vehicle, andexceptexempts some.
It works between existing streets, new lines and changed streets, and
in standalone networks. Streets that run through the junction are cut
there, as OSM requires. Lines that pass through no junction or more
than one are refused with the feature named; a value that disagrees
with the drawn turn (no_right_turn drawn as a left turn) is warned
about. See "Turn restrictions" in the tagging guide. --json: thedoneevent ofbuildandcheckhas
turn_restrictions;infohasturn_restriction_fieldsand
tag_values.restriction.
NetworkForge 0.11.1
Fixed
Found by further testing (odd inputs, larger areas):
- Attributes that aren't tags now keep their type. All attributes were
turned into text, so a number such as a surveyed travel time reached
the GeoPackage as'1.5'and couldn't be used as a cost in QGIS. - A coordinate that isn't a number (NaN, infinite) is reported for
its feature instead of crashing the build with a GEOS error. - When every feature is outside the box, the message suggests checking
the layer's CRS and the order of longitude and latitude.
Changed
- Tag names and values are taken exactly as OSM writes them: text
True
/Falseis no longer turned intoyes/no(a boolean field still
is, and empty text still counts as no value). - Dev container: the environment is
/opt/venvinstead of the shared
/workspace/.venv, which the host's and the container's uv kept
rebuilding for their own Python. Rebuild the container to use it. - Building a network of your own lines is about four times faster: a
39,000-line network (Malta) takes 25 s instead of 100 s. The steps that
went through the custom lines one at a time in Python now work on all
of them at once.
NetworkForge 0.11.0
Changed
--jsonedge counts are streets, not edges. Thedoneevent's
edges,custom_edges,modified_edgesandremoved_edgescount one
per street, as the GeoPackage has rows. They used to count OSMnx's
edges, which hold a two-way street as two (45 "edges" for a layer of
24 rows).- GeoPackage
onewayis always OSM text (yes,no,-1). Existing
streets came out as booleans and new or changed lines as text, so a
mixed build wroteTrue,Falseandyesin one column. - Standalone builds no longer mention OpenStreetMap in their progress
messages and log ("Checking custom lines reach the OSM network").
Fixed
- A line drawn along an existing street joins it at every node it lies
on; it used to pass over the street's junctions without joining them. - When the Overpass API can't be reached (it refuses connections when
busy), the download is tried again after 10 s and 30 s before failing.
Tests
- The nightly property test compared Valhalla's distance matrix with
NetworkForge's own routing. Valhalla 3.9.0's matrix can disagree with
its own route search on the same graph (229 m against 100 m), and its
default 5 m node snapping started trips on a nearby dead end; cells
that disagree are now measured with route(), locations aren't snapped,
and junctions another line passes within 0.5 m of are left out. The
cases found are kept as fixed examples. - The live city tests checked that each OSM tag was on as many exported
ways as downloaded edges, which no longer holds since the export writes
OSM ways as they are (v0.6.0); they now check the file holds the
downloaded ways and tags exactly. - The Overpass-versus-extract test allows up to 1% of rows to differ (a
day of OpenStreetMap edits between the two sources). - A live test whose Overpass download still fails after the retries is
skipped with the reason, not reported as an error.
NetworkForge 0.10.0
Added
- Standalone networks:
networkforge build --no-osm(Python:
build_network(None, lines, standalone=True)) builds a network from the
custom lines alone, with no OpenStreetMap, no area and no download.
Tags, presets and checks work as usual.--join-at crossings(default)
joins lines wherever they cross;--join-at verticesonly where they
share a vertex, for data that already has a vertex at every junction.
A warning names the features outside the largest connected piece.
networkforge inforeportsstandaloneandjoin_at. - Line ends that stop within the snap distance of each other without
touching now share one node (also when adding lines to OpenStreetMap).
Changed
- The package description and README now say what the tool has become:
building and editing street networks, not only adding proposed lines. buildno longer requires--extent/--bboxon the command line
when--no-osmis given (it still does otherwise; exit code 2).
Fixed
- An area or layer in a world-wide projection such as Web Mercator
(EPSG:3857) was measured in that projection, where a metre on the map
is not a metre on the ground (79% too long in Scotland): lengths in the
GeoPackage and the snap distance were wrong. A local UTM zone is now
used unless the CRS is a regional one.