PostGIS

How to calculate Frechet Distance in Django?

不羁的心 提交于 2020-01-05 06:51:21
问题 This is basically a question about running custom PostGIS functions inside the Django code. There is a number of related answers on this site, most close to my case is this one. It is suggested to use Func() or even GeoFunc() classes but there is no example for geospatial functions there. The latter ('GeoFunc') didn't even work for me throwing st_geofunc does not exist exception (Django 2.1.5). The task that I have to complete is to filter LineStrings based on their Frechet Distance to the

How do I plot PostGIS geometries using geom_sf?

∥☆過路亽.° 提交于 2020-01-05 05:26:11
问题 Data source is PostgreSQL database with PostGIS geometry types. I have no problem querying the data I want directly from SQL into a data.frame using the RPostgreSQL package. Since R complains about raw geom types, I use ST_AsText() on the geoms in the SQL query so that they are stored as character type in a data.frame . I have three types: POINT , LINESTRING , and POLYGON . Note that my data is geometry (e.g., Cartesian x,y,z coordinates), not map-projected geography. Had a bit of trouble

ERROR: could not access file “$libdir/postgis-2.0” postgresapp

不羁的心 提交于 2020-01-05 05:00:25
问题 I am running postgresapp 9.2.4.3 and postgis and trying to add a geometry column to a table. The postgis extension is running. When I run: SELECT AddGeometryColumn('public'::varchar,'gloutline'::varchar,'geom'::varchar,'4326','MULTIPOLY ON','2'); I'm getting the following errors: ERROR: could not access file "$libdir/postgis-2.0": No such file or directory LINE 1: ALTER TABLE public.gloutline ADD COLUMN geom geometry(MultiP... QUERY: ALTER TABLE public.gloutline ADD COLUMN geom geometry

pgAdmin4: Importing a CSV

拟墨画扇 提交于 2020-01-05 04:15:29
问题 I am trying to import a CSV using pgAdmin4. I created the table using the query, CREATE TABLE i210_2017_02_18 ( PROBE_ID character varying(255), SAMPLE_DATE timestamp without time zone, LAT numeric, LON numeric, HEADING integer, SPEED integer, PROBE_DATA_PROVIDER character varying(255), SYSTEM_DATE timestamp without time zone ) The header and first line of my CSV read is... PROBE_ID,SAMPLE_DATE,LAT,LON,HEADING,SPEED,PROBE_DATA_PROVIDER,SYSTEM_DATE 841625st,2017-02-18 00:58:19,34.11968,-117

PostGIS upgrade 2.2.1 -> 2.5.0 Database Import Errors

旧时模样 提交于 2020-01-04 14:18:32
问题 I'm moving a database from PostGIS 2.2.1 to 2.5.0 (PG 9.6). I pg_dumped the old database and am using pg_restore to import it. Everything appears to go fine but I'm getting these two errors. Is this something I need to worry about or can just ignore them? pg_restore: creating AGGREGATE "public.accum(geometry)" pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 4925; 1255 348862 AGGREGATE accum(geometry) aed pg_restore: [archiver (db)]

Insert data in a 4D spatial column using Sequelize

非 Y 不嫁゛ 提交于 2020-01-04 05:51:22
问题 My application uses Node.js (v9.3.0), PostgreSQL (v9.5.1.0) as database with PostGIS (v2.2.1) installed as an extension and Sequelize (v4.37.6) as ORM. I'm trying to insert a 4D data - with longitude, latitude, altitude and a unix timestamp - in a LineStringZM column but I'm getting the following error: DatabaseError: Column has M dimension but geometry does not After some research, I've found out that Sequelize uses the function ST_GeomFromGeoJSON to insert spatial data. However, this

PostGIS function to connect geometry LINE together?

点点圈 提交于 2020-01-03 17:13:50
问题 (note: the_geom is a geometry value (TYPE: LINESTRING), in this case i random them for readability) gid | kstart | kend | ctrl_sec_no | the_geom | the_sum_geom 626 | 238 | 239 | 120802 | 123456 | NULL 638 | 249 | 250 | 120802 | 234567 | NULL 4037| 239 | 249 | 120802 | 345678 | NULL [Real Practice Description] just skip this for those who don't mind the purpose I would like to do 'this' (a set of queries from my past question, link located on the end of this post) for every row in Table B (aka

PostGIS function to connect geometry LINE together?

▼魔方 西西 提交于 2020-01-03 17:13:24
问题 (note: the_geom is a geometry value (TYPE: LINESTRING), in this case i random them for readability) gid | kstart | kend | ctrl_sec_no | the_geom | the_sum_geom 626 | 238 | 239 | 120802 | 123456 | NULL 638 | 249 | 250 | 120802 | 234567 | NULL 4037| 239 | 249 | 120802 | 345678 | NULL [Real Practice Description] just skip this for those who don't mind the purpose I would like to do 'this' (a set of queries from my past question, link located on the end of this post) for every row in Table B (aka

PostgisDialect vs PostgreSQLDialect or both?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-03 15:32:48
问题 My application is going to use the following technologies: Postgresql Postgis JPA/Hibernate Spring Spring Data JPA I understand (from the Hibernate Spatial documentation) that one has to use the following dialect: org.hibernate.spatial.dialect.postgis.PostgisDialect What I don't understand though is how the above dialect relates to the standard Posgresql dialect, i.e. org.hibernate.dialect.PostgreSQLDialect ... Is the Postgis dialect a superset of the standard Posgresql dialect? Will all

postGreSQL 插件 timescaleDB 安装使用

岁酱吖の 提交于 2020-01-03 08:58:06
基本环境 操作系统: centOS 7 postGreSQL : 10 timescaleDB : 1.0 + postGreSQL安装 Centos7 安装Postgresql10.5和PostGIS timescaleDB 安装 PostgreSQL 时序数据库插件 timescaleDB 部署实践 - PostGIS + timescaleDB => PG时空数据库 -- 德哥 官网安装文档: TimescaleDB Docs - Installing timescaleDB 设置 TimescaleDB Docs - Setting up TimescaleDB 实验 -- 下载测试数据 wget https://timescaledata.blob.core.windows.net/datasets/weather_small.tar.gz wget https://timescaledata.blob.core.windows.net/datasets/weather_big.tar.gz -- 创建数据库 create database weather; -- 解压下载文件 tar -zxvf weather_small.tar.gz -- 创建表结构 psql -U postgres -d weather < weather.sql -- 导入数据 psql -U