Changes between Version 52 and Version 53 of UserGuidelines/GIS/Data


Ignore:
Timestamp:
09/04/10 08:49:28 (14 years ago)
Author:
Fran Boon
Comment:

Geonames update to use S3GIS

Legend:

Unmodified
Added
Removed
Modified
  • UserGuidelines/GIS/Data

    v52 v53  
    55== Import Data ==
    66=== 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:
     7There 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
     9It 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
     11NB It takes some time to do this import! Pakistan imports 95000 locations!
     12
     13In Web2py CLI:
     14{{{
     15gis.import_geonames('PK', 'L5')
     16db.commit()
     17}}}
     18
     19Alternate approach:
     20 1. Transform each line in this file into XML by regular expression:
    1021{{{
    1122
     
    2940Note: Need to replace & with & and to remove any invalid characters
    3041
    31  3. Transform into S3XRC-XML using XSLT, stylesheet is available at
     42 2. Transform into S3XRC-XML using XSLT, stylesheet is available at
    3243   * [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 -> L0
    37  * Use hierarchy.txt to link L2->L1
    38   * unfortunately no data for L3/L4 :/
    39  * Remove L2->L4 for unaffected areas
    4044=== !OpenStreetMap ===
    4145We 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.