raster导入postgres Windows命令
来源:互联网 发布:python ide eclipse 编辑:程序博客网 时间:2024/06/03 19:59
cmd命令行
raster2pgsql -s 4326 -I -C -M C:\Users\tt\Downloads\tmean_19_tif\*.tif -F -t 256x256 tmean_19 | psql -h localhost -p 5432 -U postgres -d raster -W
之后输入数据库密码
导入后数据表中的raster字段不显示数据,通过读取方式可测试
# -*- coding: utf-8 -*-import psycopg2# Connect to an existing databaseconn = psycopg2.connect('host=localhost port=5432 user=postgres password=123 dbname=raster')# Open a cursor to perform database operationscur = conn.cursor()# Execute SQL query# cur.execute("SELECT ST_AsTIFF(rast, 'LZW') AS rasttiff FROM staging.wsiearth WHERE rid=1;")cur.execute("SELECT ST_AsTIFF(ST_Union(rast), 'LZW') AS rasttiff FROM public.tmean_19 WHERE filename='tmean10_19.tif';")# Fetch data as Python objectsrasttiff = cur.fetchone()# Write data to fileif rasttiff is not None: open('D:/mapnik/mapnik-v2.2.0/shp/mapnik/tmean1.tif', 'wb').write(str(rasttiff[0]))# Close communication with the databasecur.close()conn.close()
用python的pip工具下载安装包
C:\Python27\Scripts\pip.exe
http://blog.csdn.net/theonegis/article/details/55100365
http://blog.csdn.net/theonegis/article/details/55050943
0 0
- raster导入postgres Windows命令
- postgres命令
- postgres导入、导出
- Excel 数据导入 Postgres
- postgres数据导入导出
- postgres数据库导入导出
- postgres windows 脚本
- postgres数据恢复(windows)
- Postgres + Postgis Windows安装
- postgres 备份,恢复命令
- postgres基础命令
- postgres不错的命令
- postgres 常用查询命令
- postgres 查询命令详解
- Windows下利用osm2pgsql将OSM数据导入到Postgres中的方法
- Postgres 导入到EDB中
- postgres 数据库 数据导入导出
- postgres数据库导入导出数据
- 【机器学习PAI实践五】机器学习眼中的《人民的名义》
- Python 多进程 multiprocessing.Pool类详解
- poj2947——Widget Factory(高斯消元求模线性方程)
- spark reduceByKey的小问题
- 关于Git的错误
- raster导入postgres Windows命令
- SQL Server 事务复制分发到订阅同步慢
- poj 2142 拓展欧几里得 砝码
- 《FreeSWITCH: VoIP实战》:FreeSWITCH 初步
- 函数式编程 高级集合类和收集器
- u3d单例类
- Java多线程(一)
- HDU5978 To begin or not to begin(概率+规律)
- APP安全报告第十四期:十款热门旅行APP,竟有九款APP的安全评分不及格!