当前位置:网站首页>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
边栏推荐
- Containerization Foundation
- Behavior perception system
- lds链接的 顺序问题
- Longyuan war "epidemic" 2021 network security competition web easyjaba
- Operation flow of UE4 DMX and grandma2 onpc 3.1.2.5
- NEW:Devart dotConnect ADO.NET
- Resolved (sqlalchemy+pandas.read_sql) attributeerror: 'engine' object has no attribute 'execution_ options‘
- 灵魂三问:什么是接口测试,接口测试怎么玩,接口自动化测试怎么玩?
- Ctfshow web entry code audit
- IronXL for . NET 2022.6
猜你喜欢
What is the reason why the webrtc protocol video cannot be played on the easycvr platform?
Web components series (VII) -- life cycle of custom components
Rome链分析
NEW:Devart dotConnect ADO.NET
[wp][introduction] brush weak type questions
Containerization Foundation
Three level linkage demo of uniapp uview u-picker components
How is the entered query SQL statement executed?
Clickhouse materialized view
面试字节,过关斩将直接干到 3 面,结果找了个架构师来吊打我?
随机推荐
Rust区块琏开发——签名加密与私钥公钥
Timing manager based on C #
[数组]566. 重塑矩阵-简单
Enterprise level: spire Office for . NET:Platinum|7.7. x
PlasticSCM 企业版Crack
UI automation test farewell to manual download of browser driver
Alibaba cloud ECS uses cloudfs4oss to mount OSS
speed or tempo in classical music
阿里云ECS使用cloudfs4oss挂载OSS
[an Xun cup 2019] not file upload
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
IronXL for . NET 2022.6
为什么百度、阿里这些大厂宁愿花25K招聘应届生,也不愿涨薪5K留住老员工?
Threejs Internet of things, 3D visualization of farms (I)
Online text line fixed length fill tool
Deep learning - LSTM Foundation
[software reverse analysis tool] disassembly and decompilation tool
An elegant program for Euclid‘s algorithm
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
Containerd series - detailed explanation of plugins