PostGIS

Postgresql 空间扩展需要Postgis插件

牧云@^-^@ 提交于 2020-02-27 07:29:31
下载Postgis http://postgis.net/ Windows: http://download.osgeo.org/postgis/windows/ Linux/Redhat/Centos: https://yum.postgresql.org/ Postgresql扩展Postgis Windows: SQL Shell进入需要扩展Postgis的数据库。 hngsmm=# CREATE EXTENSION postgis; Linux : yum install postgis2_94 # 因为安装的PostgreSQL版本为9.4,所以是postgis2_94 注: 需要PostgreSQL9.1以上版本才支持PostGIS. PostGIS中的常用函数 ......好几页省略..... 首先需要说明一下,这里许多函数是以ST_[X]yyy形式命名的,事实上很多函数也可以通过xyyy的形式访问,在PostGIS的函数库中我们可以看到这两种函数定义完全一样。 1. OGC标准函数 管理函数: 添加几何字段 AddGeometryColumn (, , , , , ) 删除几何字段 DropGeometryColumn (, , ) 检查数据库几何字段并在 geometry_columns 中归档 Probe_Geometry_Columns ()

Postgresql Postgis插件综合使用教程

雨燕双飞 提交于 2020-02-26 00:24:37
Postgresql教程: https://www.runoob.com/postgresql/postgresql-tutorial.html 数据库支持Postgis扩展: Postgresql 空间扩展需要Postgis插件 构建数据(aggregate_build_data)和聚合查询(aggregate_search): Postgesql 空间点聚合查询实验 Geometry空间关系查询()geometry_relation): Postgresql 两个Geometry的关系判断 Geometry的建表(aggregation_state,aggregation_spatial)、存储(insert)、查询(select): Postgresql存储Geometry对象类型 来源: oschina 链接: https://my.oschina.net/boonya/blog/3165196

Distance between two 3D point in geodjango (postgis)

北战南征 提交于 2020-02-25 07:25:07
问题 I have the following problem: I created two points, for example: SRID=3857;POINT Z (62780.8532226825 5415035.177460473 100) SRID=3857;POINT Z (62785.8532226825 5415035.177460473 70) As you can see, there is 5m difference in X coordinates, and 30m in Z coordinates. When I run a.distance(b) in django shell, it returns 5 , which is wrong. However, whenIi run in a psql shell: SELECT ST_3DDistance(a.coordinates, b.coordinates) FROM restapi_entityxyz a, restapi_entityxyz b WHERE a.external_id=

Postgis加载空间数据(二)

允我心安 提交于 2020-02-05 15:29:13
本文所用数据库为postgresql 12,postgis扩展为3.0.0版本 空间数据导入数据库 将pgAdmin打开,创建数据库。 为新生成的数据库创建postgis扩展。 可在扩展中找到postgis。 打开postgis shapfile。 打开postgis shapefile导入文件, 切记文件路径不能有中文,否则会产生dbf文件无法打开的错误,使得shp文件导入失败。 对数据库进行刷新,可在架构中的表中查看到导入的数据。 在qgis中查看上面导入数据库的数据。 SRID SRID是Spatial Reference IDentifier(空间参考标识符)。它定义了我们数据的 地理坐标系统 和 投影 的所有参数。 prj投影文件转换为SRID编号网址: 点此进入 常见坐标系对应的srid参数: 坐标系名称 SRID GCS_Beijing_1954 4214 GCS_WGS_1984 4326 GCS_China_Geodetic_Coordinate_System_2000 4490 GCS_New_Beijing 4555 GCS_Xian_1980 4610 来源: CSDN 作者: qq_42272508 链接: https://blog.csdn.net/qq_42272508/article/details/104181527

QGIS & PostGIS (map points(lat and long with raduis on USA map)

隐身守侯 提交于 2020-02-05 00:17:39
问题 I installed QGIS and PostGIS. I have 200 points that I want to display with a radius of 100 miles on a graph of the US. I have imported my latitude and longitude in the PostGIS database. So I have three fields: [address], [lat], [lng]. 1) Do I need to convert the lat and lng fields into a point or geom field? If so how? (st_buffer?) 2) What command/SQL do I use to display the points with radius? I can query my points like so.. SELECT * FROM postgis_test I just don't understand how to display

QGIS & PostGIS (map points(lat and long with raduis on USA map)

我怕爱的太早我们不能终老 提交于 2020-02-05 00:17:06
问题 I installed QGIS and PostGIS. I have 200 points that I want to display with a radius of 100 miles on a graph of the US. I have imported my latitude and longitude in the PostGIS database. So I have three fields: [address], [lat], [lng]. 1) Do I need to convert the lat and lng fields into a point or geom field? If so how? (st_buffer?) 2) What command/SQL do I use to display the points with radius? I can query my points like so.. SELECT * FROM postgis_test I just don't understand how to display

Caculate point 50 miles away (North, 45% NE, 45% SW)

大城市里の小女人 提交于 2020-02-01 09:18:09
问题 In PostGIS, Is there a way to calculate another point 50 miles away in different directions? Given a point, ('New York',-74.00,40.71), how do I calculate the following points? 1) 50 miles directly North 2) 50 miles 45% North East 4) 50 miles directly East 3) 50 miles 45% South West Update: It seems http://postgis.net/docs/ST_Project.html may be the solution. ST_Project('POINT(-74.00 40.71)'::geography, 80467.2, radians(45.0)) However, I need to reference the database record to do it. not hard

ERROR: unsatisfiable constraints when installing PostGIS on the Alpine Docker image

◇◆丶佛笑我妖孽 提交于 2020-01-29 17:50:22
问题 Ok, so the task seems pretty easy! Use an Alpine image (as it is light-weight and secure) to perform some PostgreSQL DB creation/migrations. I'm using the following Dockerfile using the code here: FROM alpine:latest RUN apk add -U postgresql # install PostGIS ENV POSTGIS_VERSION 2.5.2 ENV POSTGIS_SHA256 225aeaece00a1a6a9af15526af81bef2af27f4c198de820af1367a792ee1d1a9 RUN set -ex \ \ && apk add --no-cache --virtual .fetch-deps \ ca-certificates \ openssl \ tar \ \ && wget -O postgis.tar.gz

ERROR: unsatisfiable constraints when installing PostGIS on the Alpine Docker image

梦想的初衷 提交于 2020-01-29 17:47:11
问题 Ok, so the task seems pretty easy! Use an Alpine image (as it is light-weight and secure) to perform some PostgreSQL DB creation/migrations. I'm using the following Dockerfile using the code here: FROM alpine:latest RUN apk add -U postgresql # install PostGIS ENV POSTGIS_VERSION 2.5.2 ENV POSTGIS_SHA256 225aeaece00a1a6a9af15526af81bef2af27f4c198de820af1367a792ee1d1a9 RUN set -ex \ \ && apk add --no-cache --virtual .fetch-deps \ ca-certificates \ openssl \ tar \ \ && wget -O postgis.tar.gz