Linked Questions

1 vote
0 answers
31 views

Minimal Distance Between a geometry and a layer on PostGIS [duplicate]

I am working on PostGIS where I have a two tables. Let's call them A and B. A is coming from a multi polygons layer. B is coming from a multi points layer. I have created a new column "min_distance" ...
Basile's user avatar
  • 617
6 votes
1 answer
4k views

Spatial join attributes based on closest point in PostGIS

I have two point tables from which I want to extract a value from one table to the other, based on the nearest distance of those two points. t1 t2 id | value id 1 | 100 1 ...
cf2's user avatar
  • 301
4 votes
2 answers
804 views

Update points geometry while snapping them to nearest line

I have two tables in the PostGIS database - points and lines. And I want to update points geometry to snap them to line if they lay within a certain distance. By now I managed to create a new table ...
Elena Klimenko's user avatar
4 votes
2 answers
2k views

Calculating distance between a point and the nearest line, PostGIS

I have to add a column to my points table storing the distance (metres) between each point and the nearest line. Both are in the same projected coordinate system. How can I do it? I've tried this but ...
Luigi Falco's user avatar
2 votes
1 answer
621 views

Distinct st_shortestline

I have 61 pts and numerous rds. I would like to find the shortest distance to the nearest road using st_shortestline. I need 61 unique line segments, one for each point to its nearest road. Instead I ...
wtgeographer's user avatar
5 votes
1 answer
458 views

Calculating shortest distance between two tables using PostGIS

I am trying to calculate shortest distance from each point to polygon where idfield match and add the distance to a field in the point table: For the two "A" points the distance is the same,...
BERA's user avatar
  • 72.7k
2 votes
3 answers
317 views

Reducing the processing time when handling millions of 3D points to 3D lines in PostGIS

I am trying to calculate the minimum distance between 16 millions of 3D points and 3D lines. The query is working for more or less 1 million data, but after that, it took so long and never ends. All ...
Pin_Eipol's user avatar
2 votes
1 answer
513 views

PostGIS: ST_ClosestPoint join error

I have two tables: one with geom points of species and an other one with height contour lines geoms. My Idea was to find per specie geom the closest point to a contour 'geom' line and then select its ...
Bastiaan Wakkie's user avatar
0 votes
1 answer
387 views

Getting meters from pgr_dijkstra

I imported http://download.geofabrik.de/europe/germany/baden-wuerttemberg.html into my PostgreSQL database which supports PostGIS. Now I wrote a PHP script which gets two points (lon, lat, which are ...
Lars's user avatar
  • 31
1 vote
1 answer
384 views

For each row of GPS coordinates, get value from nearest road to coordinates and copy to said row using PostGIS? [closed]

I have two tables in my database; one contains a set of GPS coordinates of a car which have been converted to geom, and another containing Open Street Map road data, including the speed limit for most ...
Árni Dagur's user avatar
1 vote
1 answer
175 views

Optmizing PostGIS minimum distance query

I have the field_1 of my Table_1 that must have the minimum distance between the geometry of my Table_1 and any geometry of my Table_2. To do so, I used a CROSS JOIN (Full Cartesian Product) between ...
Basile's user avatar
  • 617
3 votes
1 answer
224 views

Calculating distance between every entry in Table A and nearest record in Table B using PostGIS

I am new to PostGIS. How do I calculate the distance and direction between every site (approx 30,000 record) and the nearest entity in a gazetteer (approx 300,000 records)? Ideally a separate table ...
D.W. Murray's user avatar
2 votes
1 answer
126 views

Replacement for pgr_pointToEdgeNode for pgr 3.0

I am working through the book 'pgRouting: A Practical Guide' and have come across a function that has been deprecated. The function is pgr_pointToEdgeNode. Is there a similar function I can use to ...
jbalk's user avatar
  • 7,515
1 vote
1 answer
151 views

Query to Map GPS points with multi-linestring

I have a column of geometry of type multi-linestring in a database as in the following format Now I want to add a new column of speed by mapping GPS points against geometry column (as described ...
Huniya Sohail's user avatar
2 votes
1 answer
77 views

pgr_withPointsCost returns incorrect table values

I have been struggling with getting pgr_withPointsCost to output a correct cost table for months. I have created a routable network, ensured the network is connected, created a poi table with all the ...
MJM's user avatar
  • 975