![]() # these methods rewritten from the C version of Paul Bourke'sĭef intersect_point_to_line(point, line_start, line_end): # define our polygon of interest, and the point we'd like to test ![]() Here's a complete solution using Shapely, based on these equations: #!/usr/bin/env pythonįrom shapely.geometry import Point, Polygon My first attempt buffered the point by the distance between the point and polygon, and looked for intersections, but rounding errors prevent this from giving an exact answer. Few of the solutions provide the intersection point itself, however, but only the distance. ![]() ![]() There are many implementations of the shortest distance itself, such as the Shapely provided distance (from GEOS). This question turned out to be a bit trickier than I thought to get right.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |