Timeline for PostGIS - Calculate of the average distance between points for a delimited area
Current License: CC BY-SA 4.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
S Oct 13, 2023 at 7:23 | history | suggested | Roland | CC BY-SA 4.0 |
sql formatting, easier to read without horz scrolling
|
Oct 13, 2023 at 7:05 | review | Suggested edits | |||
S Oct 13, 2023 at 7:23 | |||||
Jun 22, 2016 at 17:04 | comment | added | kttii | great! yes, you'll have to modify it to match your unit. | |
Jun 22, 2016 at 16:58 | comment | added | Alex Girard | It's working! Tho I do have a concern. As i work in EPSG 2950, my reference unit is meter. Yet in the ST_DWithin, you used 2 as the reference to 2KM...Shouldn't I use 2000 instead? | |
Jun 22, 2016 at 14:03 | vote | accept | Alex Girard | ||
Jun 21, 2016 at 14:09 | comment | added | kttii | try it without the references to s.id... answer has been modified. | |
Jun 21, 2016 at 14:09 | history | edited | kttii | CC BY-SA 3.0 |
modified code to remove s.id
|
Jun 21, 2016 at 13:56 | comment | added | Alex Girard | This fonction gives me a table with the r.id associated withe very s.id. As my table have more than 150 000 points, the returning table is enormous... Instead of a fonction that gives you the distance of 1 point to all the other point (and return a table like that) is there a possibility to have a fonction where the result for a row would be the id (column 1) and the avg distance for this point to all other points (column 2). The fonction would have to first calculate all the matches distances for that ID and than calculate the average. | |
Jun 17, 2016 at 18:49 | vote | accept | Alex Girard | ||
Jun 21, 2016 at 14:00 | |||||
Jun 17, 2016 at 18:37 | history | edited | kttii | CC BY-SA 3.0 |
additional statement for average
|
Jun 17, 2016 at 18:29 | comment | added | kttii | oh, sorry, I forgot about that part... one moment... | |
Jun 17, 2016 at 18:26 | comment | added | Alex Girard | This does solve the problem of the range as it would limit the search list, but what would be the fonction to find the average distance between 1 point and the rest of the points within the index created by ST_DWithin? | |
Jun 17, 2016 at 18:16 | history | answered | kttii | CC BY-SA 3.0 |