= User Guidelines for GIS Data = Assumes installation of the relevant tools: [wiki:InstallationGuidelinesGISData] == Import Data == Some tools for importing locations from CSV files are available in {{{controllers/bulk_gis.py}}} === Geonames === 1. Unzip the downloaded country file (a TAB-separated list) from http://download.geonames.org/export/dump/ * e.g. PK.txt 2. 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: $1 $2 $3 $4 $5 $6 $7 }}} 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 3. Transform into S3XRC-XML using XSLT, stylesheet is available at * [http://pub.nursix.org/eden/geonames/geonames.xsl] To Do: * ~~ADM1->ADM4, PPLx to Levels L1->L4~~ ([http://pub.nursix.org/eden/geonames/pakistan.zip done]) * Link to L1 -> L0 * Use hierarchy.txt to link L2->L1 * unfortunately no data for L3/L4 :/ * Remove L2->L4 for unaffected areas === Shapefiles === {{{ 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 [https://www.geoint-online.net/community/haitiearthquake/Geospatial%20Data%20Files/haiti_departments01132010.zip 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+ == Display Data == === Shapefiles === e.g. Country Outlines: * http://thematicmapping.org/downloads/TM_WORLD_BORDERS-0.3.zip 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 * ''tbc'' Set up !TileCache * ''tbc'' Add WMS Layer to Sahana Eden * ''tbc'' === Grid === ''tbc'': [wiki:BluePrintGISGrid] === Topographic Maps === * http://wiki.openstreetmap.org/wiki/Contours * Uses [http://wiki.openstreetmap.org/wiki/SRTM SRTM] ([http://wiki.openstreetmap.org/wiki/ASTER ASTER] is a future possibility) * Alternate approach: [http://wiki.openstreetmap.org/wiki/Srtm2Osm 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 * Code: http://github.com/migurski/canvas-warp * http://labs.metacarta.com/rectifier/ == PostgreSQL management == * Connect to Database (or use pgAdmin III GUI's PSQL Console on plugins menu) {{{ psql -d my_spatial_db -U username }}} * List Databases {{{ \l }}} * List Tables {{{ \d }}} * 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 === * 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 ---- [wiki:UserGuidelinesGIS] [wiki:DeveloperGuidelinesGIS] UserGuidelines