User:Wkentaur/drafts
(Redirected from User:WikedKentaur/drafts)
Tools
editbatch job scheduling
editpsql
editpsql -h sql-mapnik osm_mapnik
- http://wiki.openstreetmap.org/wiki/Osm2pgsql/schema OSM database schema
- Maps-l: introduction: the new osm database
example queries
editSELECT 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
editOSM: 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 'name:et' tags in OSM:
- July 5, 2010: used on 387 points, 1069 lines, 585 polygons
- see also: http://tagstat.hypercube.telascience.org/tagdetails.php?tag=name:et
- 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
- no need to process POIs from Estonia
make temp-db from those POI-s
check POIs for errors, double entries for same articles etc
- how to discard something like "wikipedia"=>"Lake"??
- 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
- should also check if Wikipedia article is about a person, but how?
get estonian POI name from article title
- drop disambiguation part from title, disamig. between braces: ()
- discard urls to sections like http://fi.wikipedia.org/wiki/Joensuun_rannat#Vehkalahden_uimaranta
- make some sanity checks by comparing POI type from OSM and article type from Wikipedia
- drop disambiguation part from title, disamig. between braces: ()
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'
- check if POI's name:et already exists
also in general it's not needed to add the name:et, if the source language uses Latin alphabet