How to find if point is inside polygon in d3.js

后端 未结 3 1158
悲&欢浪女
悲&欢浪女 2021-01-18 07:42

I know there are manual ways of doing this (see Point in Polygon), but is there a native way of determining whether a point is inside a polygon, in d3.js?

3条回答
  •  春和景丽
    2021-01-18 08:29

    No, there is no function for this. The only very special case when there is support for this would be checking whether the point is the centroid of the polygon (using the polygon.centroid function), but in general you'll have to provide your own function.

提交回复
热议问题