Author Topic: Custom theme with attribute filtering  (Read 2808 times)

Offline dimmel

  • Newbie
  • *
  • Posts: 5
    • View Profile
Custom theme with attribute filtering
« on: June 24, 2012, 12:11:33 »
Hi,

I am using these vector maps here which work great: viewtopic.php?f=40&t=2066
One thing I am interested in are drinking water locations for outdoor activities. Christian's template already includes the "drinking_water" amenity. But there are also other sources for drinking water: "natural"+"spring" and "amenity"+"fountain". These can have the attribute "drinking_water" as well.

Is it possible to show only "springs" and fountains which have the attribute "drinking_water"?
The xml code for a spring looks like this at the moment:
Code: [Select]
<rule e="node" k="natural" v="spring" zoom-min="14" zoom-max="20">
 <symbol src="file:/symbols/spring_32.png" />
</rule>

Regards,
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline jusc

  • Global Moderator
  • Professor of Locus
  • *****
  • Posts: 1896
  • Thanked: 19 times
    • View Profile
  • Device: Samsung Galaxy S2 and Note 2
Re: Custom theme with attribute filtering
« Reply #1 on: June 24, 2012, 13:27:45 »
Can you post one or two examples as screenshots and the coordinates of a spring which should be shown and which not. I can try to figure it out.
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Regards J.
 

Offline dimmel

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Custom theme with attribute filtering
« Reply #2 on: June 24, 2012, 14:02:05 »
Some more research revealed that it is not possible to filter by attribute as I need it because only "|" (concat) is supported: http://code.google.com/p/mapsforge/wiki/RenderThemeAPI

But I can show all drinking water POIs using this:
Code: [Select]
<rule e="node" k="drinking_water" v="yes" zoom-min="14" zoom-max="20">

Better would be support for an "AND" operator (not working) [1]:
Code: [Select]


<rule e="node" k="natural" v="spring" zoom-min="14" zoom-max="20">
  <rule e="node" k="drinking_water" v="yes" zoom-min="14" zoom-max="20" />
</rule>

I will file this as a feature request to mapsforge people.

[1] http://wiki.openstreetmap.org/wiki/Osma ... .3Crule.3E
« Last Edit: January 01, 1970, 01:00:00 by Guest »