Questions tagged [point-in-polygon]

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

Filter by
Sorted by
Tagged with
4
votes
1answer
11k views

Detecting if GPS coordinates fall within polygon of points?

I'm looking for a simple explanation on how to detect if GPS coordinates fall within a polygon of points. I would prefer an explanations that can be done using paper and pencil and not programming ...
3
votes
1answer
2k views

Find if lat/long point is inside an area

I have got data using OpenStreetMaps Ways of many areas. I would now like to write a function which would return "true or false" if an single latitude/longitude point is found in that area or not. I ...
0
votes
1answer
433 views

Creating equally spaced points within shapefile with multiple polygons using QGIS?

In QGIS 2.18. I have a vector shapefile with multiple polygons, all of these are squared and have their own attributes. Inside these polygons I will have more (small) polygons that will represent ...
8
votes
4answers
7k views

Looking for GeoPandas QGIS equivalent of ArcGIS "Select by location" tool

I have two GeoDataFrames: A single multi-part polygon Many points I have read them in with the following: import geopandas as gpd poly = gpd.read_file('C:\\Users\\srcha\\Desktop\\folder\\poly.shp') ...
1
vote
0answers
42 views

ArcGIS JavaScript API find the polygon a point belongs

I have a shapefile containing polygons and whenever a user searches an address I store latitude and longitude of the location. I want to know which polygon this address belongs and I have id assigned ...
3
votes
1answer
459 views

count points in polygon returns wrong counts in QGIS 3.0.1

In QGIS 3.0.1, the vector analysis algorithm 'Count points in polygon' is returning wrong counts for some polygons. The counts returned for all of the polygons which do not contain any points appear ...
2
votes
2answers
349 views

Assigning projections in loop using R?

I'm using R to do some geospatial analysis. Basically, I am trying to solve for a method of doing poly.counts when my data is too large for my laptop (and R complains about the matrix being too large)...
0
votes
1answer
265 views

Finding area within set radius using QGIS?

I'm new to QGIS and I want to use it to model the land area within a 90km radius of a point. I have my location and I have 32 shapefiles and I would like to draw a 90km radius around my initial ...
3
votes
2answers
681 views

Auto-updating count of points in polygons?

I have a Point shapefile and a Polygon shapefile. Is it possible to create a field into the attribute table of the Polygon shapefile with the count of points inside each polygon, such that if I add a ...
4
votes
1answer
2k views

Checking if point lies with GeoJSON polygon in PostgreSQL

I have already parsed my GeoJSON in PostgreSQL and my table looks exactly like the answer to Storing GeoJSON FeatureCollection to PostgreSQL with PostGIS? Now I want to query PostgreSQL with lat/lon ...
2
votes
1answer
376 views

point.in.poly (spatialEco) in R doesn't add all attributes to points in the newest version?

Recently an update became available for spatialEco, an argument poly.id was added, allowing you to work NA's (after this discussion). For some reason the attributes from the polygons are no longer ...
1
vote
1answer
677 views

Using QGIS, automatically create n polygons fully covering an area without overlap with an approximately equal number of points in each polygon [closed]

I'm trying to avoid/simplify the following manual process intended to create a polygons layer with exactly n polygons so that each polygon encloses the same or close to the same number of points in an ...
3
votes
0answers
72 views

Dynamic filtering based on selected Layer in ArcGIS Desktop?

I am not sure this is even possible, I have about 38 geographical polygon layers showing areas of the UK, I also have a query (point layer) that shows all of the offices around the uk. What I am ...
1
vote
1answer
531 views

Optimal point distribution within polygons [duplicate]

I have a polygon and want to distribute a certain number of points within that polygon. The Points should have almost the same distance to each other and also to the boundary.
0
votes
1answer
3k views

Determining if point on boundary using shapely? [closed]

I'm new to Python, and I want to test if a certain point lies ON the (boundary) of a polygon - not inside, not outside, just if it's on the boundary. The points and polygon already defined polygon = ...
2
votes
1answer
675 views

STContains on SQL Server vs ST_Contains on PostGIS

