NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

0
1

Hello,
I'm looking for the fastest way that I could add some artificial nodes between available nodes (maybe at certain interval) in OSM map file.
actually "osmosis-srtm-plugin" use these nodes and update the OSM map file with elevation data. I want to increase the resolution of elevation data by adding some artificial nodes between available nodes in the OSM map file.
are there any tools to do that?

With Best Regards,
Mohsen

asked 12 Jul '19, 21:58

Mohsen%20Rahmati's gravatar image

Mohsen Rahmati
11124
accept rate: 0%

edited 13 Jul '19, 14:58

by the way, I want to use this updated OSM map file offline, in a traffic simulation software.

(13 Jul '19, 09:21) Mohsen Rahmati

It would help if you could explain what you're actually doing in a bit more detail, and also describe what you've tried already.

(13 Jul '19, 11:52) SomeoneElse ♦

Thanks for your participation @someoneelse.
There are many ways to create a network in traffic simulation software, but importing the OSM map file of the interested area is more convenient. Also, I want to see the effect of elevation in my simulation model. so, now I'm looking for the fastest way that I could add some artificial nodes into edges or links (i.e. those links that are related to roads or highways), in order to increase the resolution of the elevation data that produced by "osmosis-srtm-plugin".

(13 Jul '19, 14:30) Mohsen Rahmati

So you're actually looking to add extra nodes to existing ways in your download (and presumably only some existing ways, perhaps corresponding with certain highway types)?

I'm not aware of anything that already does that, but that doesn't mean that it doesn't exist. On the other hand of course it doesn't sound that hard to write some code yourself to do that.

(13 Jul '19, 14:38) SomeoneElse ♦

Does it matter that your new nodes are "between other nodes" (i.e. along a long straight way already in OSM) or can they just fill in the areas where there are no nodes to allow you to add elevations to them to process later?

If it's the latter, I'd just programmatically create a regular grid of nodes in an external .osm file a certain difference apart and merge that with the existing .osm data that you have. I'd then combine the resulting files with osmosis or similar.

permanent link

answered 13 Jul '19, 11:52

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

Thanks for your participation @someoneelse.
Well, artificial nodes must be added into edges or links that are related to roads or highways. it doesn't matter how it should be added, just every edge or link should have enough number of artificial nodes to be ensured that elevation data are usefulness in the simulated network.
I can do this manually in JOSM, but this is not applicable for large networks.
To view the sample, see attached files that are manually created. (Before | After)

(13 Jul '19, 14:46) Mohsen Rahmati

If you have a chance to put your data in Postgis, then this function may help:

https://postgis.net/docs/ST_Segmentize.html

permanent link

answered 14 Jul '19, 15:27

yvecai's gravatar image

yvecai
1.5k1226
accept rate: 9%

Thanks for your participation @yvecai.
I've written a python script that uses the same underlying of what you've shared.
I will share the script here, hope to be helpful.

(20 Jul '19, 12:53) Mohsen Rahmati

As I mentioned above, I was looking for a tool that could add some artificial nodes into the ways of the OSM map file. my goal was to increase the resolution of the elevation data that was later added with the "Osmosis-SRTM-Plugin".

I've written a python script which creates artificial nodes till all segments lengths in the OSM map file become lower than the predefined threshold. then the appropriate patch file will be created to patch the input OSM map file with "Osmosis".

Programming Language:
- Python 3.3+ (tested on python 3.7.3)

Required Packages:
- osmread==0.2
- numpy==1.16.4
- pandas==0.24.2
- shapely==1.6.4.post1
- osgeo==2.3.3
- geopandas==0.5.0

Python Script Repository (OSMEditor):
- https://github.com/Mohsen-eng74/OSMEditor

permanent link

answered 20 Jul '19, 13:04

Mohsen%20Rahmati's gravatar image

Mohsen Rahmati
11124
accept rate: 0%

edited 20 Jul '19, 13:14

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×205
×3
×2

question asked: 12 Jul '19, 21:58

question was seen: 2,386 times

last updated: 20 Jul '19, 13:14

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum