Hi folks,
I am trying to make a changeset-file that adds a few nodes and a new way using these nodes. I am doing this in python, by first making a dictionary and then writing it to an xml-file using the xmltodict module. I have been able to make a simple way by connecting two existing nodes. I know this works since osrm routes along this new short-cut route. But when I try to add new nodes along that way the new way is ignored, so I must be doing something wrong. Here is the changeset with a new node in the middle of the new way.
<?xml version="1.0" encoding="utf-8"?>
<osmChange version="0.6" generator="acme osm editor">
<create>
<node id="10263105667" changeset="1" timestamp="2023-03-21T21:37:45Z" version="1" lat="10.659116000000001" lon="59.827652">
<tag k="amenity" v="school"/>
</node>
<way id="1122147596" changeset="1" timestamp="2023-03-21T21:37:45Z" version="1">
<nd ref="8116323496"></nd>
<nd ref="10263105667"></nd>
<nd ref="8116345054"></nd>
<tag k="highway" v="primary"></tag>
<tag k="maxspeed" v="80"></tag>
<tag k="name" v="Snarveien"></tag>
<tag k="ref" v="159"></tag>
<tag k="surface" v="asphalt"></tag>
</way>
</create>
</osmChange>
I then use osmosis to generate an updated file:
osmosis --read-xml-change file=“changeset.xml” --read-pbf file=“norway-latest.osm.pbf” --apply-change --write-pbf file=“updated.osm.pbf” omitmetadata=true
Any glaring errors here?