[OSM-dev] Some hacks for wikipedia

James Mike DuPont jamesmikedupont at googlemail.com
Thu Jul 23 17:00:29 BST 2009


Hi all,
Here are some hacks I made for wikipedia, kml2osm and all.
It could be better, and dont worry about those 10 points I added.

http://www.openstreetmap.org/user/h4ck3rm1k3/diary/7188

So,
I found out yesterday that I dont need to parse the whole wikipedia to 
get the points.
http://www.webkuehn.de/hobbys/wikipedia/geokoordinaten/Wikipedia_en_2008-03-12.zip

So, now I have split that file by the area of interest.
First I parsed out my kosovo boundries file and extracte d the min/max 
of lat and lon.

http://bazaar.launchpad.net/%7Ejamesmikedupont/%2Bjunk/openstreetmap-wikipedia/revision/2/extract.pl#extract.pl

using the openstreetmapkosova/kosovaadmin.osm from my osm branch, also 
in lp.

This produced :
LAT Avg 42.3764065194805
cnt 539
Min 41.8534278
Max 43.2723636
size 1.4189358

LON Avg 20.9177833755102
cnt 539
Min 20.0722732
Max 21.8005791
size 1.7283059

I modified those coords, and used my stripkml to extract all the points 
in that box :
http://bazaar.launchpad.net/%7Ejamesmikedupont/%2Bjunk/openstreetmap-wikipedia/revision/2/stripkml.pl

Then I used kml2osm from here
http://osmlib.rubyforge.org/ http://rubyforge.org/projects/osmlib/

The modified version is for the wikipedia points only.
You need to run it with the exisiting osmlib, i run it in the examples dir.
http://bazaar.launchpad.net/%7Ejamesmikedupont/%2Bjunk/openstreetmap-wikipedia/revision/4/kml2osm

Here is the result:
http://bazaar.launchpad.net/%7Ejamesmikedupont/%2Bjunk/openstreetmap-wikipedia/revision/4/KosovoWP.osm

Here is my changeset, uploaded with josm.
http://www.openstreetmap.org/browse/changeset/1911214

Now I would like to have a way to process the wikipedia
data in chunks like this. There should be a way to extract just parts of 
the zipfile or bz2 file.

Thanks,
mike


mike




More information about the dev mailing list