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
Label a point depending on which polygon contains it (NYC civic geospatial data)
I have the longitude and latitude of 5449 trees in NYC, as well as a shapefile for 55 different Neighborhood Tabulation Areas (NTAs). Each NTA has a unique NTACode in the shapefile, and I need to append a third column to the long/lat table telling…

kmgong
- 1
0
votes
1 answer
Point in opengis Polygon
I have a given opengis-Polygon (org.opengis.geometry.coordinate.Polygon) and I need a method to determine whether a given point is within the area that that Polygon spans up. Up until now I used: polygon.getBoundary().getMbRegion().contains(point).…

Max Dietrich
- 29
- 5
0
votes
2 answers
Calculate pixels within a polygon
In an assignment for school do we need to do some image recognizing, where we have to find a path for a robot.
So far have we been able to find all the polygons in the image, but now we need to generate a pixel map, that be used for an astar…

Androme
- 2,399
- 4
- 43
- 82
0
votes
1 answer
Calculating if mouse position is within bounds of a diamond polygon
I have a diamond drawn on a panel and I'm trying to calculate if the mouse position is within its bounds. The problem is trying to the diamond, it needs four coordinates making up four lines to create the shape.
The easy thing to do is to…
user868935
0
votes
2 answers
Index for fast point-(> 100.000.000)-in-polygon-(> 10.000)-test
Problem
I'm working with openstreetmap-data and want to test for point-features in which polygon they lie. In total there are 10.000s of polygons and 100.000.000 of points. I can hold all this data in memory. The polygons usually have 1000s of…

user2033412
- 1,950
- 2
- 27
- 47
0
votes
2 answers
Find Point 2 mile away from polygon PHP
I have the polygon data, in the form of an array of latitudes and longitudes in mysql database, ex:
an array of latitudes and longitudes in mysql database.
[["x":23.628134, "y":27.458334],
["x":23.629867, "y":27.449021],
["x":23.62324, …

Krishna Ghodke
- 589
- 2
- 6
- 26
0
votes
1 answer
Is there a way to determine if a given point (lat, long) is inside a drawn polygon?
I have a KML file with about 5 polygon placemarks and I was wondering if there's a way to determine if a specified point is inside any of the polygons. Does Google Earth have a function to do that or can one be written?

Carmen
- 25
- 1
- 1
- 4
0
votes
1 answer
point in polygon with segement intersection java
i'm looking for a algorithm to test if a point is lying inside or outside of a polygon (in our case we're interested whether the point is lying outside of the minimum bounding box of a polygon). We had an idea to test if a segment of the point has…

patriice
- 39
- 2
- 6
0
votes
1 answer
Point in Polygon Test
I have searched for lot of threads but still I am facing the issue.
I have to find out if a lat/lng is inside or outside the polygon. I have used following method:
private boolean LineIntersect(LatLng tap, LatLng vertA, LatLng vertB) {
…

Neharika
- 95
- 11
0
votes
2 answers
Can't find polygons in database where point is within
I am trying to use a method to determine if a Lat,Long coordinate is within any of the stored polygons in the database and return a list of the ones it falls in (if any).
I have a lat/long of:
50.120578, -103.535156
I created a geofence and stored…

devfunkd
- 3,164
- 12
- 45
- 73
0
votes
1 answer
Point in polygon: whats xints?
I am using following code for checking if point lie inside or outside of a given polygon:
def point_in_poly(x,y,poly):
n = len(poly)
inside = False
p1x,p1y = poly[0]
for i in range(n+1):
p2x,p2y = poly[i % n]
if y >…

sau
- 1,316
- 4
- 16
- 37
0
votes
2 answers
Polygon Collision Testing / Polygon Overlap Test in C# - Not Point in Polygon
I am testing to determine if two polygons overlap. I have developed a first version which does a simple point in polygon test (Fig 1). However I am looking to revamp that method to deal with situations where no vertices of polygon A are in polygon B…

David J Barnes
- 506
- 9
- 15
0
votes
1 answer
Android GoogleMaps , How To Check Point (Latitude and Longitude) Inside a Polygon
there has been some questions about latitude and longitude inside a polygon
but i still don't get any answer for my problem
here is my problem :
let's say we have a polygon looks like a rectangle
(in real problem , it won't shape only like a…

Yogie Soesanto
- 172
- 1
- 3
- 13
0
votes
3 answers
Point in convex polygon
I'm trying to make a function that will return True if the given (x,y) point is inside a convex polygon. I'm trying to make it without numpy or any similar imports, just pure python code.
I've already found a sample solution, which seems OK at first…

John Berry
- 179
- 1
- 3
- 9
0
votes
2 answers
Point in KML Polygon - C / C++ code
I am looking for C or C++ code to identify whether the point (a co-ordinate) lies inside a KML polygon or not.
I have searched but all I got is javascript (google maps apis) which can achieve the same. I cannot even port it directly because I have a…

Raj Pawan Gumdal
- 7,390
- 10
- 60
- 92