I am trying to run a basic point in polygon query against a table of polygons. In PostGIS this works: SELECT * FROM schema.table WHERE ST_Contains( table.geom, ST_PointFromText('POINT(XXX.XXXXXXX ...
3
votes
1answer
59 views

One Record Two Point Geometries - Point-in-polygon

The trip data contains the origin-destination of each trip, and both origin and destination are stored as geometries. How could I retrieve the origin and destination polygons that the points are ...
3
votes
0answers
4k views

Using polygons to create mask on 2d grid with Python?

I have some polygons (Canadian provinces), read in with GeoPandas, and want to use these to create a mask to apply to gridded data on a 2-d latitude-longitude grid (read from a netcdf file using iris)....
1
vote
1answer
605 views

Leaflet-pip - Display properties of overlays polygons

I'm using leaflet-pip to return overlays polygon in a clicked point. Results seems to be good, but I have an array with [object Object]. How can I display the name or specific properties of matched ...
8
votes
2answers
417 views

Generate points in multiple features taking minimum distance into account

I have a function which creates Wind Turbines represented as points. Essentially, it uses the code from the Random points inside polygons (fixed) tool albeit with some slight changes. The goal is to ...
0
votes
0answers
225 views

Centroid Point inside wrong Polygon [duplicate]

In this algorithm I need to create points inside every polygon. The easy solution I was thought was using the centroid. With some help of the community we reach in this algorithm from qgis.PyQt.QtGui ...
5
votes
1answer
181 views

Where is the "input point vector layer attribute" in the "Count Points in Polygon" in QGIS 2.18.9?

In older QGIS versions the Count Points in Polygon vector analysis tool had an "input vector layer attribute to aggregate" to perform a statistical analysis (sum, mean, min, max) on the counted points ...
1
vote
1answer
169 views

st_intersects of zero area polygon and point returns false

I have the following three geometries: PT: Point(0 0) LINE: LineString(0 0, 0 10) POLY: Polygon((0 0, 0 0, 0 0, 0 0)) Calling st_intersects on LINE and POLY returns true (as though POLY describes ...
1
vote
1answer
228 views

Count points in polygon - sum is giving NULL results

When doing the "count points in polygon" I set up a sum of one the parameter. The problem is that at the end I get "NULL" for this column. Everything else is working well. I tried with integer, whole ...
2
votes
2answers
3k views

Joining attributes from points to polygons

I have a polygon layer without data, and a point layer with attributes. Each point is contained in one polygon, and I would like to have the data from the point layer joint in the polygon layer, so ...
1
vote
1answer
803 views

r - Create grid (or polygons) over shapefile that vary in area but equal in number of points encompassed

I am using R's various spatial analysis features. I have data from a number of sampling locations throughout Africa, distributed unevenly. For several reasons, it is of interest to break our Africa ...
6
votes
1answer
3k views

Finding State, County, Place, and Census Block FIPS codes from a coordinate (latitude and longitude)

I am looking for a way to gather the political areas (ie FIPS codes) from a latitude and longitude coordinate. For example, if I were to input the coordinates: 47.66955, -122.31259 (Downtown Seattle),...
3
votes
1answer
3k views

How to subset point data by outside of polygon data in R

How can I subset point data from outside of polygon data in R? Currently, I can subset point data inside polygon data, now I want to get point data outside polygon data. library(sf) nc <- st_read(...
2
votes
1answer
128 views

Controling polygons centroids alignment in QGIS?

I am using Polygons Centroids feature in QGIS and it does an amazing job. My goal though is to set the points on the left side of the polygon and not in the center. Is there a way to control the ...
2
votes
1answer
21 views

Subtracting out whole regions using occurrences (points)

I have a bunch of occurrence points of animals scattered across a global map, and an eco-region map underneath it. I want to identify the eco-regions (i.e. Tundra) that does NOT contain any occurrence ...
2
votes
2answers
2k views

Combining points and their values within the same cell in QGIS

I have two shapafiles: points and vector grid. I need to combine points which are in the same cell(or cross cell) and sum their values. How can I do this in QGIS?
1
vote
1answer
621 views

Finding point in polygon in SQL Server?

I am downloading polygons from one of our feature layers on ESRI Online. I am creating sqlgeometry polygons in a table in MSSQL server. Then I am downloading some points that come from another ...
1
vote
0answers
61 views

Methods to more efficiently generate regularly spaced research points inside of a multipolygon

I'm currently using the tried-and-true, but extremely slow method of: via QGis, generating two (ESRI shapefiles) of a large number of research points over a multipolygon which are generated using a ...
2
votes
1answer
1k views

Getting all attributes of all points within polygon in ArcMap? [duplicate]

I have a map with location of schools within districts. I was wondering if I can extract all fields of each data point within a polygon and how to go about doing it in ArcMap 10.5? I produced this ...
1
vote
0answers
79 views

Extracting attributes of points within overlapping polygons in ArcPy? [closed]

I have a set of overlapping polygons and a line of points. A single points can fall within any number of polygons, and I need to determine the attribute values of points that fall within each polygon. ...
3
votes
1answer
3k views

Bind polygon centroid to polygon attribute data

I am trying to bind a dataframe containing polygon centroids to the polygon attributes. Here's what I've done so far to create the centroids: library(rgdal) library(PBSmapping) library(maptools) ...
2
votes
1answer
867 views

Spatial Index error?

I am trying to sum the number of fires in each state of the US. I have a shapefile for the states and I have a shapefile for each fire. Vector->Analysis Tools-> Count points in a polygon isn't working ...
4
votes
1answer
2k views

Count points in polygon results in error "'NoneType' object has no attribute 'geometry' See log for more details"

I'm new to QGIS and have the following problem: I'm trying to use the "Count points in polygons" tool, but always get an error ('NoneType' object has no attribute 'geometry' See log for more details). ...
2
votes
1answer
6k views

Convert lat/lon mysql columns to geometry, check if point is in polygon, return polygon id

I have a mysql database table with many ids, each id has a "start lat", "start lon" "end lat" and "end lon" column. I want to check in wich polygon the start point belongs (and write this in a "start ...
2
votes
2answers
2k views

Enlarging polygon slightly using R?

Consider the following scenario: I have made polygon of mainland Africa + Madagascar. From a different source I have got some point data about this area. The point data include points in small ...
3
votes
2answers
2k views

Create column to identify in which polygon does the point lie (QGIS)

I have a polygon shapefile and a point shapefile. At the point shapefile, I want to create a column, which will inform me about the polygon where each point exists. What do you suggest? I mainly use ...
2
votes
1answer
113 views

AcrMap- How to use the dissolve tool with large amounts of polygons?

I am a college student working on an independent research project and I am trying to figure out how many points fall within a polygon. I am examining the impacts of zoning in the Great Barrier Reef ...
18
votes
2answers
17k views

Converting cluster of Points to Polygons using QGIS

I have an input point layer that is grouped into clusters, so I want to have each cluster of points converted into polygon. This question How to convert a set of points to a polygon based on a ...
3
votes
1answer
1k views

Counting how many times a point is inside a set of intersecting polygons in R

I have a set of points (latitude and longitude) and a set of polygons with the same CRS. Since some of the polygons are interescting, it may be that some of the points are in more than one polygon. ...
4
votes
1answer
666 views

Generating dummy variable if point lies inside polygon using QGIS

I have a set of polygons in JSON or GeoJSON format and a set of points in a CSV (both containing geographic coordinates). I am able to join these two datasets in QGIS and display them. I want to ...
4
votes
1answer
2k views

Problem points into a shape polygon

I want to determine which points from a set of hundreds of geographic coordinates are located into a shape polygon. I was able to convert all the coordinates (latitude and longitude ) into a ...
10
votes
1answer
13k views

How to find points within a polygon in PostGIS

I have a series of lat and long coordinates I've loaded into a spacial table (Nov01) in PostGIS, and I've created a geometry column in the table. I also have a shapefile (greatermanchester) I've ...
0
votes
1answer
2k views

Spatial join polygons to points in ArcPy

I am trying to spatially join a polygon shapefile to a point shapefile such that every point is matched to the characteristics of the polygon it falls inside. I have succeeded to do this spatial join ...
2
votes
1answer
181 views

Is there a way to assign a feature from the majority of points to a polygon with *join attribute by location* QGIS 2.18

I am working on a map of ethnic groups and I am looking to do two closely-related things by joining attributes from points to polygon. 1) I would like to assign the mode of (string) values of points ...
1
vote
0answers
105 views

Create fixed number of Points within polygon [closed]

I have a polygon shapefile containing 50 features. I have another list where those 50 features are listed with how many number of points need to be created within those polygon. Suppose I have a ...

1 2 3
4
5
8