当前位置:网站首页>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
边栏推荐
- How to solve the problem that easycvr changes the recording storage path and does not generate recording files?
- 在线SQL转Excel(xls/xlsx)工具
- 根据入栈顺序判断出栈顺序是否合理
- Uni app common functions /api
- 一文带你了解BI的前世今身与企业数字化转型的关系
- IronXL for .NET 2022.6
- ClickPaaS低代码平台
- BDF application - topology sequence
- 基于TCP的移动端IM即时通讯开发仍然需要心跳保活
- How about programmers' eyesight| Daily anecdotes
猜你喜欢
Clickhouse materialized view
[array]566 Reshape the matrix - simple
官宣!第三届云原生编程挑战赛正式启动!
[wp][introduction] brush weak type questions
PlasticSCM 企业版Crack
Enterprise level: spire Office for . NET:Platinum|7.7. x
What is test development? Why do so many companies hire test developers now?
IronXL for .NET 2022.6
Threejs factory model 3DMAX model obj+mtl format, source file download
C language course setting: cinema ticket selling management system
随机推荐
DFS and BFS concepts of trees and graphs
25K 入职腾讯的那天,我特么哭了
This article takes you to understand the relationship between the past and present of Bi and the digital transformation of enterprises
Threejs loads the city obj model, loads the character gltf model, and tweetjs realizes the movement of characters according to the planned route
10种寻址方式之间的区别
Clickhouse synchronization MySQL (based on materialization engine)
Use object composition in preference to class inheritance
Threejs Internet of things, 3D visualization of farm (III) model display, track controller setting, model moving along the route, model adding frame, custom style display label, click the model to obt
Deflocculant aminoiodotide eye drops
[C language] address book - dynamic and static implementation
provide/inject
BDF application - topology sequence
How is the entered query SQL statement executed?
Looking back on 2021, looking forward to 2022 | a year between CSDN and me
PlasticSCM 企业版Crack
“金九银十”是找工作的最佳时期吗?那倒未必
What is test development? Why do so many companies hire test developers now?
CTF stegano practice stegano 9
Web components series (VII) -- life cycle of custom components
What is the reason why the webrtc protocol video cannot be played on the easycvr platform?