Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [postgis]

PostGIS is an extension for the PostgreSQL object-relational database that adds support for geographic objects.

9
votes
2answers
414 views

What spatially-aware GUI administration softwares exist for PostgreSQL/PostGIS?

Most of my experience with PostgreSQL has been pgAdminIII and psql, but I'm interested to know what others use. Is there PostgreSQL equivalent to SQL Server Management Studio (SSMS) and its ability ...
2
votes
1answer
18 views

Get exterior ring of a multipolygon using GEOSGeometry or PostGIS

I am trying to get the exterior ring of the multipolygon in the image below using GEOSGeometry (through GeoDjango) or Postgis, but I have not found an easy solution. This is an example of a ...
0
votes
0answers
10 views

How to retrieve GIS data in Multiple Orthophoto at point level

I have been using a python script that can read Data from Orthophoto(*.tiff) of size 300Mb-2Gb. But this is taking 32s per request of lat-long, which is not ok. I have different Orthophotos with ...
1
vote
1answer
31 views

pgr_alphashape returns a self intersecting polygon

After using the function pgr_drivingdistance() I am attempting to make a polygon with pgr_alphashape. Following the example found in the documentation I should do the following: https://docs.pgrouting....
5
votes
1answer
104 views

QGIS Offline editing of PostGIS table produces a Spatialite table with no attribute lengths?

When synchronizing an offline Spatialite file with it's corresponding PostGIS database, using the Offline Editing plugin in QGIS, I received an error I hadn't experienced before The error message is ...
1
vote
1answer
237 views

ArcGIS Union equivalent in PostGIS?

I am using pgAdmin (v.1.22) for my postgres(9.5). I am still fairly new to postgres. I am trying to perform a union(intersection) of multiple layers where there is both complete and no overlap between ...
0
votes
1answer
33 views

Loading points and polylines into PostGIS database and creating connectivity between them using topology?

I am new in PostGIS, and I am trying to create connectivity(using topology) between 3 sets of points and polyline to model an electrical distribution network. Does anyone know how to do this?
1
vote
0answers
43 views

What is geometry(4326), and can you do Cartesian calculations with unprojected ellipsoidal coordinates?

I know Geography(4326) is an unbounded, and unprojected, and covers the entire world with ellipsoidal coordinates. I get that the math on this system is done on a spheroid. I also get that with a ...
0
votes
0answers
19 views

How to overlap linestrings with PostGIS or QGIS?

