
Geometry : 
Subject: [geometry] Distance polygon to polygon
From: eric.noirfalise_at_[hidden]
Date: 20170704 09:16:36
Hi all,
I would like to filter polygons at a given distance d from each other :
I start with a set {Pi} of polygons i in 1..N,
for each i in 1..N, I would like to get all index j such that d(Pi, Pj) <= d, j in 1..N
My data set may be quite important so I would like to avoid direct polygon to polygon distance computations.
So I start computing rtree associated to all polygons using a segment decomposition (for each polygon Pi I get a RTree(i) composed with segments of Pi)
I can then compute distances using nearest predicate on rtree in a way like this :
query(RTree(i), nearest(Pj, 1), back_inserter(resColl))
I think this is more efficient than direct polygon to polygon distance computation.
Now I would like to make it more efficient starting with RTree(j) instead of Pj and using box decomposition to find nearest candidates.
Is that a good way to optimize my problem ?
In the affirmative case, is there a way to access to RTree internal box decomposition ?
Regards,
Eric Noirfalise
Geometry list run by mateusz at loskot.net