Version 47 (modified by Fran Boon, 14 years ago) ( diff )


User Guidelines for GIS Data

Assumes installation of the relevant tools: InstallationGuidelinesGISData

Import Data


  1. Unzip the downloaded country file (a TAB-separated list) from
    • e.g. PK.txt
  2. Transform each line in this file into XML by regular expression:

This can be done using an RE-capable editor (e.g. Kate), Perl or even Python. Note: Need to replace & with &amp; and to remove any invalid characters

  1. Transform into S3XRC-XML using XSLT, stylesheet is available at

To Do:

  • ADM1->ADM4, PPLx to Levels L1->L4 (done)
  • Link to L1 -> L0
  • Use hierarchy.txt to link L2->L1
    • unfortunately no data for L3/L4 :/
  • Remove L2->L4 for unaffected areas


We have a stylesheet to import .osm files, but this needs work to understand the admin hierarchy properly.


Inspect the data using qGIS.

Use ogr2ogr to convert the data:

ogr2ogr -f CSV TM_WORLD_BORDERS-0.3.csv TM_WORLD_BORDERS-0.3.shp
ogr2ogr -f geojson TM_WORLD_BORDERS-0.3.json TM_WORLD_BORDERS-0.3.shp

If needing to reproject (e.g. for the Haiti Departements):

ogr2ogr -f CSV haiti_departments Haiti_departementes_edited_01132010.shp -s_srs EPSG:32618 -t_srs EPSG:4326 -lco GEOMETRY=AS_WKT

NB AS_WKT requires OGR v1.6+

Some tools for importing locations from CSV files are available in controllers/

  • These will move to controllers/


It is possible to use the WFS Plugin to get data into qGIS & thence export into other formats.

May need to use a Custom CRS (in Settings menu - remember to Save!) such as:

Can then go to the Layer Properties & Specify CRS to this User Defined Coordinate System.

Can then Save As and change the CRS to something like the standard WGS84.

Display Data


GeoServer can provide geospatial data in Raster (WMS) or Vector (WFS/KML) formats.

Once you have installed (Linux, Windows), then login:

  • l: admin
  • p: geoserver


Import Shapefiles

e.g. Country Outlines:

These can be loaded direct into GeoServer, however there will be better performance by importing into PostGIS:
(can also use pgAdmin III GUI's Shapefile loader on plugins menu)

su postgres
shp2pgsql -s 4326 -I TM_WORLD_BORDERS-0.3.shp public.countries | psql -d gis

To reproject the data into 900913 for a slight performance advantage:

drop constraint srid;
update table set geomcolumn=transform(geomcolumn,900913);

Configure GeoServer

Add WMS Layer to Sahana Eden

  • tbc


tbc: BluePrintGISGrid

Topographic Maps

Old Printed Maps

Old Printed Maps can be 'Rectified' to be overlaid on the base maps:

PostgreSQL management

  • Connect to Database (or use pgAdmin III GUI's PSQL Console on plugins menu)
    su postgres


psql -d my_spatial_db -U username
  • List Databases
  • List Tables
  • List Table structure
    \d tablename
    select field/* from tablename where field = 'value';

PostGIS functions

  • Centroids
    SELECT name, iso2, asText(ST_Transform(ST_Centroid(the_geom), 4326)) AS centroid FROM countries;

Data Sources



Attachments (12)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.