Mkgmap e mappe Garmin da Openstreetmap (OSM)

  • La Pinarello Dogma XC è finalmente disponibile al pubblico! Dopo averla vista sul gradino più alto del podio dei campionati del mondo di XC 2023 con Tom Pidcock (con la full) e Pauline Ferrand-Prevot (con la front), Stefano Udeschini ha avuto modo di provarla sui sentieri del Garda
    Iscriviti al canale se non l'hai ancora fatto (clicca qui).


ataro

Biker celestialis
16/4/09
7.778
9
0
Marche
Visita sito
Lo style di demon.box funziona, come detto. Ma io vorrei far apparire sulla mappa name e ref separatamente, quand'anche se fossero uguali.

Ho pensato di sostituire la prima parte con:


highway=* & route=hiking {set ref = '${route_ref}' ; set name = '${route_name}' ;}


Quando esiste il route_ref tutto ok, se c'è sia il route_ref che il route_name appare solo il name...:nunsacci:
Se vuoi vedere il ref insieme al name ce lo devi concatenare.
 

ataro

Biker celestialis
16/4/09
7.778
9
0
Marche
Visita sito
Ok, ma io NON vorrei concatenarlo, per evitare una stringa lunga e meno leggibile...
Perchè non posso settare ambedue i tag? :nunsacci:
highway=secondary | highway=tertiary {name '${ref|highway-symbol:oval} ${name}' | '${ref|highway-symbol:oval}' | '${name}'; add mkgmap:display_name = '${name} (${ref})' }
Io non uso il ref da solo, ma credo che l'unico modo per separarli (e non ho provato, quindi non sono sicuro di quello che succede) sia usare il filtro highway-symbol nel nome come sopra.
 

scratera

Biker nirvanensus
30/6/07
26.176
2.376
0
rovereto TN
Visita sito
Bike
...
...ciao @FabryLorenz le stringhe complete sono queste in cui indico nella prima che tracktype=yes & tracktype=grade0 & tracktype=* abbia quel valore mentre mentre poi specifico tutte le altre...o-o..


# tracktype
# yes
highway=track & (tracktype=yes & tracktype=grade0 & tracktype=* ) {set name='${name} sterrata' | 'sterrata'}[0x16 road_class=1 resolution 20]

Si ma, dal punto di vista logico, questa riga non ha senso, quindi mi domando a che scopo tenerla?

...vero ma è per un'eventuale tracktype=pippo e visualizzarla come fosse un track puro e semplice....il mondo dei mappatori è vasto e infatti questo lo faccio anche per le stringhe path...o-o..

l'ultima rule non la devi mettere, in quanto se c'è route_name c'è anche route e quello che vuole fare questa l'ha già fatto la precedente

...e infatti ora stò provando a vedere che ne esce...era quello che stavo pensando...
...provato non è cambiato nulla...o-o...
 

ataro

Biker celestialis
16/4/09
7.778
9
0
Marche
Visita sito
allora sulla sterrata in josm ho questo

bicycle {yes}
highway {track}
hiking {yes}
operator {C.A.I.}
ref {101}
surface {gravel}
tracktype {grade2}


le ralazioni legate a quella sterrata sono:

name=Sentiero Galli
ref=E122
network=rwn
etc
--------------
name=101
ref=E101
network=rwn
etc
-----------

questo è quello che visualizzo
attachment.php


...e questo è quello che ho scritto nel file lines

highway=* & route=* { set route_ref='$(route_ref), ${ref}' | '${ref}' }

