postgresql9.3以后postgis使用

安装postgresql和postgis以后,如果想使用postgis首先要在新建的库中执行如下sql

CREATE EXTENSION postgis;

CREATE EXTENSION pgrouting;

CREATE EXTENSION postgis_topology;

 CREATE EXTENSION fuzzystrmatch;

CREATE EXTENSION postgis_tiger_geocoder;

CREATE EXTENSION address_standardizer;

有导入shp的工具和导入raster的工具:

postgresql9.3以后postgis使用_第1张图片

raster导入的方法

D:\Program Files (x86)\Boundless\OpenGeo\pgsql\bin>raster2pgsql -s 4326 -I -C -M s32u_jian_band_hillshade1.tif -F -t 7078x7465 public.testraster | psql -d mypostgis

Processing 1/1: s32u_jian_band_hillshade1.tif

psql: FATAL:  role "zirui" does not exist


D:\Program Files (x86)\Boundless\OpenGeo\pgsql\bin>raster2pgsql -s 4326 -I -C -M ./s32u_jian_band_hillshade1.tif -F -t 7078x7465 public.testraster | psql -d mypostgis

Processing 1/1: ./s32u_jian_band_hillshade1.tif

psql: FATAL:  role "zirui" does not exist


D:\Program Files (x86)\Boundless\OpenGeo\pgsql\bin>raster2pgsql -s 4326 -I -C -M ./s32u_jian_band_hillshade1.tif -F -t 7078x7465 public.testraster | psql -d mypostgis -U postgres -W 790523

psql: warning: extra command-line argument "790523" ignored

Password for user postgres: Processing 1/1: ./s32u_jian_band_hillshade1.tif

790523

其实只需要raster2pgsql -s 4326 -I -C -M ./s32u_jian_band_hillshade1.tif -F -t 7078x7465 public.testraster | psql -d mypostgis -U postgres

程序会要密码的,然后输入密码就OK了


你可能感兴趣的:(postgresql9.3以后postgis使用)