A common GIS operation. Used to determine whether a point lies within a polygon's bounds.

learn more… | top users | synonyms

1
vote
1answer
38 views

Geodjango - trying to get points within a polygon

Edit: I think my problem might be that my data sets include shape_length and shape_area data instead of lat/long(which are included in the World Borders) so I think I need to convert it somehow... ...
1
vote
1answer
29 views

Closest point on a line segment from point outside the line

From the above pic I found the value x from line (p1,p2) and point a. Using y=mx+b and an imaginary red line which is perpendicular to the black line having slope -1/m and the intersecting point ...
3
votes
1answer
47 views

How to create randomly points within polygons for each row of a dataframe matching a Polygon ID with R

My question is similar to this post, but because there are no "perfect" answer and above all no reproducible example I open this question. I have a "SpatialPolygonsDataFrame" and a data frame. Both ...
0
votes
0answers
43 views

Creating a polygon around features

I want to create a polygon around a number of points so that all the points occur within the polygon. The purpose is to do this to a number of different features and see where they overlap.
2
votes
2answers
51 views

How to determine in which grid cell where each coordinate of an x,y series is located?

I have a circular arena which I have divided into a number of equal-sized 'cells' using a grid-like arrangement of concentric circles and line segments (in grey below) and also a series of x,y ...
-1
votes
0answers
39 views

how to determine the direction in point-in-polygon

I am very new to GIS and I am wondering if the following problem could be solved or not. Given that there are three pairs of points(A<-B, C->D, E<-F) Each pair of points has a direction and ...
0
votes
1answer
24 views

Count points in a polygon that changes form (“on the fly calculation”)

I have tried to find a plugin for this, with no luck. Perhaps someone knows of a plugin that can do the following: In this project I create a lot of polygons that contain points, and the size of the ...
0
votes
1answer
61 views

Find polygons that contain a specific number of points

I want to make a polygon selection based on a specific number of points. For example, I want to select those polygons that contain more than 30 points. I don't want to select every polygon that ...
1
vote
2answers
69 views

Find all points in a linestring that are contained by a polygon

I'm fairly new to PostGIS, so I apologize if this has been answered before. I have a linestring made up of 4D points and I need to determine which points in this linestring fall within a specific ...
1
vote
1answer
90 views

Adding points in Empty Polygon

I have a number of polygons on which I wish to make analysis using points data symbols... Is there a method through which I may add points automatically within each polygon in separate locations. For ...
1
vote
0answers
44 views

Programmatically selecting features by polygon

Expanding upon this post how could you use QGis to programmatically draw a selection polygon and select features within the polygon? I have been using QgsMapToolEmitPoint(self.canvas), to find and ...
1
vote
2answers
54 views

How to find all features in one table that intersect features in another table in PostGIS?

I have two tables, boundary polygon table and location point table. I need to find all boundary polygons that contain at least 1 location point. What is the proper way to do this in PostGIS? I tried: ...
0
votes
2answers
122 views

Find maximum and minimum value of points within a polygon buffer?

I have a series of 500m buffer zones along a polyline. I also have a series of points following the line, each point represents a 10m x 10m cell. I calculated the values of a field in each point known ...
1
vote
1answer
41 views

Weird ST_Contains behaviour

I'm creating a polygon and then checks whether one of the origin points is contained inside the polygon. To my surprise, I get False (?!) What is wrong here? SELECT ST_contains(ST_GeomFromText('POINT ...
1
vote
0answers
38 views

Using polygons with libspatialindex

I am investigating using some C/C++ libraries for point-in-polygon lookups and libspatialindex seems popular. I've written some code that seems to do what I want but I'm not entirely sure if what I ...
1
vote
3answers
115 views

How to count points once with overlappying polygons?

All, We're using parcel data (polygon) to count student locations (point) based on parcel type. We're doing this using SQL and the ST_Intersects function. It works great, except the City and County ...
1
vote
1answer
75 views

PostGIS ST_Within returns zero data

