Changes between Initial Version and Version 1 of UserGuidelines/GIS/Data


Ignore:
Timestamp:
05/26/10 21:57:46 (14 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UserGuidelines/GIS/Data

    v1 v1  
     1== User Guidelines for GIS Data ==
     2Assumes installation of the relevant tools: [wiki:InstallationGuidelinesGISData]
     3=== Display Shapefile as Overlay Layer in Sahana Eden ===
     4e.g. Country Outlines:
     5 * http://thematicmapping.org/downloads/TM_WORLD_BORDERS-0.3.zip
     6
     7Import into PostGIS (or use pgAdmin III GUI's Shapefile loader on plugins menu)
     8{{{
     9createdb my_spatial_db
     10createlang plpgsql my_spatial_db
     11psql -d my_spatial_db -f /usr/share/lwpostgis.sql
     12psql -d my_spatial_db -f /usr/share/spatial_ref_sys.sql
     13shp2pgsql -s 4326 -I TM_WORLD_BORDERS-0.3.shp public.countries | psql -U postgres -W -d my_spatial_db
     14}}}
     15Get !GeoServer to serve as WMS
     16 * ''tbc''
     17Set up !TileCache
     18 * ''tbc''
     19Add WMS Layer to Sahana Eden
     20 * ''tbc''
     21=== Convert Shapefile to an importable format ===
     22{{{
     23ogr2ogr -f CSV TM_WORLD_BORDERS-0.3.csv TM_WORLD_BORDERS-0.3.shp
     24ogr2ogr -f geojson TM_WORLD_BORDERS-0.3.json TM_WORLD_BORDERS-0.3.shp
     25}}}
     26
     27=== PostgreSQL management ===
     28 * Connect to Database (or use pgAdmin III GUI's PSQL Console on plugins menu)
     29{{{
     30psql -d my_spatial_db -U username
     31}}}
     32 * List Databases
     33{{{
     34\l
     35}}}
     36 * List Tables
     37{{{
     38\d
     39}}}
     40 * List Table structure
     41{{{
     42\d tablename
     43select field/* from tablename where field = 'value';
     44}}}
     45
     46=== PostGIS functions ===
     47 * Centroids
     48{{{
     49SELECT name, iso2, asText(ST_Transform(ST_Centroid(the_geom), 4326)) AS centroid FROM countries;
     50}}}
     51----
     52UserGuidelines