Advertisement
asanchez75

postgis

Mar 28th, 2012
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. Installation postgis in debian squeeze for postgresql-8.4
  2.  
  3. 1. Install java
  4. sun-java6-jdk
  5.  
  6. 2. Install tomcat
  7. tomcat6
  8. tomcat6-common
  9. tomcat6-docs
  10. tomcat6-admin
  11.  
  12. 3. Install geoserver
  13. Download geoserver.war de http://geoserver.org/ y put within /var/lib/tomcat6/webapps
  14. ir a http://localhost:8080/manager to run. Next, go to http://localhost:8080/geoserver/ with user=admin y password = geoserver to enter to content administration system.
  15.  
  16. 4. Install postgis
  17. postgis->1.5.1-5
  18. postgresql-8.4-postgis
  19.  
  20. 5. Install libraries for running postgis
  21. libproj-dev-4.7.0-1
  22. libgeos-c1->3.2.0-1
  23. libgeos-3.2.0-> 3.2.0-1
  24. libgeos-doc->3.2.0-1
  25.  
  26. 6. Initializing db
  27. createlang yourdatabase;
  28. createlang plpgsql yourdatabase;
  29.  
  30. 7. Load postgis tables to postgres db
  31. cd /usr/share/postgresql/8.4/contrib/postgis-1.5
  32. psql -d yourdatabase -f postgis.sql
  33. psql -d yourdatabase -f spatial_ref_sys.sql
  34.  
  35. You may also want to install the comments to your shiny new functions (optional). In Debian Squeeze the install file lies in the /contrib main directory:
  36.  
  37. cd /usr/share/postgresql/8.4/contrib
  38. psql -d yourdatabase -f postgis_comments.sql
  39.  
  40. Last parts were taken from http://stackoverflow.com/questions/8459361/postgis-install
  41.  
  42. ========================================================================================
  43. Publication of contents using QGis (Quantum GIS) to table 'yourdatabase'
  44.  
  45. 1. sudo apt-get install qgis
  46. 2. Enable plugin called SPIT within QGis
  47.  
  48. [only important for me: 1. load table CIMAS, 2. load table SITIOS]
  49.  
  50. =======================================================================================
  51.  
  52. Publication of contents to geoserver
  53. (Do no forget using proj = 4326)
  54.  
  55. 1. Add workspace
  56. 2. Add storage
  57. 3. Add layer
  58.  
  59. =======================================================================================
  60. Increase memory
  61. http://codintips.blogspot.com/2010/01/add-more-jvm-memory-in-tomcat-on-ubuntu.html
  62.  
  63. /var/lib/tomcat6/conf
  64.  
  65. =======================================================================================
  66. http://gis.stackexchange.com/questions/7803/bulk-load-multiple-shapefiles-into-postgis
  67. http://stackoverflow.com/questions/965053/extract-filename-and-extension-in-bash
  68.  
  69. #!/bin/bash
  70. for f in *.shp
  71. do
  72. shp2pgsql $f public.`basename $f .shp` > `basename $f .shp`.sql
  73. done
  74.  
  75.  
  76. #!/bin/bash
  77. for f in *.sql
  78. do
  79. psql -h localhost -d template_postgis -U postgres -f $f
  80. done
  81.  
  82. =============================================================
  83. http://postgis.refractions.net/docs/DropGeometryTable.html
  84.  
  85. select DropGeometryTable('ecosistemas', 'andes_tropicales');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement