This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

How to show an icon for a node in JOSM (from an OSM file)

0

Hello there,

I want to be able to display an icon instead of a node when reading an OSM file in JOSM. This is important to me because my user will have to edit OSM files in JOSM. Specifically, the user will have a OSM xml file like this one (minimal example):

xml

I tried adding icon-image="presets/food/restaurant.svg" to the node tag, but no luck.

Here is the output that I get in JOSM. I would like to have an icon instead of a node in JOSM.

sample output

Is it possible to put an icon instead of a node in JOSM through the XML file?

Thanks in advance

asked 06 Oct '19, 20:39

marcosroriz's gravatar image

marcosroriz
11112
accept rate: 0%


One Answer:

0

I wonder which criteria make those nodes stand out from the others:

  • new nodes (but then IDs should be negative, not positive like in your example. It depends on how the JOSM file was generated. Was the data downloaded from the OSM server (positive IDs), or was the data created elsewhere and still has to be uploaded to OSM (negative IDs ?))
  • no tags

so perhaps take a look at Pseudo Classes (:new, !:tagged) in https://josm.openstreetmap.de/wiki/Help/Styles/MapCSSImplementation to select those nodes and style them

answered 07 Oct '19, 04:45

escada's gravatar image

escada
19.0k16166302
accept rate: 21%

edited 07 Oct '19, 09:06

The nodes are bus stops and they are created by the users (hence the basic ids). The overall idea is that I'm using JOSM to enable the users to edit the rural network.

(07 Oct '19, 07:24) marcosroriz

If they are bus stops then add the bus stop tag. This will also show a corresponding icon in JOSM. Your question remains unclear, though.

(07 Oct '19, 09:05) scai ♦

@scai, how can I add the bus stop tag?

(08 Oct '19, 04:06) marcosroriz
2

for each node

<node ....> <tag k="highway" v="bus_stop"/> </node>

see https://wiki.openstreetmap.org/wiki/OSM_XML and https://wiki.openstreetmap.org/wiki/Tag:highway%3Dbus_stop

p.s. please note that there are different tagging schemes for public transport

(08 Oct '19, 04:40) escada

Source code available on GitHub .