Changes between Version 165 and Version 166 of UserGuidelines/GIS/Data


Ignore:
Timestamp:
06/19/11 00:27:30 (10 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UserGuidelines/GIS/Data

    v165 v166  
    243243For GADM:
    244244{{{
    245 mkdir gadm
    246 cd gadm
     245apt-get -y install pgloader
     246mkdir GADMv1
     247cd GADMv1
    247248wget http://gadm.org/data/gadm_v1_lev0_shp.zip
    248249wget http://gadm.org/data/gadm_v1_lev1_shp.zip
     
    256257mv CSV2/gadm1_lev1.csv CSV
    257258mv CSV3/gadm_v1_lev2.csv CSV
     259# Fix encodings! http://ww.gadm.org/node/287
     260python utf8.py
     261rm -rf CSV
    258262rm -rf CSV2
    259263rm -rf CSV3
    260 # Fix encodings! http://ww.gadm.org/node/287
    261 python utf8.py
    262 su postgres
     264cat << EOF > "/home/GADMv1/pgloader.conf"
     265[pgsql]
     266host    =   localhost
     267port    =   5432
     268base    =   sahana
     269user    =   sahana
     270pass    =   eden
     271
     272client_encoding = 'utf-8'
     273
     274[ogr_tmpl]
     275template     = True
     276format       = csv
     277field_sep    = ,
     278quotechar    = "
     279trailing_sep = False
     280
     281[l1]
     282use_template    = ogr_tmpl
     283table           = public.gis_location
     284filename        = gadm1_lev0_utf8.csv
     285columns         = wkt:1, name:6, code:22, area:28
     286only_cols       = 1, 6, 22, 28
     287skip_head_lines = 1
     288
     289EOF
     290vim /usr/share/pyshared/pgloader/csvreader.py
     291csv.field_size_limit(2**20 * 100)  # 100 megs
     292
    263293pgloader
    264294}}}