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

wbski
1466914
accept rate: 50%

edited 01 Feb '11, 22:34

TomH's gravatar image

TomH ♦♦
3.2k83540


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']
      ...
    end
  end

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

emj
1.9k123447
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
1

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

By RSS:

Answers

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:

×20
×3
×3

question asked: 01 Feb '11, 02:00

question was seen: 2,672 times

last updated: 02 Feb '11, 09:32

powered by OSQA