logo separator

[mkgmap-dev] [PATCH V2] stop/continue scheme extended to style-rules without conversion

From Torsten Leistikow de_muur at gmx.de on Tue Sep 1 17:36:50 BST 2009

Moin,

I have to admit, that I have didn't quite understand the processing of
the action part of the style rules, when I made the first verwion of the
patch. And I also have to admit, that I still do not really understand
it. But nevertheless the new version of the patch seems to work for me
under certain conditions.

The style syntax ist still the same as in the first version, e.g.:

highway=* & surface=concrete   {set surface=deleted; set
mkgmap_surface=paved}   [continue]

My patch now works in such a way, that this line will create a normal
rule (with priority), but will not create an element in the output
during the conversion.
The stop/continue extension will loop through the conversion, until no
more output types are found (including the empty outputs). During each
iteration of the loop the pre and postprocessing is done.

The problem now is, that I do not understand, how this processing works,
i.e. how the single actions are choosen.

This does not seem to matter, if the following condition is obeserved in
the preprocessing rules: Each action rule must modify the tags of the
element in such a way, that the condition is not fullfilled any more,
when the rule is checked again. In the above example the action "set
surface=deleted" takes care of this, afterwards the condition
"surface=concrete" will not be true any more.

So with the patch I was able to preprocess the osm-data with the
following rules, to generate a road map, which only differs between
paved and unpaved surface and is limited to roads, where motor cars ar e
allowed (see preproccessing rules below).

Gruss
Torsten

# Set highway names to include the reference if there is one
highway=* & mkmap_name_fixed!=* {name '${name} (${ref})' | '${ref}' |
'${name}' ; set mkmap_name_fixed=yes} [continue]

#set mkgmap_surface values to either paved or unpaved
highway=* & surface=paved         {set surface=deleted; set
mkgmap_surface=paved}   [continue]
highway=* & surface=unpaved       {set surface=deleted; set
mkgmap_surface=unpaved} [continue]
highway=* & surface=asphalt       {set surface=deleted; set
mkgmap_surface=paved}   [continue]
highway=* & surface=cobblestone   {set surface=deleted; set
mkgmap_surface=paved}   [continue]
highway=* & surface=concrete      {set surface=deleted; set
mkgmap_surface=paved}   [continue]
highway=* & surface=paving_stones {set surface=deleted; set
mkgmap_surface=paved}   [continue]
highway=* & surface=metal         {set surface=deleted; set
mkgmap_surface=paved}   [continue]
highway=* & surface=wood          {set surface=deleted; set
mkgmap_surface=paved}   [continue]
highway=* & surface=grass_paver   {set surface=deleted; set
mkgmap_surface=unpaved} [continue]
highway=* & surface=gravel        {set surface=deleted; set
mkgmap_surface=unpaved} [continue]
highway=* & surface=pebblestone   {set surface=deleted; set
mkgmap_surface=unpaved} [continue]
highway=* & surface=grass         {set surface=deleted; set
mkgmap_surface=unpaved} [continue]
highway=* & surface=ground        {set surface=deleted; set
mkgmap_surface=unpaved} [continue]
highway=* & surface=earth         {set surface=deleted; set
mkgmap_surface=unpaved} [continue]
highway=* & surface=dirt          {set surface=deleted; set
mkgmap_surface=unpaved} [continue]
highway=* & surface=mud           {set surface=deleted; set
mkgmap_surface=unpaved} [continue]
highway=* & surface=sand          {set surface=deleted; set
mkgmap_surface=unpaved} [continue]
highway=* & surface=ice_road      {set surface=deleted; set
mkgmap_surface=unpaved} [continue]

#set access values
highway=* & mkgmap_routing!=* & motorcar=yes
                  {set mkgmap_routing=allowed;   set access=deleted; set
bicycle=deleted; set motorcar=deleted; set motor_vehicle=deleted; set
vehicle=deleted} [continue]
highway=* & mkgmap_routing!=* & motorcar=designated
                  {set mkgmap_routing=allowed;   set access=deleted; set
bicycle=deleted; set motorcar=deleted; set motor_vehicle=deleted; set
vehicle=deleted} [continue]
highway=* & mkgmap_routing!=* & motor_vehicle=yes & motorcar!=*
                  {set mkgmap_routing=allowed;   set access=deleted; set
bicycle=deleted; set motorcar=deleted; set motor_vehicle=deleted; set
vehicle=deleted} [continue]
highway=* & mkgmap_routing!=* & vehicle=yes & motor_vehicle!=* &
motorcar!=*              {set mkgmap_routing=allowed;   set
access=deleted; set bicycle=deleted; set motorcar=deleted; set
motor_vehicle=deleted; set vehicle=deleted} [continue]
highway=* & mkgmap_routing!=* & access=yes & vehicle!=* &
motor_vehicle!=* & motorcar!=*  {set mkgmap_routing=allowed;   set
access=deleted; set bicycle=deleted; set motorcar=deleted; set
motor_vehicle=deleted; set vehicle=deleted} [continue]
highway=* & mkgmap_routing!=* & (access=* | vehicle=* | motor_vehicle=*
| motorcar=*)     {set mkgmap_routing=forbidden; set access=deleted; set
bicycle=deleted; set motorcar=deleted; set motor_vehicle=deleted; set
vehicle=deleted} [continue]
highway=* & mkgmap_routing!=*
                  {set mkgmap_routing=allowed;   set access=deleted; set
bicycle=deleted; set motorcar=deleted; set motor_vehicle=deleted; set
vehicle=deleted} [continue]
route=* & mkgmap_routing!=*
                  {set mkgmap_routing=allowed;   set access=deleted; set
bicycle=deleted; set motorcar=deleted; set motor_vehicle=deleted; set
vehicle=deleted} [continue]

# if the routing is not allowed we need not to continue
highway=* & mkgmap_routing=forbidden {set highway=ignore} [stop]
route=* & mkgmap_routing=forbidden {set route=ignore} [stop]

highway=unclassified & mkgmap_surface=unpaved  [0x16 road_class=1
road_speed=1 resolution 22]
highway=unclassified & mkgmap_surface!=unpaved [0x06 road_class=1
road_speed=4 resolution 22]

...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no_conversion_rules_2.patch
Type: text/x-patch
Size: 11508 bytes
Desc: not available
Url : http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20090901/61eec26d/attachment.bin 


More information about the mkgmap-dev mailing list