Explanation: I have 2 tables on PostgreSQL, one table named 'city' that have linestrings wich represents streets from a city (using QGIS I downloaded OpenStreetMaps data and imported to PostgreSQL ...
0
votes
0answers
22 views

full python 3 script to load shp file inpo Postgis file

I am using Python 3 libraries to programmatically push a shapefile into a remote POSTGIS data base. I retrived the code googling aroung and slighty modifing it. Here the script: import pandas as pd ...
-1
votes
2answers
39 views

How best to divide line features into equal parts and create continuous buffer zones for them using Postgres/PostGIS and QGIS [on hold]

Having familiarized with an similar question specified on the link Dividing a buffer into segments based on path and distance, the author asked an analogous question whether it is possible to solve ...
12
votes
1answer
128 views

Is the ST_ prefix appropriate for functions not included in SQL/MM Part 3?

I was reading a thread on the geospatial extension for Presto in this Github issue, where a function, line_locate_point, was introduced. It was based off PostGIS's ST_LineLocatePoint function, which ...
38
votes
3answers
14k views

Reprojecting all geometries in PostGIS table?

I created a spatial table with SRID:4326. Now I want to change total projection to SRID:32644 into a new table. The old table should remain unchanged.
0
votes
1answer
37 views

Edit and transform XML/GML files

I'm searching for an approach as someone who just started to work with geodata recently. It's about the following situation: I received several XML files. I need to perform a geometric difference ...
0
votes
2answers
37 views

Using original shapefile vs osm for routing in South Australia using pgRouting?

I'm looking at building a simple routing application using pgRouting. I'm running on Windows 10 at the moment but could migrate to Windows Server at some point. I'm trying to figure out how best to ...
1
vote
0answers
25 views

Performing PostGIS spatial joins with remote host?

I have approximately 600,000 points that must be joined to ~12 million polygons. This process happens weekly, with the potential to happen daily. The polygon data never changes, and is stored in a ...
0
votes
1answer
42 views

PostGIS layer visible in QGIS Browser panel but displayed as not connected in DBManager

I have added my database as a workshop and you can see the layers in public schema. but whereas in Db manager it is saying NOT CONNECTED. how can I resolve this? this is running on localhost. on ...
0
votes
0answers
23 views

PostGIS - Nearest Neighbour Join to sum values

I have a table of polygons T1 and a second table of points P1 Each point has a value I want to sum the values of P1 for each T1, with P1 being the closest set of points to T1 At the moment the only ...
2
votes
1answer
56 views

Trigger PostGIS QGIS

I have 2 layers on PostGIS: a point layer named 'tdia' and a polygon layer named 'com': -the com layer contains the city name. (Polygon) -the tdia layer contains bus stops. (point) I want to create a ...
0
votes
1answer
49 views

How to give a table some geometry from a view on QGIS using a join?

So basically I've got this static table that people update information Then I need it to give it some geometry from a view table. This geometry is dynamic, that's why can't just make a new geom ...
1
vote
1answer
61 views

Editing PostGIS layer in Lizmap?

I've got a freshly Lizmap 3.2 installation. I can display PG-Layers but I cannot edit them. My setting is: Ubuntu Server 18.04.1 PostgreSQL 10.6 Apache2 Lizmap 3.2 PHP 7.2 I followed this ...
0
votes
1answer
44 views

Inserting Point into PostGIS geometry column from golang?

I have this go code to insert data in to postgresql: sqlStatement := ` INSERT INTO my_table ( column_name, geog) VALUES ($1, ST_GeomFromText('Point($2 $3)')) ` and then _, err = db....
1
vote
2answers
107 views

Using PostGIS to find which county in California has most settlements in forest?

Using PostGIS how do I find which county in California has the most settlements in the forest? I have point settlements settlements_CA, polygon forests forests_CA and polygon counties counties_CA in ...
-2
votes
1answer
44 views

Can I use PostgreSQL as a database with ArcGIS Pro? [on hold]

I've been with my current job for 2 years now and have been using QGIS with PostgreSQL. We are currently testing ArcGIS Pro noticed that I can connect to my PostgreSQL database that I was using on ...
3
votes
3answers
2k views

How to load GeoJSON into PostgreSQL database using Python?

What I have tried to do is (In Python IDLE): import psycopg2 import json try: conn = psycopg2.connect("dbname='carto' user='postgres' host= localhost password='password'") except: print "I am ...
5
votes
1answer
2k views

How to cluster points into clusters of a maximum diameter in PostGIS?

I'm working with transit stops in GTFS. I want to group together stops (N~8000 for a medium sized agency in the USA) which are proximately related in order to reduce the number of dimensions but also ...
1
vote
1answer
40 views

Creating label coordinates in a virtual columns in QGIS 2.18

I'm working from a database (PostgreSQL/ PostGIS). I created a view in QGIS of joined polylines from one table with the ST_union function. I want to label this polylines in QGIS. So, I created 2 ...
1
vote
0answers
52 views

Recursive query

How can I do a recursive query with these 2 queries: SELECT ptb.* AS pois FROM ways way, pois pta, pois ptb WHERE way.id = 1 AND pta.id = 12 AND ST_DWithin( ST_LineSubstring( way.path, ...
0
votes
0answers
23 views

GeoAlchemy2: Cannot insert row because Function st_geomfromewkt(unknown) “does not exist”

i've been stuck on this problem for quite a while now and I can't figure out what could be the issue here. I have a Postgres DB with postgis extension installed CREATE EXTENSION IF NOT EXISTS ...
0
votes
1answer
45 views

How do I calculate proximity for multiple points?

I have two layers, one with lots, one with subway stations (NYC). There are to scenarios: Case 1. I want to rank the lots relative to the proximity to subways. (1.a.) The closer to closest station, ...
0
votes
1answer
39 views

Find all regions (lat, long, radius) that contain a point

A Region has a latitude, longitude (GEOMETRY('POINT')) and a radius. Using postgis, how can I query all Regions where the distance from pointParam and region.point is less than or equal to region....
2
votes
0answers
25 views

PostGIS Simplification on topogeometry does not respect topology?

I'm testing the code in the book "PostGIS in Action" (2nd ed) on Topology-based Simplification: DROP TABLE IF EXISTS _temp_table; CREATE TABLE _temp_table AS SELECT feat_name, ST_Simplify(topo,150) ...
1
vote
1answer
37 views

spatial DB lookup to image DB

I am working on a library project for rectifying old map imaging on a map. The images are in tiff and jpeg formats. After rectifying the images I want to save the geographical information in a ...
1
vote
1answer
21 views

How to reset the id number of newly generated PostGIS topology?

I'm trying to create a clean, new topology for testing by discarding the old topology first, i.e.: SELECT DropTopology('ch13_topology'); SELECT CreateTopology('ch13_topology', 32610, 0.05); However,...
4
votes
1answer
50 views

Generating a neighborhood pixel raster from existing raster using PostGIS

I am starting with a PostGIS raster table containing anywhere from 6-12 bands. In a nutshell, the goal is to take each of these bands, perform a 3x3 neighborhood average on each pixel in the band, ...
0
votes
0answers
8 views

repeated TopoGeo_AddLineString creates multiple entries in PostGIS topology?

I just noticed something strange in PostGIS topology (PostGIS 2.5). When applying TopoGeo_AddLineString() to the same geometry multiple times, it creates more than one entries in the edge_data table. ...
1
vote
1answer
41 views

sfcgal ST_Volume Issue

ST_Volume works with shape data pasted into the query in this form: SELECT (abs(ST_Volume(design)) - abs(ST_Volume(ST_3DIntersection(design,scan)))) FROM (SELECT (ST_MakeSolid('...
7
votes
2answers
702 views

QGIS saving analysis output as Postgis table

i am using QGIS and Postgis together. I can load data in Postgis and than i import it to QGIS. But i am trying to save an analysis output (example: buffer analysis, voronoi polygon or SEXTANTE ...
2
votes
2answers
711 views

Selecting Census Block Groups inside Zip code using PostGIS?

I already have my data imported, problem is my SELECT statements aren't yielding the results I'm looking for. I specifically need all the Block Group multipolygons that are inside a Zip Code ...
1
vote
2answers
398 views

Using Fiona to Convert file geodatabase to PostgreSQL / PostGIS?

Is there a way to use Fiona instead of OGR to convert a GDB over to postgresql / postgis within Python? If so, how or where can I look? I cannot seem to find this within the Fiona site or by simply ...
57
votes
5answers
18k views

Creating regular polygon grid in PostGIS?

How to create, on the shape of a polygon, a regular grid of polygons/squares of an given size, in postgis? I have thought about a function like How to create regular point grid inside a polygon in ...
0
votes
1answer
69 views

PostgreSQL Query which returns geom column as WKT set in function

Given: We are accessing a PostgreSQL DB from a VB NET application. When the query completes the DB rows are delivered in a VB NET DataTable. The Postgre DB geom column is in the format of System.Bytes[...
2
votes
3answers
1k views

Create hex grids over a layer

I have a shapefile that has the outlines of the United States and I want to create hex grids that over that layer. I tried using this function that will create hexes over a layer. I created an empty ...
26
votes
8answers
7k views

How to create regular point grid inside a polygon in Postgis?

How to create, inside a polygon, a regular grid of point spaced x,y in postgis? Like the example:
1
vote
1answer
150 views

Upgrading PostGIS and PostgreSQL but running upgrade to PostgreSQL it errors?

I want to upgrade PostGIS(2.0.4 ---> 2.2.3) and PostgreSQL (9.2.4 ----> 9.6) so First I upgrade PostGIS 1、install PostGIS 2.2.3 on postgresql 9.2.4 2、alter EXTENSION postgis 2.0.4 ---&...
2
votes
1answer
41 views

Expanding Polygon by distance using PostGIS?

I am trying to expand a polygon in a particular manner with PostGIS. I need a new geometry that is a bit like a Buffer, except Buffer produces rounded corners (lots of vertices) when using it on a ...
1
vote
1answer
41 views

Incorrect extent when importing shapefile to PostGIS

Using PostgreSQL 9.6, pgAdmin 4 v3.5 and QGIS I’ve found quite a bit of info on this issue but no clear answer. I’m attempting to import a shapefile that was created using ArcGIS (don’t know what ...
0
votes
1answer
50 views

PostGIS: calculate minimum distance between feature types

I have polygon layer in QGIS, and for each polygon I would like to calculate the minimum distance to the nearest polygon in another layer. My desired result is an attribute for all features that has ...
0
votes
1answer
41 views

Saving borough boundaries as MultiLineStrings or MultiPolygons?

I am creating a database in PostGIS and I have a column that will save the boundaries of boroughs. The app will later query the database, asking what points, lines or polygons are inside those ...
4
votes
4answers
4k views

Calculating distance of point from arc/polyline using PostGIS?

Using PostgreSQL/PostGIS, I am trying to query the database for the closest arc to a particular GPS point. Each Arc is made up of two nodes that are GPS points on a map. Is there a way I could query ...