Changes between Version 52 and Version 53 of UserGuidelines/GIS/Data
- Timestamp:
- 09/04/10 08:49:28 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UserGuidelines/GIS/Data
v52 v53 5 5 == Import Data == 6 6 === Geonames === 7 1. Unzip the downloaded country file (a TAB-separated list) from http://download.geonames.org/export/dump/ 8 * e.g. PK.txt 9 2. Transform each line in this file into XML by regular expression: 7 There is an import_geonames() function in S3GIS which downloads/unzips the country file (a TAB-separated list) from http://download.geonames.org/export/dump/ 8 9 It should be run for the different level sof hierarchy that you wish to import (generally just the lowest level as Geonames just has Point data, so it's best to use other sources for the Polygons 1st, that way the Geonames importer can locate these Points within the correct Polygons of the hierarchy) 10 11 NB It takes some time to do this import! Pakistan imports 95000 locations! 12 13 In Web2py CLI: 14 {{{ 15 gis.import_geonames('PK', 'L5') 16 db.commit() 17 }}} 18 19 Alternate approach: 20 1. Transform each line in this file into XML by regular expression: 10 21 {{{ 11 22 … … 29 40 Note: Need to replace & with & and to remove any invalid characters 30 41 31 3. Transform into S3XRC-XML using XSLT, stylesheet is available at42 2. Transform into S3XRC-XML using XSLT, stylesheet is available at 32 43 * [http://pub.nursix.org/eden/geonames/geonames.xsl] 33 34 To Do:35 * ~~ADM1->ADM4, PPLx to Levels L1->L4~~ ([http://pub.nursix.org/eden/geonames/pakistan.zip done])36 * Link to L1 -> L037 * Use hierarchy.txt to link L2->L138 * unfortunately no data for L3/L4 :/39 * Remove L2->L4 for unaffected areas40 44 === !OpenStreetMap === 41 45 We have an XSLT [http://eden.sahanafoundation.org/browser/static/xslt/import/osm.xsl stylesheet] to import .osm files, but this needs work to understand the admin hierarchy properly.