Linked Questions

0 votes
0 answers

Iterating in a points geodataframe and then check if point is inside polygon [duplicate]

I'm trying to make a spatial verification. I have a geodataframe with 245 points, and I'm having a bad time trying to check if they're inside a polygon or not. I've been attempting this code, but I ...
Rodrigo Brust's user avatar
22 votes
3 answers

Check if a point falls within a multipolygon with Python

I have tried several examples of code using libraries such as shapefile, fiona, and ogr to attempt to check whether a point (x, y) falls within the boundaries of a multipolygon created with ArcMap (...
spartmar's user avatar
  • 553
15 votes
4 answers

How to efficiently access the features returned by QgsSpatialIndex?

The PyQGIS Cookbook explains how to set up the spatial index but it only explains half of its usage: create spatial index — the following code creates an empty index index = QgsSpatialIndex() add ...
underdark's user avatar
  • 84k
12 votes
3 answers

geopandas error "minimums more than maximums"

I posted this question on stackoverflow here, but it seems that gis.stackexchange is the more appropriate platform. I am trying to merge two geodataframes in geopandas (want to see which polygon each ...
Alexis Eggermont's user avatar
14 votes
2 answers

Filter a GeoPandas dataframe for points within a specific country

I have a dataframe of health survey data which is geotagged, called momdata. I have converted the dataframe to a GeoPandas dataframe, and used the geotags as the geometry column within the dataframe, ...
LucieCBurgess's user avatar
9 votes
2 answers

Maximizing Code Performance for Shapely

I've written this code in order to calculate the percent cover of grassland within a national park, within 20km^2 of points of recorded occurrences for a species. It is designed to only consider the ...
CSB's user avatar
  • 1,274
9 votes
3 answers

RTree spatial index does not result in faster intersection computation

I have some code that I am using to determine which Shapely Polygon/MultiPolygons intersect with a number of Shapely LineStrings. Through the answers to this question the code has gone from this: ...
derNincompoop's user avatar
9 votes
2 answers

Is there a python option to "join attributes by location"?

I am trying to perform the function join attributes by location as found on the QGIS menu Vector>Data Management Tools. I am seeking an open source python option for this. I know arcpy has a spatial ...
mishaF's user avatar
  • 193
4 votes
1 answer

How To Properly Implement a Bounding Box for Shapely & Fiona?

I am trying to spatially analyze two layers within same GDB file using Python / Shapely. Another user was kind enough to give me a procedure to go by in trying to reduce the number of senseless ...
George's user avatar
  • 521
1 vote
1 answer

Problem intersecting shapefiles with OGR in Python

I'm trying to move from ArcPy for geoprocessing. After searching some posts, I found this solution using the GDAL/OGR Python bindings: Intersect Shapefiles using Shapely My code is the following: ...
Ernesto561's user avatar
1 vote
2 answers

Point in Polygon - geojson - using Shapely / Python returning incorrect results

I'm trying to test if a point is inside a polygon using this example: However, my output says that none of the ...
pceccon's user avatar
  • 113
2 votes
1 answer

Geopandas Intersects Speed

I have recently started using Geopandas and am having a problem with the performance of intersects. The intersect tests whether land parcels have a road within (or across the boundary). Parcel data (...
Mr_Robinini's user avatar
3 votes
1 answer

How to obtain mean, maximum, and mininum of all points located within polygons using spatial joint in python?

I am trying to estimate summary statistics of points located inside a polygon. Each points in the point layer is associated with N attributes. My target is to summarize (say mean, min,..) the ...
PPR's user avatar
  • 491
3 votes
1 answer

Counting number of points in each grid?

I would like to count the number of points in each cell. I have tried but the out isn't appropriate. Does anybody know how I ...
Danial's user avatar
  • 81
1 vote
1 answer

Fastest way to join many points to many polygons in python

I need to attribute a geographical area (based on shapefile polygons) to 8 million GPS points. There are 405 polygons. I currently have the code below, and a quick extrapolation tells me it will take ...
Alexis Eggermont's user avatar

15 30 50 per page