当前位置:网站首页>MacBook安装postgreSQL+postgis
MacBook安装postgreSQL+postgis
2022-07-05 04:05:00 【孙霸天】
MacBook安装postgreSQL+postgis
最近开始使用macbook Pro,特别记录一下mac下的postgreSQL安装过程
安装PostgreSQL
使用brew安装
brew install postgres

启动postgres
brew services restart postgresql
# or
/opt/homebrew/opt/postgresql/bin/postgres -D /opt/homebrew/var/postgres
查看状态
pg_ctl -D /opt/homebrew/var/postgres -l /opt/homebrew/var/postgres/server.log status
查看
pg_ctl -D /opt/homebrew/var/postgres -l /opt/homebrew/var/postgres/server.log stop -s -m fast
创建用户
createuser postgres -P
安装PostGIS
brew install postgis

创建数据库
createdb test
createdb test -O username -E UTF8 -e
连接数据库
psql test
创建postgis插件
CREATE EXTENSION postgis;

SELECT PostGIS_Version();

导入tiff影像
数据需要先安装postgis和postgis_raster插件
windows下使用
进入postgresql的bin目录
C:\Program Files\PostgreSQL\12\bin
直接写入postgresql
raster2pgsql -s 4326 -C D:\data\20211008data\hulan\new\2020_hulan_corn_yield.tif -F -t 256x256 public.2020_hulan_corn_yield | psql -h localhost -p 5432 -U postgres -d raster -W
先生成sql,再使用psql导入数据库
raster2pgsql -s 4326 -I -M -C D:\data\20211008data\jingxian\2020_jx_wheat_yield.tif -F -t 256x256 public.2020_jx_wheat_yield > D:\2020_jx_wheat_yield.sql
psql -d raster -U postgres -f D:\2020_jx_wheat_yield.sql
边栏推荐
猜你喜欢

Special Edition: spreadjs v15.1 vs spreadjs v15.0

Official announcement! The third cloud native programming challenge is officially launched!

Why can't all browsers on my computer open web pages

我国算力规模排名全球第二:计算正向智算跨越
![[understand series after reading] 6000 words teach you to realize interface automation from 0 to 1](/img/eb/c944d4a71ce30589e71059ed848899.png)
[understand series after reading] 6000 words teach you to realize interface automation from 0 to 1

Threejs rendering obj+mtl model source code, 3D factory model

The development of mobile IM based on TCP still needs to keep the heartbeat alive

Web components series (VII) -- life cycle of custom components

我就一写代码的,王总整天和我谈格局...

How to use jedis of redis
随机推荐
Laravel8 export excel file
Threejs realizes rain, snow, overcast, sunny, flame
Is "golden nine and silver ten" the best time to find a job? Not necessarily
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
Get to know MySQL connection query for the first time
Operation flow of UE4 DMX and grandma2 onpc 3.1.2.5
优先使用对象组合,而不是类继承
小程序中实现文章的关注功能
Containerization Foundation
Wechat applet development process (with mind map)
行为感知系统
Plasticscm enterprise crack
请问一下我的请求是条件更新,但在buffer中就被拦截了,这种情况我只能每次去flush缓存么?
Nmap user manual learning records
我就一写代码的,王总整天和我谈格局...
Use of vscode software
Thread Basics
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
[wp]bmzclub writeup of several questions
provide/inject