`
cyhcheng
  • 浏览: 60293 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

install,create and usetemplate database

    博客分类:
  • gis
 
阅读更多

sudo apt-get install ubuntu-desktop

 

sudo apt-get install rar unrar scim

sudo add-apt-repository ppa:ferramroberto/java

sudo apt-get update

sudo apt-get install sun-java6-bin sun-java6-fonts sun-java6-jdk sun-java6-plugin sun-java6-jre

sudo update-alternatives --config java

 

sudo apt-get install postgresql-9.1 postgis postgresql-9.1-postgis postgresql-server-dev-9.1 postgresql-contrib-9.1 qgis qgis-common pgadmin3 gdal-bin binutils

sudo -u postgres psql postgres

alter user postgres with encrypted password 'new password';

\q

 

sudo vi /etc/environment

JAVA_HOME="/usr/lib/jvm/java-6-sun"
CATALINA_HOME="/home/yinghua/tools/apache-tomcat-6.0.35"
PATH="$JAVA_HOME/bin:$CATALINA_HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/postgresql/9.1/bin"

:wq

source /etc/environment

 

sudo -u postgres createdb -E UTF8 template_postgis
sudo -u postgres createlang -d template_postgis plpgsql
sudo -u postgres psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';"
sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql
sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql
sudo -u postgres psql -d template_postgis -c "grant all on geometry_columns to public;"
sudo -u postgres psql -d template_postgis -c "grant all on geography_columns to public;"
sudo -u postgres psql -d template_postgis -c "grant all on spatial_ref_sys to public;"

 

sudo -u postgres createdb -T template_postgis mydb

 

//sudo -u postgres psql -d mydb -f sample.sql

sudo -u postgres psql -f sample.sql mydb

sudo -u postgres psql mydb

select postgis_lib_version();

select postgis_full_version();
select version();


 postgis_lib_version
---------------------
 1.5.3
(1 row)

 

postgis_full_version()

----------------------

"POSTGIS="1.5.3" GEOS="3.3.2-CAPI-1.7.2" PROJ="Rel. 4.7.1, 23 September 2009" LIBXML="2.7.8" USE_STATS"

 

 

version

---------------------

"PostgreSQL 9.1.3 on x86_64-pc-linux-gnu, compiled by gcc-4.6.real (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1, 64-bit"

 

分享到:
评论
4 楼 cyhcheng 2012-08-16  
http://demo.geo-solutions.it/share/github/geoserver/genindex.html
3 楼 cyhcheng 2012-08-09  
入门学习站点:http://ian01.geog.psu.edu/geoserver_docs/data/naturalearth/index.html
2 楼 cyhcheng 2012-07-04  
openscales(actionscript3) ~~ openlayers
1 楼 cyhcheng 2012-04-16  
shp2pgsql -s <SRID> <shapefile> <tablename> <db_name> > filename.sql

pgsql2shp -f sample.shp  mydb  sample_table

相关推荐

    JavaScript Applications with Node.js, React, React Native and MongoDB

    6.1 Create the Database and Collection 6.2 Data Model Document Design 6.3Trving Out Some Queries 5.4Indexing Policy 6.5Moving On Chapter 7: DevOps for MongoDB 7.1Monitoring through the Atlas ...

    ASP.NET Core 1.1 For Beginners: How to Build a MVC Website

    * Add and modify models, views and controllers to perform CRUD operations against the database. * Use client-side and server-side validation. * Secure the controllers, actions and view content with ...

    drupal 6.12

    about privileges, and instructions to create a database using the command line are available in INSTALL.mysql.txt (for MySQL) or INSTALL.pgsql.txt (for PostgreSQL). To create a database using ...

    Agile Web Development with Rails Final

    - On macOS, developers typically use Homebrew to install Ruby and Rails. Additional steps include setting up `rbenv` or `rvm` for managing Ruby versions and gems. 3. **Installing on Unix/Linux:** -...

    postgis-3.2.pdf

    - **从模板创建空间数据库 (Create a spatially-enabled database from a template)** - **升级空间数据库 (Upgrading spatial databases)** - **软升级 (Soft upgrade)** - **适用于 9.1+ 的扩展模型 (Soft ...

    python3.6.5参考手册 chm

    PEP 471 - os.scandir() function – a better and faster directory iterator PEP 475: Retry system calls failing with EINTR PEP 479: Change StopIteration handling inside generators PEP 485: A function...

    FastReport.v4.15 for.Delphi.BCB.Full.Source企业版含ClientServer中文修正版支持D4-XE5

    Current version allows preview, print and design report template under Windows and Linux platform (qt). + Added Embarcadero RAD Studio XE3 support - fixed compatibility with Fast Report FMX installed...

    Laravel开发-chat

    use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateMessagesTable extends Migration { public function up() { ...

    mycat单库分表6-13.docx

    create database xf_shanding; ``` 通过以上步骤,我们完成了Mycat的安装配置以及通过Mycat管理MySQL数据库的基本流程。这为后续实现单库分表打下了坚实的基础。需要注意的是,实际部署过程中还需要进一步优化...

    rsyslog + mysql 入库配置

    CREATE DATABASE SystemLogs; USE SystemLogs; CREATE TABLE SystemEvents ( ID INT AUTO_INCREMENT PRIMARY KEY, Message TEXT NOT NULL, Facility VARCHAR(50), FromHost VARCHAR(255), Priority INT, ...

    EurekaLog_7.5.0.0_Enterprise

    4)....Added "--el_injectjcl", "--el_createjcl", and "--el_createdbg" command-line options for ecc32/emake to inject JEDI/JCL debug info, create .jdbg file, and create .dbg file (Microsoft debug format...

    Digging into WordPress.pdf

    9.4.4 Backing Up Your Database and Files ..............................................357 9.5.1 Optimizing WordPress ...........................................358 9.5.2 Content and File Caching .......

    MySQL 5.6 Reference Manual

    Table of Contents Preface, Notes, Licenses . . . . . . . . ....1. Licenses for Third-Party Components ....1.1. FindGTest.cmake License ....1.2. LPeg Library License ....1.3. LuaFileSystem Library License ....

Global site tag (gtag.js) - Google Analytics