Why not ask your question on the new OpenStreetMap Community Forum?

I was using the OSMLib osmexport function to produce KML maps of ski areas, when I discovered a problem. The oxr style file doesn't like tags with a semicolon in it it seems and it won't take the tag like this either: 'piste:downhill'

My style file is at: http://www.skimap.org/files/kml-openskimap.oxr And sample data at: http://www.skimap.org/data/28/osm/xml/2011-01-31.osm

Any suggestions? Thanks!

This question is marked "community wiki".

asked 01 Feb '11, 02:00

wbski's gravatar image

accept rate: 50%

edited 01 Feb '11, 22:34

TomH's gravatar image

TomH ♦♦

If the tag key is not a valid Ruby word, i.e. if it contains other characters than alpahnumerics and the underscore, you‘ll have to use the following syntax:

  # EDIT: changed "nodes do" to "ways do"
  ways do
    if tags['piste:type']

This is copy paste from osmlib rules documentation for exports, I use Osmium (also from Jochen) so I can't really tell you if you are doing stuff the right way, for the record osmium isn't at all suited for what you want to do.

permanent link

answered 01 Feb '11, 08:30

emj's gravatar image

accept rate: 15%

edited 02 Feb '11, 09:32

But what if I want to select ways where piste:type=downhill? Your syntax only checks for the existence of the key, not the key value pair. Any idea how to do this?

(01 Feb '11, 23:11) wbski

I would guess you would do "tags['piste:type'] == 'emjpipe'" and I believe you have to iterate ways on their own just change nodes to ways in that code.

(02 Feb '11, 09:27) emj
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 01 Feb '11, 02:00

question was seen: 3,485 times

last updated: 02 Feb '11, 09:32

powered by OSQA