Saturday 13 May 2017

Optimizing my script; taking too long; distance between many objects PostGIS


I have many many points and want to calculate the shortest distance from each point to the closest line of a table with many many lines. I think my underneath code is correct, I however never get an answer because pgadmin just keeps 'waiting for query execution to complete'. How can I optimize this underneath script?



SELECT 
max(br.id), max(to_timestamp(br.time)), max(at.linknummer),
min(ST_Distance(st_transform(br.geom,3857), at.geometry))
FROM
schema1.data1 AS br,
schema2.data2 AS at
GROUP BY
br.id, br.time


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...