Version 31 (modified by 14 years ago) ( diff ) | ,
---|
Table of Contents
User Guidelines for GIS Data
Assumes installation of the relevant tools: InstallationGuidelinesGISData
Import Data
Geonames
- Unzip the downloaded country file (a TAB-separated list) from http://download.geonames.org/export/dump/
- e.g. PK.txt
- Transform each line in this file into XML by regular expression:
^(\d*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([0-9\.]*)\t([0-9\.]*)\t[^\t]*\t([A-Z]*).* into: <location> <id>$1</id> <name>$2</name> <asciiName>$3</asciiName> <localNames>$4</localNames> <lat>$5</lat> <lon>$6</lon> <featureClass>$7</featureClass> </location>
This can be done using an RE-capable editor (e.g. Kate), Perl or even Python. Note: Need to replace & with & and to remove any invalid characters
- 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
OpenStreetMap
We have a stylesheet to import .osm files, but this needs work to understand the admin hierarchy properly.
Shapefiles
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/bulk_gis.py
- These will move to
controllers/importer.py
Display Data
Shapefiles
e.g. Country Outlines:
Import into PostGIS (or use pgAdmin III GUI's Shapefile loader on plugins menu)
createdb gis createlang plpgsql gis psql -d gis -f /usr/share/lwpostgis.sql psql -d gis -f /usr/share/spatial_ref_sys.sql shp2pgsql -s 4326 -I TM_WORLD_BORDERS-0.3.shp public.countries | psql -U postgres -W -d gis
Get GeoServer to serve as WMS / WFS
Set up TileCache
- tbc
Add WMS Layer to Sahana Eden
- tbc
Grid
tbc: BluePrintGISGrid
Topographic Maps
- http://wiki.openstreetmap.org/wiki/Contours
- Alternate approach: SRTM 2 OSM
Old Printed Maps
Old Printed Maps can be 'Rectified' to be overlaid on the base maps:
- http://warper.geothings.net/
- http://mike.teczno.com/notes/canvas-warp.html
- http://labs.metacarta.com/rectifier/
PostgreSQL management
- Create a new spatially-enabled database:
createdb my_spatial_db createlang plpgsql my_spatial_db psql -d my_spatial_db -f /usr/share/lwpostgis.sql psql -d my_spatial_db -f /usr/share/spatial_ref_sys.sql
- Connect to Database (or use pgAdmin III GUI's PSQL Console on plugins menu)
psql -d my_spatial_db -U username
- Add Spherical Mercator projection (check http://www.cadmaps.com/gisblog/?p=81):
INSERT into spatial_ref_sys (srid, auth_name, auth_srid, srtext, proj4text) values (900913 ,'EPSG',900913,'GEOGCS["WGS 84", DATUM["World Geodetic System 1984", SPHEROID["WGS 84", 6378137.0, 298.257223563,AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], NIT["degree",0.017453292519943295], AXIS["Longitude", EAST], AXIS["Latitude", NORTH],AUTHORITY["EPSG","4326"]], PROJECTION["Mercator_1SP"],PARAMETER["semi_minor", 6378137.0], PARAMETER["latitude_of_origin",0.0], PARAMETER["central_meridian", 0.0], PARAMETER["scale_factor",1.0], PARAMETER["false_easting", 0.0], PARAMETER["false_northing", 0.0],UNIT["m", 1.0], AXIS["x", EAST], AXIS["y", NORTH],AUTHORITY["EPSG","900913"]] |','+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs');
- List Databases
\l
- List Tables
\d
- List Table structure
\d tablename select field/* from tablename where field = 'value';
- List Databases
PostGIS functions
- Centroids
SELECT name, iso2, asText(ST_Transform(ST_Centroid(the_geom), 4326)) AS centroid FROM countries;
Data Sources
- VMap0: http://en.wikipedia.org/wiki/Vector_Map
- Admin 0 & 1, Hydro features, Raster & Vector: http://www.naturalearthdata.com/
- Admin 1-4: http://geonames.org
OGC (WMS/WFS)
- http://geonetwork-opensource.org/geonetwork-nodes
- http://www.ogc-services.net
- BlueMarble & Mosaic (!LandSat7): http://onearth.jpl.nasa.gov/
- Hazard Layers: http://preview.grid.unep.ch:8080/geoserver/ows?service=WMS&request=GetCapabilities
- Hazard Layers: http://www.pdc.org/mde/services.jsp
- Massachusetts: http://lyceum.massgis.state.ma.us/wiki/doku.php
Attachments (12)
-
srtm.sld
(2.5 KB
) - added by 14 years ago.
Official SRTM styling
-
topography.sld
(2.1 KB
) - added by 14 years ago.
Common Topography styling
-
get.sh
(48.9 KB
) - added by 14 years ago.
Script to download SRTMv4 GeoTIFFs
-
utf8.py
(1.0 KB
) - added by 13 years ago.
Encode GADM as UTF8
-
geowebcache.xml
(9.5 KB
) - added by 13 years ago.
Configuration for GADM
-
gadm_v1_lev0_base_sld.xml
(7.5 KB
) - added by 13 years ago.
SLD for GADM L0 Base Layer
-
gadm_v1_lev0_overlay_sld.xml
(12.5 KB
) - added by 13 years ago.
SLD for GADM L0 Overlay
-
gadm_v1_lev1_overlay_sld.xml
(12.0 KB
) - added by 13 years ago.
SLD for GADM L1 Overlay
-
gadm_v1_lev2_overlay_sld.xml
(12.4 KB
) - added by 13 years ago.
SLD for GADM L2 Overlay
-
populationDensity.sld
(1.4 KB
) - added by 13 years ago.
GPWv3 SLD
-
moveWKT.py
(1.0 KB
) - added by 11 years ago.
Move WKT column to end of CSV
- KML2WKT.py (1.9 KB ) - added by 11 years ago.
Download all attachments as: .zip