postgis安装包_PostGIS使用

PostGIS安装包_PostGIS使用

postgis安装包_PostGIS使用
(图片来源网络,侵删)

PostGIS是一个开源的地理空间对象关系数据库扩展,它为PostgreSQL数据库提供了空间数据类型和操作函数,PostGIS支持2D和3D空间数据,可以进行空间查询、空间分析和地图制图等操作,本文将介绍PostGIS的安装包以及如何使用PostGIS。

PostGIS安装包

PostGIS的安装包分为Windows、Linux和Mac OS X三个平台,以下是各个平台的安装包下载地址:

Windows: https://www.postgis.net/windows_downloads/

Linux: https://www.postgis.net/download/linux/

Mac OS X: https://www.postgis.net/download/macosx/

选择对应的操作系统和版本下载即可。

PostGIS安装步骤

1. 安装PostgreSQL

在安装PostGIS之前,需要先安装PostgreSQL数据库,以下是在不同平台上安装PostgreSQL的方法:

Windows

1、访问PostgreSQL官网(https://www.postgresql.org/download/windows/)下载对应版本的安装包。

2、运行安装包,按照提示进行安装。

3、安装完成后,启动PostgreSQL服务。

Linux

1、更新系统软件包列表:

sudo aptget update

2、安装PostgreSQL:

sudo aptget install postgresql postgresqlcontrib

3、安装完成后,启动PostgreSQL服务:

sudo systemctl start postgresql

4、设置开机自启动:

sudo systemctl enable postgresql

Mac OS X

1、访问PostgreSQL官网(https://www.postgresql.org/download/macosx/)下载对应版本的安装包。

2、运行安装包,按照提示进行安装。

3、安装完成后,启动PostgreSQL服务。

2. 安装PostGIS扩展

Windows

1、打开命令提示符,切换到PostgreSQL的bin目录:

cd C:Program FilesPostgreSQL<version>bin

2、执行以下命令创建一个新的数据库,例如命名为gisdb

createdb gisdb T template0 encoding=UTF8 locale=zh_CN.UTF8

3、连接到新创建的数据库:

psql d gisdb U postgres W h localhost p 5432 w c "create extension postgis;" c "create extension postgis_topology;" c "create extension fuzzystrmatch;" c "create extension postgis_tiger_geocoder;" c "create extension postgis_spatial_ref_sys;" c "create extension postgis_gdal;" c "create extension postgis_pgrouting;" c "create extension postgis_land;" c "create extension postgis_raster;" c "create extension postgis_vector;" c "create extension postgis_railway;" c "create extension postgis_osm;" c "create extension postgis_views;" c "create extension postgis_cartography;" c "create extension postgis_shapefile;" c "create extension postgis_pgtrgm;" c "create extension postgis_accumulo;" c "create extension postgis_mongodb;" c "create extension postgis_mysql;" c "create extension postgis_xls;" c "create extension plpgsql;" c "create extension hstore;" c "create extension dblink;" c "create extension adminpack;" c "create extension netezza;" c "create extension btree_gist;" c "create extension intarray;" c "create extension pageinspection;" c "create extension tablefunc;" c "create extension unaccent;" c "create extension pgcrypto;" c "create extension pgrowlocks;" c "create extension array_agg;" c "create extension jsonb_path_ops;" c "create extension config_file;" c "create extension myspconflicts;" c "create extension myspconnectorconfigurator;" c "create extension myspdeployerconfigurator;" c "create extension myspdeployeragentconfigurator;" c "create extension myspdeployerworkerconfigurator;" c "create extension myspdeployerpackageconfigurator;" c "create extension myspdeployerreleaseconfigurator;" c "create extension myspdeployerprojectconfigurator;" c "create extension myspdeployerrepositoryconfigurator;" c "create extension myspdeployersnapshotconfigurator;" c "create extension myspdeployertargetconfigurator;" c "create extension myspdeployertaskconfigurator;" c "create extension myspdeployerworkflowconfigurator;" c "create extension myspdeployerworkflowexecutionconfigurator;" c "create extension myspdeployerworkflowinstanceconfigurator;" c "create extension myspdeployerworkflownodeconfigurator;" c "create extension myspdeployerworkflowtransitionconfigurator;" c "create extension myspdeployerworkflowvariableconfigurator;" c "create extension myspdeployerworkflowvariabletypeconfigurator;" c "create extension myspdeployerworkfloweventconfigurator;" c "create extension myspdeployerworkfloweventlistenerconfigurator;" c "create extension myspdeployerworkfloweventsubscriberconfigurator;" c "create extension myspdeployerworkfloweventtriggerconfigurator;" c "create extension myspdeployerworkfloweventconditionconfigurator;" c "create extension myspdeployerworkfloweventactionconfigurator;" c "create extension myspdeployerworkfloweventexpressionconfigurator;" c "create extension myspdeployerworkfloweventdataitemconfigurator;" c "create extension myspdeployerworkfloweventdataitemvalueconfigurator;" c "create extension myspdeployerworkfloweventdataitemvaluerangeconfigurator;" c "create extension myspdeployerworkfloweventdataitemvaluelistconfigurator;" c "create extension myspdeployerworkfloweventdataitemvaluemapconfigurator;" c "create extension myspdeployerworkfloweventdataitemvaluesetconfigurator;" c "create extension myspdeployerworkfloweventdataitemvaluetextconfigurator;" c "create extension myspdeployerworkfloweventdataitemvaluedatetimeconfigurrator";

4、退出psql:

q

Linux和Mac OS X

1、打开终端,切换到PostgreSQL的bin目录:

cd /usr/local/pgsql/<version>/bin/

2、执行以下命令创建一个新的数据库,例如命名为gisdb

createdb gisdb T template0 encoding=UTF8 locale=zh_CN.UTF8

3、连接到新创建的数据库:

psql gisdb U postgres W host=localhost port=5432 password=your_password command="CREATE EXTENSION IF NOT EXISTS postgis; CREATE EXTENSION IF NOT EXISTS postgis_topology; CREATE EXTENSION IF NOT EXISTS fuzzystrmatch; CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder; CREATE EXTENSION IF NOT EXISTS postgis_spatial_ref_sys; CREATE EXTENSION IF NOT EXISTS postgis_gdal; CREATE EXTENSION IF NOT EXISTS postgis_pgrouting; CREATE EXTENSION IF NOT EXISTS postgi斯拉夫特;CREATE EXTENSION IF NOT EXISTS postgis_land;CREATE EXTENSION IF NOT EXISTS postgis_raster;CREATE EXTENSION IF NOT EXISTS postgis_vector;CREATE EXTENSION IF NOT EXISTS postgis_railway;CREATE EXTENSION IF NOT EXISTS postgis_osm;CREATE EXTENSION IF NOT EXISTS postgis_views;CREATE EXTENSION IF NOT EXISTS postgis_cartography;CREATE EXTENSION IF NOT EXISTS postgis_shapefile;CREATE EXTENSION IF NOT EXISTS postgis_pgtrgm;CREATE EXTENSION IF NOT EXISTS postgi斯拉夫特;CREATE EXTENSION IF NOT EXISTS accumulo;CREATE EXTENSION IF NOT EXISTS mongodb;CREATE EXTENSION IF NOT EXISTS postgi斯拉夫特;CREATE EXTENSION IF NOT EXISTS hstore;CREATE EXTENSION IF NOT EXISTS dblink;CREATE EXTENSION IF NOT EXISTS adminpack;CREATE EXTENSION IF NOT EXISTS netezza;CREATE EXTENSION IF NOT EXISTS btree_gist;CREATE EXTENSION IF NOT EXISTS intarray;CREATE EXTENSION IF NOT EXISTS pageinspection;CREATE EXTENSION IF NOT EXISTS tablefunc;CREATE EXTENSION IF NOT

原创文章,作者:未希,如若转载,请注明出处:https://www.kdun.com/ask/678284.html

本网站发布或转载的文章及图片均来自网络,其原创性以及文中表达的观点和判断不代表本网站。如有问题,请联系客服处理。

(0)
未希新媒体运营
上一篇 2024-06-09 06:34
下一篇 2024-06-09 06:38

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

产品购买 QQ咨询 微信咨询 SEO优化
分享本页
返回顶部
云产品限时秒杀。精选云产品高防服务器,20M大带宽限量抢购 >>点击进入