Display name of multipolygon object?

Diskussionen zu dem Werkzeug hinter der Karte und für eigene Garminkarten
Antworten
ogrums
Beiträge: 7
Registriert: Sa Apr 17, 2021 5:40 pm

Display name of multipolygon object?

Beitrag von ogrums » Sa Apr 17, 2021 6:11 pm

Hello - any help appreciated on this, I'm on mc v1.05:

I would like to display the names of campsites (tourism=camp_site) on my mc maps, but I'm unable to achieve that if the campsite is a relation (type=multipolygon) - example:
https://www.openstreetmap.org/relation/7212752
If the campsite is a way it works - example:
https://www.openstreetmap.org/way/11995 ... 31/2.51761

I've desperately tried various Ersetzungen, my greatest succes so far is being able to remove the object...

Regards
Wanderer
Beiträge: 17
Registriert: So Mär 24, 2019 9:31 am

Re: Display name of multipolygon object?

Beitrag von Wanderer » So Apr 18, 2021 9:43 am

Hello,

you are on the right way . . . "Ersetzung" means substitution / replacement.

I would try to make a new "Ersetzung" with the following parameter:

Bild

First the Icon must be defined in the section "Kartenobjekte" with a suitable Garmin-ID (here you can choose the pichture which is schon for the Icon).

Secound the "Ersetzungen" substitution with the action ("Aktion") "Icon auf Fläche setzen" is used to place a Icon on a area (multipolygon). Then choose the Icon you defined in step one in "Objekt".

The Area "Bedingungen" is used to define for which rules.

You can define several rules top down, means the substitution is only ruled out if all rules are fullfilled.

The last thing to do is to tell MC to render this tag in a map. Therefore you've got to make a new "Renderregel" in which you choose the new "Kartenobjekt" and set

Hopefully this will help you :)

Best regards
Benutzeravatar
Nop
Site Admin
Beiträge: 401
Registriert: Do Jan 10, 2019 8:46 pm

Re: Display name of multipolygon object?

Beitrag von Nop » So Apr 18, 2021 11:31 am

I think that will not work. The problem is, that multipoygons are a very cumbersome workaround construct. At the time the replacement rules are executed, only the individual ways are visible, the multipolygon is resolved much later by mkgmap. So it is only possible to replace tags, but not do geometrical operations like icons. That would require implementing a complete separate string of processing.

As the use case is not so exotic, I might look into it if I have a great amount of time.
ogrums
Beiträge: 7
Registriert: Sa Apr 17, 2021 5:40 pm

Re: Display name of multipolygon object?

Beitrag von ogrums » So Apr 18, 2021 3:12 pm

Thanks both.

I ran an analysis on a specific area of interest, and around 60% of the campsites are of multipolygonal type.
The multipolygonal type campsites are not available as POI in the Garmin unit, meaning they can't be looked up as the other type of campsites.
Would it be possible (in due time!) to have a new Ersetzung create a new point object with same name and placement as the polygonal, this will then be rendered ok on the map, and be added to the Garmin database?
EDIT: Can it be done by Osmosis? Maybe in that case mc needs no update...

BTW, the display of a non-multipolygonal campsite is normally like this:
1.png
I've changed it to be rendered like this:
2.png
which is what I hoped was achievable also with multipolygonal types.

EDIT: Does the aktion objekt notieren work? I get no output file, I know the bedingungen are ok because I can choose aktion objekt entfernen which works.

Regards
ogrums
Beiträge: 7
Registriert: Sa Apr 17, 2021 5:40 pm

Re: Display name of multipolygon object?

Beitrag von ogrums » Mo Apr 19, 2021 7:04 pm

Just FYI: OSMOSIS extract of one affected camp_site in the mentioned area:

Code: Alles auswählen

  <relation id="7212753" version="-1" timestamp="1969-12-31T23:59:59Z" changeset="-1">
    <member type="way" ref="491061176" role="outer"/>
    <member type="way" ref="333384527" role="outer"/>
    <tag k="website" v="https://www.noucamping.com/"/>
    <tag k="phone" v="+34 973626266"/>
    <tag k="name" v="Càmping Nou Camping"/>
    <tag k="tourism" v="camp_site"/>
    <tag k="type" v="multipolygon"/>
  </relation>
