Changes between Version 20 and Version 21 of UserGuidelines/GIS/Data
- Timestamp:
- 08/20/10 07:04:02 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UserGuidelines/GIS/Data
v20 v21 6 6 1. Unzip the downloaded country file (a TAB-separated list) from http://download.geonames.org/export/dump/ 7 7 * e.g. PK.txt 8 2. T urn each line into XML by regular expression:8 2. Transform each line in this file into XML by regular expression: 9 9 {{{ 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 11 13 into: 14 12 15 <location> 13 16 <id>$1</id> … … 17 20 <lat>$5</lat> 18 21 <lon>$6</lon> 22 <featureClass>$7</featureClass> 19 23 </location> 24 20 25 }}} 21 3. Replace & with &, remove any invalid characters 22 4. Transform into S3XRC using XSLT 26 27 This can be done using an RE-capable editor (e.g. Kate), Perl or even Python. 28 Note: Need to replace & with & 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] 23 32 24 33 To Do: 25 * ADM1 -> ADM4 to Levels L1->L434 * ~~ADM1->ADM4, PPLx to Levels L1->L4~~ (done) 26 35 * Link to L1 -> L0 27 36 * Use hierarchy.txt to link L2->L1