当前位置:网站首页>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
边栏推荐
- kubernetes集群之调度系统
- Analysis of dagger2 principle
- [wp]bmzclub writeup of several questions
- [software reverse analysis tool] disassembly and decompilation tool
- Excuse me, my request is a condition update, but it is blocked in the buffer. In this case, can I only flush the cache every time?
- [brush questions] BFS topic selection
- Uni app change the default component style
- Why can't all browsers on my computer open web pages
- DFS and BFS concepts of trees and graphs
- 一文带你了解BI的前世今身与企业数字化转型的关系
猜你喜欢

Is there a sudden failure on the line? How to make emergency diagnosis, troubleshooting and recovery

As soon as I write the code, President Wang talks with me about the pattern all day

Redis之Jedis如何使用

NEW:Devart dotConnect ADO. NET

Rome链分析

What is test development? Why do so many companies hire test developers now?

MindFusion.Virtual Keyboard for WPF

It took two nights to get Wu Enda's machine learning course certificate from Stanford University

ActiveReportsJS 3.1 VS ActiveReportsJS 3.0

laravel8 导出Excle文件
随机推荐
Open graph protocol
Uni app common functions /api
EasyCVR更改录像存储路径,不生成录像文件如何解决?
我就一写代码的,王总整天和我谈格局...
面试汇总:这是一份全面&详细的Android面试指南
Threejs realizes sky box, panoramic scene, ground grass
Analysis of dagger2 principle
根据入栈顺序判断出栈顺序是否合理
IronXL for .NET 2022.6
输入的查询SQL语句,是如何执行的?
ABP vNext microservice architecture detailed tutorial - distributed permission framework (Part 2)
快手、抖音、视频号交战内容付费
How to use jedis of redis
我国算力规模排名全球第二:计算正向智算跨越
阿里云ECS使用cloudfs4oss挂载OSS
基于TCP的移动端IM即时通讯开发仍然需要心跳保活
MindFusion. Virtual Keyboard for WPF
Number of possible stack order types of stack order with length n
Use threejs to create geometry, dynamically add geometry, delete geometry, and add coordinate axes
Interview byte, pass the exam and directly work on three sides. As a result, I found an architect to hang me?