Linked Questions

37
votes
4answers
12k views

Separate polygons based on intersection using PostGIS

I have a PostGIS table of polygons where some intersect with one another. This is what I'm trying to do: For a given polygon selected by id, give me all of the polygons that intersect. Basically, ...
17
votes
5answers
5k views

Simplifying polygons to linestring?

I would like to simplify some polygons that represent rivers into linestrings. I assume that holes in polygons can be omitted. Anybody has some good idea how to simply do it? It would be nice, if it ...
16
votes
5answers
7k views

Create voronoi diagram from line segments

I'm looking for a way to create a voronoi diagram based on line segments instead of points. See the example below (taken from this presentation). Ideally I'd like something I can script from Python, ...
14
votes
1answer
6k views

How to use ST_DelaunayTriangles to construct a Voronoi diagram?

(edit 2019) ST_VoronoiPolygons available since PostGIS v2.3! With PostGIS 2.1+ we can use ST_DelaunayTriangles() to generate a Delaunay triangulation, that is a dual graph of its Voronoi diagram, and,...
12
votes
3answers
3k views

Constructing Voronoi diagram in PostGIS

I'm trying to construct voronoi diagram from grid of points using modified code from here. This is SQL query after my modifications: DROP TABLE IF EXISTS example.voronoi; WITH -- Sample set of ...
6
votes
5answers
3k views

Calculating Voronoi Diagrams for polygons

There are a variety of good algorithms for generating the Voronoi polygons or their complement, the Delaunay Triangulation for a set of points. My question is simply, is there an algorithm for ...
6
votes
3answers
5k views

How to create random points in a polygon in PostGIS

I have a polygon layer, and would like to generate random points in each polygon. An initial searching in Google resulted this website which presents a function for this purpose: http://trac.osgeo....
8
votes
2answers
1k views

Creating voronoi polygons from polygons?

I have a database with buildings and for some further analysis I need to: aggregate adjacent buildings (preferably without losing the height attribute, but I can work my way around that) once I have ...
6
votes
3answers
550 views

R - Voronoi polygons from lines

I use R (and sf, mainly) and I was wondering if it's possible to create Voronoi polygons starting from LINESTRING objects instead of POINT. For example, given a sfc such as # package library(sf) #&...
11
votes
1answer
561 views

Point sampling along a pole-wrapping coastline with PostGIS

I am working on a task that requires me to get sample points every 1000 km along coastlines, and have run into a problem with Antarctica. From what I can tell, it seems to be an issue with the use of ...