I am using PostgreSQL 9.3.3 & PostGIS 2.1.1 and I have a table Entries which has a column called "latlng" of geographic type (this column stores entry's latitude and longitude coordinates). I am ...
6
votes
3answers
538 views

Overlay a spatial polygon with a grid and check in which grid element specific coordinates are located

How can one use R to split a shape file in 200 meter squares/sub-polygons, plot this grid (incl. ID numbers for each square) over the original map below, and evaluate in which square specific ...
1
vote
1answer
48 views

Identify geographic location to points

I am quite new in QGIS and I really need your help. I have a map of Kenya divided into 68 districts and I have coordinates of 30.000 schools. The points have one variable besides the latitude and ...
3
votes
1answer
51 views

Qgis creating point within complex shapes (with holes) [duplicate]

I'm looking for a tool to create a point in every polygon, that will be placed in the polygon. these are complex shapes with holes. the point must not put in those holes! the "plugin RealCentroid" ...
5
votes
1answer
424 views

Shapely unable to tell if polygon contains point

For an application I want to determine under which constituency a given coordinate falls. After looking at the various options, I decided upon shapely and fiona as the easiest way to implement this. ...
0
votes
1answer
28 views

Determine when a route enters and leaves a polygon

I have all of the segments of a route from White Horse, YK to Miami, FL. Now I want to determine how many miles I travel in each State / Province. I have Polygons for each State and have been able ...
2
votes
2answers
190 views

How to find the row that has a shape file containing a lat long point in my PostGIS geometry column

I am fairly new to PostGis and I'm trying to return a row in my table that has the shape file containing a lat long point I pass in via st_contains. Below is a query I wrote myself that brings back 0 ...
1
vote
1answer
49 views

Use field calculator in QGIS so get number of points in polygone and store it in attribute table

I have to layers, one point one polygon (with 6 areas) stored as shapefiles. Now I want to count the number of points in each area and write it into the attribute table of the polygons. A column ...
0
votes
1answer
640 views

How to find points inside each polygon in Mysql?

I have points table (with latitude and longitude columns) and polygons table with geometry stored in Mysql. I want to get points inside one polygon, for example in polygon which has column ...
1
vote
0answers
91 views

DotSpatial: Convert a Polygon Feature to System.Drwing.Region

I want to paint a Polygon region with a color. I know I can use Symbolizer to do this but I want that region to blink (change it's color in a timer) and using symbolizer seems to be slow for this ...
2
votes
3answers
90 views

How to write FIDs of points within each polygon to polygon field?

I have two feature classes one with points one with polygons (in ArcGis 10.2). Now, I want to write into a String Field of the polygon layer a list of all the Point-FIDs that are within each polygon ...
1
vote
3answers
350 views

How to create random point in according polygon for each dataset entry in a list (with R)

I have an area divided into polygons, and a dataset of observations which has a common field with the polygon layer. I now would like to generate a random point for each dataset entry within the ...
1
vote
2answers
572 views

Python - GDAL : Polygon to point shape file

I want to read all the points in a polygon shape-file and use their coordinates to make a new point shape file. then find the min and max of the X coordinates. So here is the code I wrote for the ...
2
votes
1answer
152 views

Fast zipcode detection from latitude/longitude

I need a way to get the zipcode of a lat/long pair fast (<10 ms), and at a high rate (thousands of qps) I've loaded a shapefile from the US Census Bureau into a mysql database with spatial ...
0
votes
2answers
138 views

Intersection between points and polygons in QGis

I have the following problem. I have a shapefile of points and a shapefile of polygons. I want to know WHAT points (not how many) fall inside EACH of the polygons of my multipolygon shp. I thought ...
1
vote
0answers
101 views

Divide polygon based on points for even distribution

If I have a point layer, how can I create a polygon that includes all of the points and divide that polygon into n sections in which each section contains an equal number of points? Preferably in ...
2
votes
0answers
55 views

What is the MS SQL Spatial syntax for counting points within polygons? [duplicate]

All, What I'm trying to do is this: Count points within polygons There are thousands of points and maybe 2 dozen polygons Get a list back of the 2 dozen polygons by name and the count of points ...
0
votes
1answer
921 views

How to extract polygon location data (County) to a point shapefile (only has DMS)

I have imported an excel spreadsheet to my map and the points have fallen into certain locations. How do I add the location of the polygon that the point has landed in, to the attributes table of the ...
1
vote
0answers
126 views

Can I get a list of points in a polygon using Quadtrees?

I'm storing vertices in a PR (or PM if needed) quadtree and would like to be able to: Find out if a given polygon contains at least one point Optionally: Get a list of all the points within a ...
1
vote
1answer
86 views

Finding point in polygon

I want to calculate a point in a polygon, if the centriod falls inside the polygon it is what I want, but if it doesn't I would like it to be a visual center point. Essentially I want to do the ...
1
vote
1answer
91 views

Add buffer only on one specific side of polygons

I have a shapefile with multipart geometry (multipolygons), namely communities (blue on the picture below). There are also lakes (white), but for these I don't have a geometry, they're just "empty". ...
0
votes
0answers
132 views

Point in polygon analysis fails with “TypeError: arguments did not match any overloaded call”

I am using QGIS 1.8 on Windows 7 I want to perform a point in polygon analysis using the Vector > Analysis Tools menu. My point layer is the result of a SpatiaLite query which returns 10'000 points. ...
2
votes
2answers
560 views

Checking if Lng and Lat fall inside polygons from ESRI Shape file

I have two input files. First: CSV file with a list of points each defined with Lng, Lat, Name Second: ESRI Shape file defining a number of polygons I would like to determine for each point I have ...
3
votes
2answers
110 views

How to query for a specific point, within a specific polygon?

I have a shapefile points layer, with each point representing either Marginal, suboptimal, or optimal conditions. I want to find only the marginal points within a specific polygon from my catchments ...
2
votes
0answers
108 views

ray casting on earth's surface

Is it safe to use ray casting algorithm to check if a coordinate is inside a polygon specified as coordinates? Purpose of my question is because the longitudes are not parallel in a Cartesian sense, ...
2
votes
0answers
159 views

How can I improve my Ray casting algorithm?

I have been using the following function below which have been working well to decide if a point in the polygon but once I have many points which is building the polygon say over few thousand it seems ...
2
votes
0answers
112 views

Matching points in table to polygons

this is my first post to this forum. I hope to start participating actively. I have a table with several records (aprox 200.000), each with its own coordinates. And I need to identify the "Polygon" ...
1
vote
1answer
1k views

Count Points in Polygon with Postgis

I've got a simple problem: I want to count the number of points within a set of polygons. I have a SQL already but it only gives back the gid of the polygone that actually contains points. My ...
4
votes
2answers
804 views

Total of attribute field of point layer per polygon layer

I have a polygon shapefile of many lakes, I also have a point shapefile of locations on those lakes where fish were caught. The point shapefile contains the attributes: Fisherman_iD, Fish_Caught, ...
4
votes
1answer
444 views

MongoDB: Search for polygons which have a certain location

Good day :). I am trying to implement a search feature on MongoDB using Mongoose.js , the short version of which is this: I tag locations on a map as polygons. and give them names. Then when an user ...
0
votes
1answer
52 views

Display county for random points

I have a county level shape file for South Carolina. I generated random points using Vector->Research Tools-> Random Points. The Attribute tables for the random points layer has only the ID included. ...
2
votes
1answer
239 views

Tearing in ggmap (R) after using spTransform and random point generation using splancs

I am using R and the package ggmap to try and generate some random points within the city limits of Chapel Hill, NC. I have downloaded the shapefile for the town of Chapel Hill from the Orange County ...
5
votes
1answer
402 views

How to determine optimal windmill placement to maximize production?

How can I add automatically the maximum number of points (dots) with 6m diameter and 100m distance each point from other into an area. The dots will present the windmill base (6m) and I want the ...
4
votes
1answer
1k views

STIntersects - Update field to give me count of points in polygon

I have a points layer (dbo.ptLayer) Around 1M points Spatial Geometry Type (dbo.ptLayer.geom) No spatial index just yet, but will create one once data gathering complete. I have a polygon layer ...