highway=* & route=* { name '(${route_ref}) ${route_name|not-equal:route_ref} ' | '(${route_ref}) ' | '(${ref})

${route_name} ' | '${name} (${ref})' | '${route_name} ' | '(${ref})' | '${name} ' }

highway=* & route_name=* { set name='${name} ${route_name}' | '${route_name}' }

9k=



...non mi piace però il doppio nome...:medita:
highway=* & route=* { set route_ref='$(route_ref), ${ref}' | '${ref}' }
questa non so se funziona in lines, $(......) si usa in relations.
Cosa hai in relations?
Ci sono in lines altre set name ' successive a quelle che hai riportato?
 

ataro

Biker celestialis
16/4/09
7.778
9
0
Marche
Visita sito
...ciao @FabryLorenz le stringhe complete sono queste in cui indico nella prima che tracktype=yes & tracktype=grade0 & tracktype=* abbia quel valore mentre mentre poi specifico tutte le altre...o-o..


# tracktype
# yes
highway=track & (tracktype=yes & tracktype=grade0 & tracktype=* ) {set name='${name} sterrata' | 'sterrata'}[0x16 road_class=1 resolution 20]
# grade1
highway=track & tracktype=grade1 {set name='${name} sterrata' | 'sterrata'}[0x0a road_class=1 resolution 20]
# grade2
highway=track & tracktype=grade2 {set name='${name} sterrata' | 'sterrata'}[0x0d road_class=1 resolution 20]
# grade3
highway=track & tracktype=grade3 {set name='${name} sterrata' | 'sterrata'}[0x0e road_class=1 resolution 22]
# grade4
highway=track & tracktype=grade4 {set name='${name} traccia' | 'traccia'}[0x0f road_class=0 resolution 22]
# grade5
highway=track & tracktype=grade5 {set name='${name} traccia' | 'traccia'} [0x12 road_class=0 resolution 22]
# Grade 6-9
highway=* & tracktype~'grade[6-9].*' { set name='traccia ${name}' | 'traccia' } [0x1041a road_class=0 resolution 22]
Dovresti scrivere così per fare quello che vuoi fare:
# tracktype
# grade1
highway=track & tracktype=grade1 {set name='${name} sterrata' | 'sterrata'}[0x0a road_class=1 resolution 20]
# grade2
highway=track & tracktype=grade2 {set name='${name} sterrata' | 'sterrata'}[0x0d road_class=1 resolution 20]
# grade3
highway=track & tracktype=grade3 {set name='${name} sterrata' | 'sterrata'}[0x0e road_class=1 resolution 22]
# grade4
highway=track & tracktype=grade4 {set name='${name} traccia' | 'traccia'}[0x0f road_class=0 resolution 22]
# grade5
highway=track & tracktype=grade5 {set name='${name} traccia' | 'traccia'} [0x12 road_class=0 resolution 22]
# Grade 6-9
highway=* & tracktype~'grade[6-9].*' { set name='traccia ${name}' | 'traccia' } [0x1041a road_class=0 resolution 22]

# Other
highway=track & tracktype=* {set name='${name} sterrata' | 'sterrata'}[0x16 road_class=1 resolution 20]

Come hai scritto tu la prima non viene mai eseguita, e se modifichi come ho fatto e la lasci in cima, non vengono mai eseguite le altre:
 

scratera

Biker nirvanensus
30/6/07
26.176
2.376
0
rovereto TN
Visita sito
Bike
...
highway=* & route=* { set route_ref='$(route_ref), ${ref}' | '${ref}' }
questa non so se funziona in lines, $(......) si usa in relations.
Cosa hai in relations?
Ci sono in lines altre set name ' successive a quelle che hai riportato?
...se lo tolgo mi sparisce la doppia siglatura delle due relazioni e me ne tiene solo una
..poi ho scritto
route=bicycle | route=mtb [0x10a0d resolution 22 continue]
route=hiking & network=iwn [0x10e0e resolution 20 continue]
route=hiking [0x10e0c resolution 22 continue]


...e ciò non influenza sulla dicitura
...in relation ho

# Route
type=route & route=* {
apply {
set route='${route}';
set route_name='${name}';
set route_ref='${ref}'
# set route_ref='$(route_ref),${ref}' | '${ref}'
}
}
 

ataro

Biker celestialis
16/4/09
7.778
9
0
Marche
Visita sito
Non proviene dal file relations (ma quello che usi non ti concatena i nomi e i ref delle route).
Quelle che riporti costruiscono solo grafica, non interessano il name.
Controlla se hai altre rule che ti modificano il nome (fai un trova nel file lines cercando name)
 

scratera

Biker nirvanensus
30/6/07
26.176
2.376
0
rovereto TN
Visita sito
Bike
...
.. [MENTION=41438]ataro[/MENTION]...il name è presente in tutte le stringhe sia path che track con più o meno questa sintassi per tutte

{set name='${name} sentiero' | 'sentiero'}

per indicare se è un sentiero ...una traccia di sentiero..una sterrata...una traccia sterrata...etc e non ho intenzione di toglierlo...o-o..
 

ataro

Biker celestialis
16/4/09
7.778
9
0
Marche
Visita sito
.. @ataro...il name è presente in tutte le stringhe sia path che track con più o meno questa sintassi per tutte

{set name='${name} sentiero' | 'sentiero'}

per indicare se è un sentiero ...una traccia di sentiero..una sterrata...una traccia sterrata...etc e non ho intenzione di toglierlo...o-o..
I problemi non possono dipendere da queste. Al massimo se hai cannato qualche continue ti compare un nome con 'sentiero' di troppo .....
 

scratera

Biker nirvanensus
30/6/07
26.176
2.376
0
rovereto TN
Visita sito
Bike
...
I problemi non possono dipendere da queste. Al massimo se hai cannato qualche continue ti compare un nome con 'sentiero' di troppo .....
...queste sono a posto ...infatti mi compaiono i nomi dei sentieri e delle sterrate seguiti da sentiero o sterrata a secondo dei casi....o-o..e se manca il nome dal ref del sentiero o dalla difficolta mtb...a secondo di quello che trova nella compilazione...

attachment.php
 

Allegati

  • Cattura.JPG
    Cattura.JPG
    12,9 KB · Visite: 213

ataro

Biker celestialis
16/4/09
7.778
9
0
Marche
Visita sito
Vediamo un po':

Tag definiti:
highway=track
route è definito
ref=101
route_name=Sentiero Galli
route_ref=E122

questa anche se è scritta col $() esegue
highway=* & route=* {
set route_ref=
'$(route_ref), ${ref}' |
'${ref}'
}
e route_ref diventa
route_ref=E122, 101

poi questa
highway=* & route=* {
name '(${route_ref}) ${route_name|not-equal:route_ref} ' |
'(${route_ref}) ' |
'(${ref}) ${route_name} ' |
'${name} (${ref})' |
'${route_name} ' |
'(${ref})' |
'${name} '
}
name diventa
name=(E122, 101) Sentiero Galli

highway=* & route_name=* {
set name=
'${name} ${route_name}' |
'${route_name}'
}
name diventa
name=(E122, 101) Sentiero Galli Sentiero Galli

Molto probabilmente il doppio E122 dipende dal fatto che hai usato erroneamente il codice $(...) al posto di ${...} ed hai individuato un baco di mkgmap
 

ataro

Biker celestialis
16/4/09
7.778
9
0
Marche
Visita sito
Allora queste non vengono eseguite
Vediamo un po':

Tag definiti:
highway=track
route è definito
ref=101
route_name=Sentiero Galli
route_ref=E122

questa anche se è scritta col $() esegue
highway=* & route=* {
set route_ref=
'$(route_ref), ${ref}' |
'${ref}'
}
e route_ref diventa
route_ref=E122, 101

poi questa
highway=* & route=* {
name '(${route_ref}) ${route_name|not-equal:route_ref} ' |
'(${route_ref}) ' |
'(${ref}) ${route_name} ' |
'${name} (${ref})' |
'${route_name} ' |
'(${ref})' |
'${name} '
}
name diventa
name=(E122, 101) Sentiero Galli

highway=* & route_name=* {
set name=
'${name} ${route_name}' |
'${route_name}'
}
name diventa
name=(E122, 101) Sentiero Galli Sentiero Galli

Molto probabilmente il doppio E122 dipende dal fatto che hai usato erroneamente il codice $(...) al posto di ${...} ed hai individuato un baco di mkgmap
Questa viene eseguita, insieme all'altra che antepone M2 al nome:
.. @ataro...il name è presente in tutte le stringhe sia path che track con più o meno questa sintassi per tutte

{set name='${name} sentiero' | 'sentiero'}

per indicare se è un sentiero ...una traccia di sentiero..una sterrata...una traccia sterrata...etc e non ho intenzione di toglierlo...:prost:..
...no questo è un semplice path con scala m2 come difficoltà mtb e nome...a cui collego sentiero nella finale tramite la stringa
...e secondo te son stato così bravo a beccare l'influenza...:smile::smile:.....:omertà:
Di questi tempi gira ....
Mkgmap doveva darti un errore a causa del $() e non l'ha fatto. Tale codice ha senso solo nel file relations all'interno di un apply {}.
Forse ti conviene andare dal medico di mkgmap (:smile::smile:.....:omertà:).
 

scratera

Biker nirvanensus
30/6/07
26.176
2.376
0
rovereto TN
Visita sito
Bike
...
...ciao @ataro ho giocherellato un po e alla fine ho ottenuto questo

attachment.php


...e sembra strano ma questa

route_ref=* { set ref='${ref} ${route_ref}' | '${route_ref}' }

che sia scritta così o così

route_ref=* { set ref='$(ref) ${route_ref}' | '${route_ref}' }

deve stare all'interno del file lines perchè se la mettiamo all'interno di relations non otteniamo la cancatenazione delle due relazioni
...mentre nel file relations ho scritto questo

# Public routes.
# We could want to sort the matching relations by ref first.
# Route
type=route & (route=hiking | route=bicycle) {
apply {
set route='${route}';
set route_ref='$(route_ref), ${ref}' | '${ref}';
set route_name='$(route_name), ${name}' | '${name}'

}
}
 

Allegati

  • Cattura.JPG
    Cattura.JPG
    32,3 KB · Visite: 237

ataro

Biker celestialis
16/4/09
7.778
9
0
Marche
Visita sito
Ho posto il quesito e l'autore mi ha risposto:

On Fri, Feb 08, 2013 at 09:08:08PM +0000, Ataro wrote:
> I've erroneusly used the substitution $(....) in a rule in the style file lines as follow:
> highway=* & route=* {set route_ref='$(route_ref), ${ref}' | '${ref}'}
> and mkgmap don't return with some error or warning.

I implemented this feature some years ago, so that you could append attributes from multiple relations to the relation members. For example, append all ${ref} of bus route relations to the ${route_ref} of the bus stop POIs.

> This substitution $(....), as state the manual, are reserved for the use in a apply rule in the relations file and are not usable in other style files.
> I've found a mkgmap bug or what other?

It could be fixed in the documentation, by saying that $(name) is equivalent to ${name} outside the apply action.

In uk.me.parabola.mkgmap.osmstyle.actions.ValueItem, there ${} vs $() chooses whether we are referring to the relation or to the relation member. For example,

(type=boundary | type=multipolygon) & boundary=administrative & name=*
{ apply
{
set mkgmap:boundary_name='$(mkgmap:boundary_name)/${name}' | '${name}';
}
}

in the default style will set the attribute mkgmap:boundary_name in the relation member. The $(mkgmap:boundary_name) refers to attribute in the relation member, while ${name} refers to the attribute in the relation itself.

Best regards,
Marko

Quindi, come ha verificato scratera, $() e ${} sono equivalenti fuori da un apply (e quindi anche fuori dal file relations). Ha detto poi che la documentazione verrà aggiornata per spiegarlo.
 
  • Mi piace
Reactions: scratera

ataro

Biker celestialis
16/4/09
7.778
9
0
Marche
Visita sito
Ho trovato un metodo migliore per compilare una piccola zona (non tanto piccola) senza scaricare da Geofabric.
Usare l'api overpass. Molto semplice e veloce, e si scarica l'area che si vuole, basta dare il rettangolo o il poligono.
Si apre la pagina http://overpass-api.de/query_form.htmlhttp://overpass-api.de/query_form.html
nel box Overpass API Query Form si scrive (esempio con mie lat e lon del rettangolo che ora compilo)
(node(42.4826657,12.4107264,43.8343584,13.8483866);<;);out;
oppure (node(LATi,LONi,LATs,LONs);<;);out qt; che dovrebbe essere più veloce (non ho verificato).
Infine si può usare anche un poligono: (node(poly:"50.7 7.1 50.7 7.12 50.71 7.11");<;);out meta;
Viene in download un file dal nome Interpreter (nel mio caso da 154 Mb).
E' un file osm senza metadati (timestamp e proprietario del singolo dato, se li si vuole scrivere out meta qt; si ottiene un file da 310 Mb).
Basta rinominarlo in Map.osm e darlo in pasto allo splitter (basta modificare il nome nella riga dello script) e abbiamo la nostra mappa aggiornatissima ed in brevissimo tempo.
Sono uscite due mattonelle img di dimensione solita e con i dati aggiornati alle modifiche che ho fatto.
 

scratera

Biker nirvanensus
30/6/07
26.176
2.376
0
rovereto TN
Visita sito
Bike
...
.. @ataro.. @demon.box
...sappiamo che possiamo scaricare i dati grezzi da josm o dalla pagina principale di josm ma questo per aree ridotte e con non più di 5000 punti se non erro
...io uso e scarico questo http://download.bbbike.org/osm/extract/planet_13.206_39.627_eb54a00a.osm.pbf che ha una validità di 48 ore ed è già superato dagli aggiornamenti ma lo ricavo da qua http://extract.bbbike.org/?sw_lng=6.817&sw_lat=35.195&ne_lng=18.946&ne_lat=47.357&format=osm.pbf&coords=13.206%2C39.627|12.12%2C37.414|14.477%2C35.195|17.582%2C38.269|18.946%2C40.134|14.168%2C43.726|13.116%2C45.238|14.217%2C45.891|13.3%2C46.875|10.391%2C47.357|7.219%2C45.974|6.817%2C44.129|9.886%2C43.607|11.586%2C41.342|9.53%2C41.512|7.54%2C41.039|8.319%2C38.573&city=italia dove è possibile ritagliare un'area a piacere e nel giro di una 1/2 oretta si ha il downlod disponibile...o-o...e in varia forme...o-o..
 

ataro

Biker celestialis
16/4/09
7.778
9
0
Marche
Visita sito
.. @ataro.. @demon.box
...sappiamo che possiamo scaricare i dati grezzi da josm o dalla pagina principale di josm ma questo per aree ridotte e con non più di 5000 punti se non erro
...io uso e scarico questo [url]http://download.bbbike.org/osm/extract/planet_13.206_39.627_eb54a00a.osm.pbf[/URL] che ha una validità di 48 ore ed è già superato dagli aggiornamenti ma lo ricavo da qua [url]http://extract.bbbike.org/?sw_lng=6.817&sw_lat=35.195&ne_lng=18.946&ne_lat=47.357&format=osm.pbf&coords=13.206%2C39.627|12.12%2C37.414|14.477%2C35.195|17.582%2C38.269|18.946%2C40.134|14.168%2C43.726|13.116%2C45.238|14.217%2C45.891|13.3%2C46.875|10.391%2C47.357|7.219%2C45.974|6.817%2C44.129|9.886%2C43.607|11.586%2C41.342|9.53%2C41.512|7.54%2C41.039|8.319%2C38.573&city=italia[/URL] dove è possibile ritagliare un'area a piacere e nel giro di una 1/2 oretta si ha il downlod disponibile...o-o...e in varia forme...o-o..
Con il mio sistema i dati risalgono al massimo ad 1 ora prima.
Con questo sistema a quanto tempo prima risalgono i dati? (se l'hai verificato)
 

Classifica mensile dislivello positivo