OsmLib Ruby Export KML Polygons
I have been trying to figure out, is it possible to produce KML polygons from OSM areas with the OSMLib ruby? I have already made quite a few modifications to the ruby source to fit my needs, but I still can't get this part to work..
In the osmlib-base-0.1.4/lib folder, in objects.rb, I added:
def geometry
polygon ** Updated code below
if tags['area'] ((tags['area'] == 'yes' && is_closed?) || (tags['area'] != 'no' && is_closed?
is_closed?))
polygon
else
linestring
end
Replacing what was previously just:
def geometry
linestring
end
That didn't seem to do the trick (there is already some geometry polygon code in the KML output, but obviously not enough! I don't know much at all about Ruby (this project is the first time I have used ruby at all!). Anyone have some tips/want to help implement this? I am sure this could get implemented properly and would be of use to people.