Questions tagged [geopandas]

GeoPandas is an open source project to make working with geospatial data in python easier. GeoPandas extends the datatypes used by pandas to allow spatial operations on geometric types.

GeoPandas is an open source project to make working with geospatial data in python easier. GeoPandas extends the datatypes used by pandas to allow spatial operations on geometric types.

Geometric operations are performed by shapely. Geopandas further depends on fiona for file access and descartes and matplotlib for plotting.

If you're having trouble running or installing geopandas, it is recommended that you use conda to install geopandas into a new conda environment. When installing the GIS stack, it's recommended that you pull all of the dependencies from a single channel (e.g., only from the default channel or only from conda-forge):

> conda create --name=gis python=3.7 geopandas --channel=conda-forge

Resources:

2652 questions
0
votes
0 answers

python select polygons containing a point

I would like to select polygons that contain at least a point. I can use QGIS's tool called "Select by location: Select all buildings by location of point". Is there a python alternative? So far, I wrote a jupyter notebook and worked with…
Edo Grm
  • 13
  • 4
0
votes
0 answers

GeoPandas overlay is returning an empty geodataframe when there should be an intersection

I am attempting to overlay and find the intersection between two geodataframes but the result is an empty geodataframe when there should be several intersections. The two geodataframes should be in the same projection. Here are the two individually…
0
votes
0 answers

Can't download packages spyder anaconda geopandas

I have some problems using the package geopandas and now I ran into three problems! First it did not seem to work and I found online that it is possible because I used pip & conda. Trying to fix the problem I deleted Spyder and Anaconda but now I…
Tess
  • 23
  • 5
0
votes
0 answers

How to solve dead kernel on Jupyter?

I am trying to import Cube from iris.cube: from iris.cube import Cube but I keep receiving the message The kernel appears to have died. It will restart automatically. The same happens when I try to use geopandas: REG_data =…
0
votes
0 answers

Permission Denied error with Fiona/GeoPandas

I am currently working on a Python project that reads in shape files using geopandas. Data is then written to a .csv file in another directory. When I run the python code directly I have no issues. Everything works as intended. However, I need to be…
zmangum17
  • 1
  • 2
0
votes
0 answers

Read shapefile bigger than 2Gb with python

I have a shapefile whose .dbf file is 2.1Gb in size and I'm attempting to read it using geopandas or fiona. However, when reading the file, the file is not read in its entirety meaning that I'm losing quite a significant amount of rows. Searching…
0
votes
1 answer

time lapse of transport data in folium

I have data that resembles routes in the Netherlands. Now I want to show these routes on a folium map using some sort of timelapse. The underneath code creates a folium map displaying all routes over the last few months. I want however some sort of…
Herwini
  • 371
  • 1
  • 19
0
votes
1 answer

Removing self-intersection from invalid polygon using python?

I need to union polygons of the shapefile using python. https://i.stack.imgur.com/qY6gD.png There are some self-intersection inside polygon and my python code always results in error. import geopandas as gpd from shapely.geometry import Polygon from…
0
votes
2 answers

Attaching parameters to geojson object becomes non-existant when creating a geopandas dataframe

I have this dataframe d = { 'geoid': ['13085970205'], 'FIPS': ['13085'], 'Year': [2024], 'parameters': [{"Year": 2024, "hpi_prediction": 304.32205}], 'geometry':[ { "coordinates": [[[[-84.126456, 34.389734],…
Wolfy
  • 548
  • 2
  • 9
  • 29
0
votes
0 answers

Updating a DataFrame cell at a row other than the index using the `.at` method

I'm working on some real world geometric data using GeoPandas, which relies on Pandas. I don't really care about the index in my GeoDataFrame (it has been assigned automatically) but when it comes to updating a single cell based on a condition in…
swiss_knight
  • 5,787
  • 8
  • 50
  • 92
0
votes
1 answer

How To Install a Python Package for IronPython in Unity

I want to be able to use the geopy and geopandas libraries in Unity. I have installed IronPython 3, but I cannot figure out how to arrange the geopy or geopandas files so they can be imported by an IronPython script in Unity. I've tried putting…
generic
  • 302
  • 1
  • 3
  • 14
0
votes
1 answer

GeoPandas DataFrame how to explode data by rows with geometry

!unzip https://www2.census.gov/geo/tiger/GENZ2018/shp/cb_2018_us_ua10_500k.zip I'm using the above dataset to explode rows in geopandas dataframe # Read shapefile test = gpd.read_file("cb_2018_us_ua10_500k") # Split Name10 column to extract city &…
Ailurophile
  • 2,552
  • 7
  • 21
  • 46
0
votes
0 answers

Is there a way to patch/mock geopandas.read_file() to test a function?

I developed a function that returns the US state in which a point is, based on latitude and longitude. get_state.py: import geopandas as gpd def geopandas_read_file(filename): return gpd.read_file(filename) def get_region_info(lat, lon): #…
Sink slb
  • 13
  • 3
0
votes
0 answers

Efficiently removing the outermost boundary from the boundaries of a geopandas GeoDataFrame collection

I have a collection of geographies in a GeoPandas GeoDataFrame. I want to construct LineStrings comprising only the boundaries between those geographies, and none of the boundaries in the overall outer boundary of the collection. By way of visual…
R Hill
  • 1,744
  • 1
  • 22
  • 35
0
votes
0 answers

Splitting polygons by overlapping with geopandas in Python (Multipolygons)

enter image description here I have multipolygons as it can see in image and I would split all polygons (poly_in_1, ..., poly_in_2) that are into Polygon and there are some of polygons outside so the result should be like see in right part of…
user20567574
1 2 3
99
100