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
0
votes
1 answer
R point in polygon analysis from ggplot object
I'm running a QAQC protocol and have a dataset of points with x and y coordinates and a polygon and want to determine wether the points fall into the polygon or not (points outside the polygon should be flagged as false values).
From the visual…

Dana
- 13
- 4
0
votes
1 answer
Random x,y coordinate within an irregular polygon given a list of x,y-points, without being on such a corner-point nor edge
I'm trying to tackle the following use-case:
Input: A list of x,y-coordinates that will form an irregular polygon (they are guaranteed valid and lines will not intersect; it can however be concaved). Input-format is irrelevant, so I'm currently…

Kevin Cruijssen
- 9,153
- 9
- 61
- 135
0
votes
1 answer
How to get all visible points in the map view bounds in Azure Maps
I've been searching and trying to use a sample of the select point within a polygon example however I am not drawing a new polygon but rather one is already in the map to use as selection boundary. I have many points on the map as well but some are…

Rick
- 59
- 4
0
votes
1 answer
How to do in-memory search for polygons that contain a given point?
I have a PostgreSQL table that has a geometry type column, in which different simple polygons (possibly intersecting) are stored. The polygons are are all areas within a city. I receive an input of a point (latitude-longitude pair) and need to find…

Abubakar Mehmood
- 938
- 1
- 10
- 19
0
votes
1 answer
Point in Polygon in a numpy array
I am using skimage. I need to create a mask equal in area to an image. The mask will have a region which will hide part of the image. I am building it as in the sample below but this is very slow and am sure there is a pythonic way of doing it.…

skywalker
- 37
- 9
0
votes
0 answers
How to use inpolygon function in MATLAB without applying the for loop?
I have the coordinates (x=lon_points, y=lat_points) for a set of points. All I want to check is if these points are located outside of or inside/on a set of 0.5x0.5 grid boxes whose center coordinates are specified by (x=lon_gridbox,…

Srv
- 1
- 1
0
votes
1 answer
How to calculate area of lots of polygon where each polygon has different coordinates
Suppose I know 700 different values of x as well as another 700 different values of y coordinates. Every 7 points from my coordinates can construct a polygon. I can easily pick any formula (here I have used shoelace formula) to calculate the area of…

Photon
- 159
- 3
- 12
0
votes
1 answer
How to determine if a point lies inside a polygon in 3D space?
I have a 3D point P(x,y,z) and a polygon S defined by arbitrary amount of 3D points. The polygon is not necessary convex (so in my opinion, the solutions provided here do not answer my question), but P is in the same plane as S. Now, I need to…

trippeljojo
- 65
- 1
- 11
0
votes
0 answers
How to Get the Number of Points in Each Polygon in Scala
I have two data frames. The first contains a list of latitude and longitude points along with an ID number associated with the person who was at those coordinates and the date at which they were there. The second has the names of certain stores…

user261011
- 21
- 2
0
votes
0 answers
what is the accurate algorithm for detecting a point inside polygon
I'm trying to find points inside a non-uniform polygon (N edges) drawn on a canvas(JavaScript) by doing the following:
First getting all the lines across the width of the canvas and looping through it to find the intersection of each line with how…

pavithra
- 15
- 6
0
votes
1 answer
Point in Polygon search is too slow
I use Postgis extension to figure out whether given points (geographic coordinates) are in a polygon. The problem is the query is too slow. For 100 points it takes about 7 secs to be executed.
There is some info:
db=$ \set mpol…

Agent Coop
- 392
- 4
- 12
0
votes
1 answer
How to add a point in somewhere between two points of a complete polygon
I have a list of points. I take first one and very next point (second point) and draw a line between first and second point.
I want to add another vertex in between existing points.
This is my method.
when user double clicks on line a point…

Harsh Shah
- 298
- 6
- 17
0
votes
1 answer
Java/Andorid : Convert Polygon WKT to List
I have a WKT Polygon data string coming from the server which looks like this
POLYGON ((-79.9767 40.4887, -79.9718 40.4885, -79.9717 40.4888, -79.9722 40.4889, -79.9727 40.4883))
This is a 5 Point Polygon Each Lat,Long Point is separated by a…

GeekWithGlasses
- 572
- 2
- 12
- 30
0
votes
3 answers
Points in multiple polygons using R
Currently I have two data.frames, one of polygons (poly.x, poly.y, enum) and one of points (pt.x, pt.y) where enum is the id of the polygon. I am trying to determine which points belong to which polygons so I get a data.frame of (pt.x, pt.y,…

Alwin
- 321
- 2
- 14
0
votes
1 answer
Given a vector of coordinates, identify the polygon from a shapefile it falls into
I have my polygons stored in a SpatialPolygonsDataFrame and my coordinates in a data frame.
The output I want is to just have an additional column on my data frame that tags the OBJECTID (id of the polygon from the shapefile) that the coordinates…

Brent Carbonera
- 448
- 2
- 5
- 9