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
How to scale polygons mapped to a resizeing picture
Im craeating a dart scoring program (to use myself in my dart room) and want the user to be able to click in different areas of a picture of a dart board to register the thrown darts.
This program will be resizable, so the picture of the dart board…

Stefan
- 11,423
- 8
- 50
- 75
0
votes
0 answers
Is there more efficient and faster method in R for finding point in multipolygon?
I use below code in RStudio to run through around 6500 rows in sf_data1. Sf_data2 has 19 rows. Here are pictures of sf_data1 and sf_data2:
sf_data1
sf_data2
example of sf_data2 multipolygon
"Konversiokerroin" is the variable1 below in the code.
The…

JKling
- 1
- 1
0
votes
3 answers
Find which spatial polygon (object in SpatVector vect) covers a data point
I have created a SpatVector of several polygons using the terra package as
library(terra)
er <- rbind(c(6225, -6050), c(11250, -5400), c(10800, -3100), c(7560, -3545), c(5850, -3800))
re <- rbind(c(5850, -3800), c(7560, -3545), c(6900, -100),…

Nic
- 363
- 2
- 8
0
votes
0 answers
How can i use google map type in nestjs project
I have a project written with nest and I want to check if a point is inside given polygon. I figured it is possible via google.maps.geometry.poly.containsLocation() function but I couldn't figure out which module to install.
I wasn't able to find…
0
votes
0 answers
speed up finding intersection between pandas dataframe/geodataframe and polygon
I need to intercept a 25 millions UTM points dataframe with a list of polygons. Point in Poligon problem. My code is taking a lot of time (2 hours). Can anyone please suggest any other way of accelerating this process? Thank you.
Original data is in…

MaCoi
- 1
- 1
0
votes
0 answers
SciPy converting polygon to hull object
I have the following code that takes a series of points from a pandas dataframe (x,y) and a scipy.spatial.qhull.ConvexHull object. This returns all points which are within the hull.
def in_hull(points, hull):
hulleq = hull.equations
dist =…

Spatial Digger
- 1,883
- 1
- 19
- 37
0
votes
0 answers
Calculating max distortion caused by the usage of spherical coordinates as if they were Cartesian
Is there a way to calculate maximum distortion error caused by the usage of spherical coordinates as if they were Cartesian?
More specifically max distance error of using straight line edges on equirectangular projection connecting points of a…

zigzag
- 579
- 5
- 17
0
votes
0 answers
MySQL ST_CONTAINS returns false for MULTIPOLYGON with more than 1 polygon
I have a bunch of locations (points) with coordinates stored as geometry points. I've imported spatial data of provinces in my country and I'm trying to determine the province in which each location lays, which worked for 26 of 28 provinces in…

php_nub_qq
- 15,199
- 21
- 74
- 144
0
votes
0 answers
Apply point-in-polygon to multiple polygons with identifier
I have a dataframe with thousands of lat long along with other attributes
> head(df)
created_on latitude longitude day Value Order Total.Value
1 55:40.8 13.01504 80.19199 7/9/2022 2 74 19
2 08:27.0 12.97431 80.19029 …

Ibrahim K
- 1
- 2
0
votes
1 answer
To determine whether a set of points fall inside a polygon, using point.in.polygon in R not working
Given a bunch of 2D points and a polygon, I want to evaluate which points are on the boundary of the polygon, and which are strictly inside/outside of the polygon.
The 2D points are:
> grp2
x2 y2
1 -5.233762 1.6213203
2 …

Pratik Mullick
- 55
- 6
0
votes
1 answer
Convert polygon coordinates without creating an image and testing pixel color
I need to convert a lot of x/y pixel coordinates from polygon segments (680x680) to the grid references (68x68) the polygon contains.
e.g grid references
1, 2, 3, 4
5, 6, 7, 8
9,10,11,12 etc
Performance is the ultimate goal. My working script…

Andy Gee
- 3,149
- 2
- 29
- 44
0
votes
2 answers
point in polygon with `sf`
i am trying to get that each point falls into the respective polygon. Given that I could not do it by aplying sp::over I am trying right now with the tidyverse::sf . I hope that someone can help me with this issue.
enter image description…

Gaaaa
- 115
- 9
0
votes
1 answer
Getting coordinates from random points in polygon and sync it with shapefile in QGIS
In QGIS, I have a shapefile that contains a polygon of administrative boundaries in a country. I need to add six random points inside the polygon.
Can i get the coordinates from random points feature and sync it with my polygons?
Ex: I have US…

Ryukazu Saviestyan
- 11
- 1
0
votes
1 answer
Determine if geopandas point is in generic polygon with holes
This thread here gave a solution of how to determine if a geopandas POINT is in a solid POLYGON.
What would be a generic solution to determine this for a POLYGON with holes, i.e. MULTIPOLYGON.
For e.g., using foo below:
from shapely.geometry import…

Tristan Tran
- 1,351
- 1
- 10
- 36
0
votes
1 answer
Trying to identify if a point lies within a drawn polygon
I am trying to figure out a mathematical way to identify if a point lies inside a polygon that I draw with turtle. I am trying to only use turtle and math library to achieve this. I am not using classes either.
However the problem I am facing with…