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
Return ZipCode if point in Polygon (shapely)
I have a DataFrame A with a column of points:
points Code
0 Point(1.23, 1.34) ?
1 Point(1.32, 3.56) ?
2 Point(-1.09, 2.11) ?
.
.
I also have another DataFrame B with a column of Polygon:
…

M.Z
- 253
- 1
- 4
- 9
1
vote
0 answers
Detect hit inside a closed SVG polygon with JavaScript
In a barebones test, I have created an SVG pentagon with a rectangle that fits it exactly. I run svg.checkIntersection(pentagon, rect) to test if a 1x1 rect is within the area of the pentagon.
This returns true for any point within the bounding rect…

James Newton
- 6,623
- 8
- 49
- 113
1
vote
2 answers
How to group latitude/longitude data into different groups based on a shapefile?
Original Problem : I have a data set where each row has latitude and longitude within limits of New York. Now I need to group each row into one of the zipcodes in New York. I have shapefiles with all the boundaries available from…

qwerty123
- 479
- 1
- 3
- 14
1
vote
1 answer
Crossing number/Winding number polygon test expressed as binary (Python)
I'm trying to make an implementation of either a winding number or crossing number test, built mainly around boolean operations.
The boolean requirement is due to the methods and efficiency of the underlying dataset, making it sub-optimal to…

JonDeen
- 41
- 8
1
vote
1 answer
Point in Polygon function for MySQL
I have GPS information stored in multiple MySQL tables structured like the following:
(Running MySQL Server version 5.5.43 on Ubuntu Server 14.04.1)
event_number, time, latitude, longitude
1, 12:52:50, 40.5401, -86.5715
1, 12:52:51, 40.5404,…

mi7c514
- 23
- 3
1
vote
1 answer
Using a Raycasting Algorithm for Point-In-Polygon test with latitude/longitude coordinates
I already successfully used the DotSpatial.Contains function for testing whether each of my points (1.8 million) lie within my shapefile or not. However, the algorithm is very slow, as I am testing against a large number of points and very complex…

Alex
- 2,784
- 2
- 32
- 46
1
vote
1 answer
Swift: Point in polygon? How can I check if a user's location falls within a Geo-JSON polygon?
I have a user's location coordinates. Given the location is in one of the polygons, how do I return in which polygon it falls, by OBJECTID, using Swift or Objective-C?
The sample JSON polygon data I am using looks like this:
{ "type": "Feature",…

ds1
- 49
- 1
- 1
- 4
1
vote
1 answer
Point in Disjoint Polygon
I want to check whether a given point lies inside a polygon.
I have looked into the point in polygon method using ray casting, but I'm unsure of how it will work in cases where the given polygon in disjoint. For example, if the polygon has a "hole"…

psn
- 43
- 8
1
vote
2 answers
Does this mySQL Stored Procedure Work?
I got the following stored procedure from http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html
Does this work?
CREATE FUNCTION myWithin(p POINT, poly POLYGON) RETURNS INT(1)…

Laxmidi
- 2,650
- 12
- 49
- 81
1
vote
1 answer
Point inside arbitrary polygon with partitions
Say I have a polygon. It can be a convex one or not, it doesn't matter, but it doesn't have holes. It also has "inner" vertices and edges, meaning that it is partitioned.
Is there any kind of popular/known algorithm or standard procedures for when I…

htcoelho
- 65
- 7
1
vote
0 answers
Point in Polygon *On a map*
I'm using Visual Studio 2010, including reference Dynamic Data Display map.
I'm drawing on the map polygon by drawing DragglePoints and Segments between the points.
I found a code that find if point(x,y) is in polygon, but on a map it doesnt work.
…

Ben Tubul
- 45
- 1
- 9
1
vote
1 answer
How to add multiple line like paragraph within polygon
In my web page, there are many irregular polygon shape .Now i have set each line x and y axis value within tag, but i would like add multiple line like paragraph within polygon and it can automatically line break and align correctly.
Now my code…

abdul
- 57
- 2
- 12
1
vote
1 answer
Finding a point inside Polygon for Latitude and Longitude
Here is my code which I modified and took from this question Find Point in polygon PHP
And the vertices x and y form a rectangle..I am not still able to make it work even though the point y and x are inside polygon it's not displaying the correct…

Shan
- 2,822
- 9
- 40
- 61
1
vote
0 answers
Building delivery list based on distance and point in polygons in LAMP App
Building a LAMP services application that will have 10000's of Vendors providing delivery to Customers, and upon the Customer entering their address, we need to generate a delivery list of Vendors which can provide service to that location. Each…

user30363
- 11
- 1
1
vote
1 answer
Finding a point within a 3D Voronoi region
I'm make use of Scipy's spatial package Voronoi class to generate a 3D tessellation of input points. I then randomly insert points within the "box" domain. Where I'm having trouble is figuring out how to check if a random point is within a given…

user3611086
- 13
- 3