Questions tagged [point-in-polygon]

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.

275 questions
2
votes
4 answers

POSTGIS: find all the points within a polygon

I have a table containing point CREATE TABLE Points { pointID BIGSERIAL PRIMARY KEY NOT NULL, thePoint GEOGRAPHY(POINT) } CREATE TABLE Polygons { polygonID BIGSERIAL PRIMARY KEY NOT NULL, aPolygon GEOGRAPHY(POLYGON) NOT NULL, } I wish to…
liv a
  • 3,232
  • 6
  • 35
  • 76
2
votes
2 answers

Assign point with largest population from set of points contained in a polygon

I'm trying to add a "population-based-centroid" column to a series of U.S. county polygons, where the location is not based on the geographic centroid of the polygon, but rather on the location of the geonames populated place with the largest…
2
votes
2 answers

Determine if a point is interior or exterior to a 3D Alpha-shapes surface in CGAL

I am using CGAL to create the concave hull of a set of 3D points using ex_alpha_shapes_3 example. Next, I would like to find out whether a point query in space is located within the surface created by the triangular concave hull faces (the output of…
Vahid
  • 125
  • 12
2
votes
1 answer

Querying a fusion table to see if a polygon contains a coordinate

Is there a way to determine if a coordinate is inside a fusion table layer? I tried to do this with a few homegrown methods but around 6% of the locations I’m testing are returning false results. One of the results says that Glasgow is not in…
2
votes
1 answer

GEODjango: select all objects that are contained in a POST request given polygon

my request has coordinates that form a polygon. plist = [] ... plist.append(fromstr('POINT(%s)' %(value))) ... p = Polygon(plist) using the GeoDjango I'd like to select all the objects (places.objects.all()) from a table that are contained in the…
Kukula Mula
  • 1,788
  • 4
  • 19
  • 38
2
votes
1 answer

c# Best way/datastructure to find all polygons that contain a coordinate?

I have about 10'000 polygons consisting of lat/long points. Each polygon has metadata about what it is and what it contains. All polygons can intersect each other. What I want to do now is to get all polygons that contain a specifc lat/long…
Van Coding
  • 24,244
  • 24
  • 88
  • 132
2
votes
0 answers

R: Determining whether a point lies inside a region made up of separate polygons generated from contourLines()

I am using the function contourLines() in R to record the vertices of a contour based on a probability density estimation. Then I test to see whether a point lies inside the contour region. I can do this test easily when there is only one region…
galahol
  • 21
  • 2
2
votes
1 answer

Count the no of pixels on a polygon

I have been taking an image and drawing a contour on it. I need to count the no of pixels and the positions of them too in three categories (in MATLAB) The pixels that are outside the curve The pixels that are inside the curve The pixels that…
roni
  • 1,443
  • 3
  • 28
  • 49
2
votes
2 answers

Simple java game: Filling up figures drawn by a moving cursor

So I'm doing the project of an introduction to Java course and it seems that I chose something that goes way beyond what I'm able to do. :P Any help would be greatly appreciated. This is what I'm having problems with: You have a cursor that is…
2
votes
1 answer

Adding a polygon directly in Geodjango/PostGIS

I'm messing around with Geodjango, and I just want to add a simple polygon field to a database and then run a point-in-polygon on it to to make sure everything is working okay. Here's my code in views.py: #adding a polygon pe =…
Steve
2
votes
1 answer

MySql Geospatial bug..?

This question is for Mysql geospatial-extension experts. The following query doesn't the result that I'm expecting: create database test_db; use test_db; create table test_table (g polygon not null); insert into test_table (g) values…
sivabudh
  • 31,807
  • 63
  • 162
  • 228
1
vote
0 answers

mysql polygons (How to substitude the bounds)

I am storing the bounds returned by google. These are in the form of ne_lat, ne_lng, sw_lat and sw_lng coordinates. i was looking in mysql ploygons function for some implementation, here is sample function with some sample…
Suleman Siddiqui
  • 411
  • 2
  • 5
  • 16
1
vote
1 answer

Special polygonial for loop in two dimensional array

This is a bit tricky question for you computer scientists. Let's say that I have a two dimensional array/matrix of 100 by 100 entries, arr[i][j]. Where i and j goes from 0-99. This can be envisioned as a square of dots with each dot corresponding to…
Nicke
  • 133
  • 12
1
vote
0 answers

Algorithm to find optimal pose of known polygon to cover a set of points

I have the following problem: Given a set of points S in the plane and a known polygon P, find the optimal translation (Δx,Δy) and rotation φ such that P translated and rotated by this transform contains the maximal number of s ⋲ S. I have found one…
oarfish
  • 4,116
  • 4
  • 37
  • 66
1
vote
1 answer

How Can I Classify Points Under Sub-Regions on a Map in GeoPandas?

I have a map in geopandas and have overlayed it with a scatterplot of events: The shape file breaks the geography into sub-regions (as shown in the picture above). However, the scatter plot points do not have information on the subregions to which…