当前位置:网站首页>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
边栏推荐
- UI automation test farewell to manual download of browser driver
- 面试字节,过关斩将直接干到 3 面,结果找了个架构师来吊打我?
- error Couldn‘t find a package. JSON file in "your path“
- 企业级:Spire.Office for .NET:Platinum|7.7.x
- Is "golden nine and silver ten" the best time to find a job? Not necessarily
- Redis source code analysis: redis cluster
- How to realize real-time audio and video chat function
- Threejs loads the city obj model, loads the character gltf model, and tweetjs realizes the movement of characters according to the planned route
- [understand series after reading] 6000 words teach you to realize interface automation from 0 to 1
- Installation of postman and postman interceptor
猜你喜欢
ABP vNext microservice architecture detailed tutorial - distributed permission framework (Part 2)
行为感知系统
面试字节,过关斩将直接干到 3 面,结果找了个架构师来吊打我?
Differences among 10 addressing modes
特殊版:SpreadJS v15.1 VS SpreadJS v15.0
Threejs Internet of things, 3D visualization of farms (II)
北京程序员的真实一天!!!!!
Rust blockchain development - signature encryption and private key public key
我国算力规模排名全球第二:计算正向智算跨越
Redis之Jedis如何使用
随机推荐
行为感知系统
北京程序员的真实一天!!!!!
Use Firefox browser to quickly pick up Web image materials
MindFusion.Virtual Keyboard for WPF
已解决(sqlalchemy+pandas.read_sql)AttributeError: ‘Engine‘ object has no attribute ‘execution_options‘
长度为n的入栈顺序的可能出栈顺序
open graph协议
Threejs implements labels and displays labels with custom styles
阿里云ECS使用cloudfs4oss挂载OSS
Deep learning - LSTM Foundation
Threejs Internet of things, 3D visualization of farms (I)
Plasticscm enterprise crack
Uni app change the default component style
Open graph protocol
在线SQL转Excel(xls/xlsx)工具
How about programmers' eyesight| Daily anecdotes
Uni app common functions /api
一文带你了解BI的前世今身与企业数字化转型的关系
ClickPaaS低代码平台
UI自动化测试从此告别手动下载浏览器驱动