Hello. First of all, thank you for your attention and sorry for my stupid question:
Given a 2D Point (X, Y) and a set of Density Contours similar to:
How do I find if this Point is inside any of the generated Contours (and which Contour, if so)?
I’ve tried looping over the ‘MultiPolygon’ objects generated by the d3.contourDensity() function and calculating the Point distance with d3.geoContains() and had no luck since the results were always true.
Also tried using the Closest Point function (https://bl.ocks.org/mbostock/8027637) on the generated SVG Paths.
The success rush lasted a while but testing made me realize that each SVG Path contained multiple Polygons (One SVG Path created for each density level - stupid me).
At the moment I am on the verge of trying to split the ‘MultiPolygon’ objects into individual ‘Polygons’ and seeing where this road would lead me.
I know this is probably a bad decision. There is probably an easier way to solve this.
Could anyone please help me?
Again, sorry for the stupid question. Also sorry for my poor english.