Linked Questions

0
votes
0answers
12 views

Efficienctly determine which of a set of coordinates which are contained within a set of closed polygons via python [duplicate]

I'm trying to determine which of about 300,000 points fall within any of 215 closed polygons. My code right now loops through each point and then through each shape to see if it the point is ...
10
votes
2answers
32k views

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 (...
8
votes
4answers
7k views

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() ...
6
votes
2answers
5k views

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 ...
9
votes
2answers
3k views

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 ...
8
votes
3answers
3k views

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: ...
3
votes
2answers
8k views

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, ...
2
votes
2answers
2k views

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 ...
1
vote
1answer
3k views

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: ...
1
vote
2answers
4k views

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: https://stackoverflow.com/questions/20776205/point-in-polygon-with-geojson-in-python However, my output says that none of the ...
3
votes
1answer
3k views

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 ...
1
vote
1answer
3k views

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 ...
1
vote
1answer
3k views

Performing Spatial Join / match Points from dataframe to polygons using Python?

I have a dataframe with coordinates and other attributes, and a shp file (the whole package with shx and dbf as well) with many polygons of neighborhoods. I need to match each point to which polygon ...
4
votes
0answers
3k views

Point in Polygon using Rtree and Shapely

I am wondering what the correct syntax is for doing a point in polygon search using Shapely and RTree. I'm really interested in speeding the process up using the RTree index but am not having any luck ...
1
vote
1answer
1k views

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 (...

15 30 50 per page