== User Guidelines for GIS Data == Assumes installation of the relevant tools: [wiki:InstallationGuidelinesGISData] === Display Shapefile as Overlay Layer in Sahana Eden === 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 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 shp2pgsql -s 4326 -I TM_WORLD_BORDERS-0.3.shp public.countries | psql -U postgres -W -d my_spatial_db }}} Get !GeoServer to serve as WMS * ''tbc'' Set up !TileCache * ''tbc'' Add WMS Layer to Sahana Eden * ''tbc'' === Convert Shapefile to an importable format === {{{ 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 Grid as Overlay Layer in Sahana Eden === Grid types * Lat/Lon * UTM/MGRS (NB These aren't regular!) Options: * WMS * http://earth-info.nga.mil/GandG/coordsys/gislayers/gislayers.html * KML * PHP code to create (inaccurate?): http://www.nearby.org.uk/google.html#17 * Offline version: http://www.nearby.org.uk/blog/2007/06/19/mgrs-layer-for-google-earth-offline/ * !TileCache * http://github.com/migurski/GridTile * Grid only at Low Resolutions * Grid fails in SphericalMercator MGRS calculations in JS: * http://haiticrisismap.org/js/usng2.js === 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; }}} ---- [wiki:UserGuidelinesGIS] UserGuidelines