Changes between Version 20 and Version 21 of UserGuidelines/GIS/Data


Ignore:
Timestamp:
08/20/10 07:04:02 (15 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UserGuidelines/GIS/Data

    v20 v21  
    66 1. Unzip the downloaded country file (a TAB-separated list) from http://download.geonames.org/export/dump/
    77  * e.g. PK.txt
    8  2. Turn each line into XML by regular expression:
     8 2. Transform each line in this file into XML by regular expression:
    99{{{
    10 ^(\d*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([0-9\.]*)\t([0-9\.]*).*
     10
     11^(\d*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([0-9\.]*)\t([0-9\.]*)\t[^\t]*\t([A-Z]*).*
     12
    1113into:
     14
    1215<location>
    1316       <id>$1</id>
     
    1720       <lat>$5</lat>
    1821       <lon>$6</lon>
     22       <featureClass>$7</featureClass>
    1923</location>
     24
    2025}}}
    21  3. Replace & with &amp;, remove any invalid characters
    22  4. Transform into S3XRC using XSLT
     26
     27This can be done using an RE-capable editor (e.g. Kate), Perl or even Python.
     28Note: Need to replace & with &amp; and to remove any invalid characters
     29
     30 3. Transform into S3XRC-XML using XSLT, stylesheet is available at
     31   * [http://pub.nursix.org/eden/geonames/geonames.xsl]
    2332
    2433To Do:
    25  * ADM1 -> ADM4 to Levels L1->L4
     34 * ~~ADM1->ADM4, PPLx to Levels L1->L4~~ (done)
    2635 * Link to L1 -> L0
    2736 * Use hierarchy.txt to link L2->L1