User:Wkentaur/drafts

Tools

edit

batch job scheduling

edit

psql

edit
psql -h sql-mapnik osm_mapnik

example queries

edit
SELECT tags
   FROM planet_point
  WHERE
    (tags ? 'wikipedia') AND
    way && ST_Transform(ST_SetSRID(ST_MakeBox2D(
      ST_Point(8.17,50.04),
      ST_Point(8.36,49.95)
    ), 4326),900913);


count wikipedia keys inside box in Russia

SELECT count(*)
   FROM planet_point
  WHERE
    (tags ? 'wikipedia') AND
    way && ST_Transform(ST_SetSRID(ST_MakeBox2D(
      ST_Point(28,68),
      ST_Point(78,45)
    ), 4326),900913);

OSM: key:wikipedia
OSM: key:name

same article names are sometimes used 20+ times in OSM (http://tagstat.hypercube.telascience.org/tagdetails.php?tag=wikipedia)

statistics

edit
  • number of 'wikipedia' tags in OSM:
    • July 5, 2010: used on 34077 points, 32424 lines, 37759 polygons
    • only few of 'wikipedia' tags are located in Russia

importing Estonian place names from et.wikipedia to OSM

edit


select POIs with 'wikipedia' key set and where 'name:et' is not set from OSM-db-s (planet_point, planet_line, planet_polygon)

    • no need to process POIs from Estonia
    • also some 'wikipedia:xxx' keys are used


make temp-db from those POI-s

check POIs for errors, double entries for same articles etc

    • how to discard something like "wikipedia"=>"Lake"??



get corresponding article title in estonian Wikipedia and info about article type (city, river etc) from Wikipedia-db, and add it to temp-db

    • should also check if Wikipedia article is about a person, but how?
    • the article name should also be read from the head of article wikitext '''article name is in bold''', there can also be multiple article names



get estonian POI name from article title


save POI name:et to OSM via OSM-API (?)

    • check if POI's name:et already exists
    • do not add 'name:et' if it's the same as 'name'

also in general it's not needed to add the name:et, if the source language uses Latin alphabet