First way mentioned in relation:

Code: Alles auswählen

  <way id="491061176" version="-1" timestamp="1969-12-31T23:59:59Z" changeset="-1">
    <nd ref="3404982704"/>
      ...
    <nd ref="4832215184"/>
  </way>
Fist node mentioned in the way:

Code: Alles auswählen

  <node id="3404982704" version="-1" timestamp="1969-12-31T23:59:59Z" changeset="-1" lat="42.59319" lon="1.13162"/>
Can that node be doubling as a POI by reusing the name from the relation, and set 'tourism=camp_site'?
There are more than 1.000 camp_sites that need treatment in the area I analyzed - so it's not going to be manual work.

Regards
Benutzeravatar
Nop
Site Admin
Beiträge: 401
Registriert: Do Jan 10, 2019 8:46 pm

Re: Display name of multipolygon object?

Beitrag von Nop » Mo Apr 19, 2021 7:17 pm

I put it onto the todo list as this was the second mention of this topic. However, as it is quite a complicated topic and I have no idea when I'll find enough time for that.

As for workarounds: Osmosis can't create new geometry. It might be possible achieve such an effect with mkgmap, I honestly don't know. In that case that would require adjusting the mkgmap rule set and run mkgmap again by its own.
ogrums
Beiträge: 7
Registriert: Sa Apr 17, 2021 5:40 pm

Re: Display name of multipolygon object?

Beitrag von ogrums » Mo Apr 19, 2021 7:48 pm

I know you're busy - I wasn't nagging...

Just to tie a knot for now: I modified the node as mentioned above and re-made the map - and it worked.
I guess I'll tinker some code together to treat a .pbf-file like that; it might not be very efficient, but only has to be done once in a while when a source-pbf changes.
If the result seems useful I might post it here.

Keep up the good work on your very nice program!

Regards

UPDATE: How are statistics to be interpreted:

Code: Alles auswählen

point    tourism camp_site 744
polyline tourism camp_site 1249
Earlier in this thread I interpreted the polyline number as the number of campsites described by a relation.
This is obviously wrong as the word 'camp_site' only occurs 870 times in the XML converted from the .pbf...
But what is the number 1249 then?
ogrums
Beiträge: 7
Registriert: Sa Apr 17, 2021 5:40 pm

Re: Display name of multipolygon object?

Beitrag von ogrums » So Apr 25, 2021 11:08 pm

Nop, I cannot understand the mc statistics - on a specific area I get:

Code: Alles auswählen

polyline tourism:camp_site 18
point    tourism:camp_site  8
I then converted the cut .pbf to XML and ran my own statistics on it:

Code: Alles auswählen

relation tourism:camp_site  4
way      tourism:camp_site  7
node     tourism:camp_site  1
The 8 = 7+1 seems ok, but the polyline total - what is it summing, and is it useful?
If I examine the 4 camp_sites in the relations, they have a total of 22 ways.

Regards
Benutzeravatar
Nop
Site Admin
Beiträge: 401
Registriert: Do Jan 10, 2019 8:46 pm

Re: Display name of multipolygon object?

Beitrag von Nop » Mo Apr 26, 2021 9:01 am

ogrums hat geschrieben:
Mo Apr 19, 2021 7:48 pm
This is obviously wrong as the word 'camp_site' only occurs 870 times in the XML converted from the .pbf...
But what is the number 1249 then?
Likely the number of polygons + number of ways associated with those relations.
ogrums
Beiträge: 7
Registriert: Sa Apr 17, 2021 5:40 pm

Re: Display name of multipolygon object?

Beitrag von ogrums » Mo Apr 26, 2021 12:51 pm

I will not check all those :D
That's why I created a smaller and more manageable area: see my previous post - as far as I can see the numbers don't add up ?
Regards
Antworten