logo separator

[mkgmap-dev] Weekend in Essen

From Colin Smale colin.smale at xs4all.nl on Fri Feb 8 16:23:58 GMT 2013

 

They sound like great ideas! 

> - Split maps along country borders.
This would allow maps to be fully
> customised to country conventions.
I'd always thought of this being
> a splitter function and it would be
ideal to perform it there, but
> it could perhaps be done using the
multi-polygon code.

This would be awesome for international tramps like
me. In particular being able to mix drive-on-left and drive-on-right in
one .img! 

> - Doing something with values that are separated with ';'.
This is
> clearly desirable, but knowing what exactly to do is less
clear.
> I think it would have to be enabled on a tag-by-tag basis.

I
had already been chewing this one over. If we are able to treat the
values as lists, where the normal case degenerates to a list of one
value, then we could think of simple list manipulation functions such as
"first element", "last element", "count of elements", "element N". In
practice the count of elements will be quite low (often 2-3 will be
enough I think), so allowing a reference to a non-existing element
(returning an empty string) would allow quite powerful style-file
constructions with only a couple of lines. I'm sure we can get by
without "for each element" constructions which sound more difficult to
implement. 

Nuts to crack: 

 	* how to handle a ";" in the data itself
(escape with preceding backslash? enclose value in quotes?) Really this
will need standardising across all editors/consumers, but I'm under no
illusions about the feasibility of that!
 	* the "lanes" syntax
effectively has lists embedded in lists, using a "|" as another
separator. Can we support this with a generic syntax? Could this simply
be 2-dimensional data?

Later we could think of extended functions such
as "delete element", "append element" etc. This would open the door to
hand-constructed labels driven by the styles. I recall that there is a
maximum of 4 labels per road and this is put together somewhere in the
Java code, so it's difficult to "customise". If this can affect the
address search index, then we would be able to add alternate names etc
to the index. Imagine a multi-part road name which can be "converted" or
"cast" to a list of values, split into parts on the space character.


Example: if a road has multiple ref values, ignore all except the
first 

(highway=* & ref=* & list_count(${ref}) > 1) {set
ref=${ref[0]};} 

Example: if a road has an alt_name, add it to the list
of names: 

(highway=* & alt_name=*) {list_append name, ${alt_name};)


Example: if a road has a multipart name, add the final part as well as
the full name 

(highway=* & name=*) {set x=split(${name}, " ");}


(highway=* & name=* & list_count(x) > 1) {list_append name,
list_last(${x});} 

Colin 

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20130208/cd968b38/attachment.html 


More information about the mkgmap-dev mailing list