Algorithm for determining whether a point is inside a polygon. Normally calculated by counting the number of polygon line segments that a ray from the point intersects.
Questions tagged [point-in-polygon]
275 questions
1
vote
1 answer
Point inside or in boundary of polygon
I'm using the algorithm in http://www.ecse.rpi.edu/~wrf/Research/Short_Notes/pnpoly.html,
but when the input point is in boundary, that algorithm gives wrong for me. Can anyone help me with point in boundary case?
Any help is appreciated.
This is…

Kuzunoha
- 165
- 3
- 13
1
vote
0 answers
Android polygon pixels intersecting pixels of bitmap
I want to understand more about what I found about all point(s) in a polygon intersecting a bitmap in Android. Say I have a bitmap and I use the getPixels function to retrieve all of my pixel values in that bitmap. Then I draw a polygon of any shape…

GhostMember
- 91
- 1
- 2
- 9
1
vote
0 answers
Point in Polygon Android
I am developing an android application. In the application I have integrated map with polygon. Now I want to check whether the given marker is inside the polygon or not. Help Me please.
Following function is used to check the lat long in the…

user3415537
- 19
- 3
1
vote
1 answer
DotSpatial: Convert a Polygon Feature to System.Drawing.Region
I want to paint a Polygon region with a color.
I know I can use Symbolizer to do this but I want that region to blink (change it's color in a timer) and using symbolizer seems to be slow for this purpose.
I'm already using Map.OnPaint event to…

Mahmood Dehghan
- 7,761
- 5
- 54
- 71
1
vote
1 answer
Javascript find furthest coordinate from a certain coordinate in an array of coordinates
I know the center coordinates and an array of all coordinates of a polygon.
How can I find out which coordinate is the furthest coordinate for the center point with Javascript?
Center of bounds:
lat: -13.647141573542923lng:…

CodingTT
- 1,125
- 3
- 14
- 23
1
vote
4 answers
Point in polygon algortim using location class in android?
I've a a set of location that forms a closed path (similar to polygon). Is there any possible way to check if a certain latitude and longitude is inside the closed path?

ericlee
- 2,703
- 11
- 43
- 68
1
vote
1 answer
What line-polygon clipping algorithm can I use to ensure that the resultant endpoints are always within the polygon?
I have a 2D plane, partitioned into n-sided, convex polygons. I'm using WRF's PNPOLY algorithm for polygon inclusion to ensure that a point belongs inside one and only one polygon.
Is there an algorithm I can use to clip a line segment PO to a given…

JDS
- 251
- 1
- 4
- 12
1
vote
2 answers
Algorithm to find polygon that encloses a point - Only lines are defined
I have a 2D drawing with many straight lines.
All those lines are mathematically known. And they are independent of the others.
You can consider I know start and end point of each line and I can make them intersect to find all intersection…

Daniel Möller
- 84,878
- 18
- 192
- 214
1
vote
2 answers
matplotlib pnpoly example results in error
I ran the following code as per the example here:
http://matplotlib.org/faq/howto_faq.html#test-whether-a-point-is-inside-a-polygon
I would kindly appreciate your help. Thank you.
>>>import numpy as np
>>>import matplotlib.nxutils as nx
>>>verts =…

codingknob
- 11,108
- 25
- 89
- 126
1
vote
1 answer
Adding Polygon points from Line2D values
I have a small block of code that is reading Line2D values from an array called lineList (in a different class) and storing them in the new array called list. from here I have been trying to convert all of the line values into Polygon points (a…

Mochi
- 71
- 1
- 11
1
vote
1 answer
How to place marker inside google maps polygon
How to place marker inside polygon (this polygon already on map)?
My thoughts are: find a way to inscribe for example circle to the polygon and find a center of this circle (it is not problem), but can't find way to inscribe circle.
Method…

Vadim
- 538
- 2
- 5
- 23
0
votes
1 answer
algorithm to recursively divide a polygon into in/out quadrants: what's it called and where's the code?
I have a lot of points (hundreds of thousands) and I want to check which ones are inside a polygon. For a relatively small polygon (i.e., likely to contain only tens or hundreds of points) I can just use the bounding box of the polygon as an initial…

M Katz
- 5,098
- 3
- 44
- 66
0
votes
1 answer
JTS::Ray Casting Algorithm Giving Unexpected Results for Point-in-Polygon Check
I am using the ray casting algorithm to determine whether a given point is inside a polygon. The polygon's edges are defined in counterclockwise order. However, I am consistently getting unexpected results where the algorithm indicates that the…

Sunil Chormale
- 1
- 1
0
votes
0 answers
Python to detect point in polygons
First I import a shapefile
import geopandas as gpd
shapefile_path = "data/TRI_75_SIG_DI/TRI_PARI_SIG_DI/n_tri_pari_carte_inond_s_075.shp"
gdf = gpd.read_file(shapefile_path)
And it works fine.
Then I can display the polygons :
import folium
m =…

John Smith
- 1,604
- 4
- 18
- 45
0
votes
1 answer
SQL: Select points within any polygon with data from database directly
A database contains the table Locations with the numeric fields Index, X, Y and the table Districts with the field borders of polygon geometry type. The polygon geometry type is verified by the test (Microsoft Learn - STGeometryType)
DECLARE @g…

stonebe
- 482
- 1
- 3
- 14