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
1 answer

How to get rid of white slivers between adjecent polygons when plotting a geopandas object?

I am plotting some raster data on a map using geopandas. Even though all polygons are exactly adjectent, when plotting it appears as if there is space in between them, so it looks like there is a white grid on the plot. I have tried casting to a…
0
votes
1 answer

GeoPandas: Apply function to row multiple time

I have a GeoDataFrame with the following columns. The column node_location is a dictionary of OSM node IDs with the corresponding coordinates. { "geometry": LineString(LINESTRING (8.6320625 49.3500941, 8.632062 49.3501782)), …
Kewitschka
  • 1,445
  • 1
  • 21
  • 35
0
votes
1 answer

Shapely Buffering, not working as expected

Why does buffering one of my geometries have an unexpected hole in it? from shapely import LineString from geopandas import GeoDataFrame l = LineString([ (250,447), (319,446), (325,387), (290,374), (259,378), (254,385), (240,409), …
A. West
  • 571
  • 5
  • 12
0
votes
0 answers

Why do my arrays display missing values when identifying a bandwidth? (geopandas)

I'm trying to identify a suitable bandwidth to use for a geographically weighted regression but every time I search for the bandwidth it displays that there are missing (NaN) values within the arrays of the dataset. Although, each row features all…
praadaaa
  • 1
  • 1
0
votes
1 answer

Map with sub regions in Python (Choropleth)

I am trying to plot a Choropleth map with subregions in Python for Armenia. Below you can see my data. import numpy as np import pandas as pd import geopandas as gpd import matplotlib.pyplot as plt data_arm = { 'subregion':…
silent_hunter
  • 2,224
  • 1
  • 12
  • 30
0
votes
1 answer

Geopandas to Basemap to see if on land or not

I've got a geopanda where I want to check if the points are on land or not. I tried using Globe land mask, but the resolution was quite poor as a lot of the points. As I understand it I need to transform my Long/Lat to YX coordinates in order to be…
ZedIsDead
  • 105
  • 9
0
votes
0 answers

Geopandas legend is not a continuous colour bar

I am plotting a geopandas choropleth plot, and the legend is not a continuous colour bar. Here is the code: fig, ax = plt.subplots(figsize = (10,10)) sm = gdf.plot(column = 'Average Crime',cmap = 'PuRd', ax = ax, legend = True, categorical =…
relayyyyy
  • 25
  • 4
0
votes
0 answers

Can't import h5py together with geopandas and rasterio

I am trying to extract data from .h5 files (SMAP L4 NEE) for buffer around study sites (points in a .geojson files) and save the data as .tiff files. I have h5py, geopandas, and rasterio installed in a conda environment "geo-env". Each package…
June Skeeter
  • 1,142
  • 2
  • 13
  • 27
0
votes
1 answer

Calculating overlap of polygons using Python, unsure of which package to use

I am relatively new to Python generally and GIS specifically and wondered if I could get some advice on the best package to use to calculate the overlap of two polygons I have calculated and stored in GeoJson format. Basically, I have two lists, one…
0
votes
0 answers

How to know if a smaller polygon is inside a bigger one using Geopandas?

Problem Hi, we are working on an ETL that cleans geodataframes according to it's geometries, we're trying to match some geometries inside others. For that we try to use some Geopandas shapely functions like overlaps, contains and covers, but the…
D4-Ramirez
  • 21
  • 3
0
votes
1 answer

GeoPandas: Changing the CRS in a GeoDataFrame created through iteration

I'm having a bit of trouble changing the CRS in a GeoDataFrame created by iterating over a larger dataset. The epsg is set to the correct value (5070, an Albers Equal Area projection using meters) but when plotting the data GeoPandas uses the wrong…
James
  • 1
0
votes
1 answer

How can I adjust the initial area displayed in choropleth map?

I plotted the following choropleth map using plotly. I want to show the Canadian provinces centered in the initial display. RIght know it's showing part of the USA and Canada. Thank you in advance for any help provided! import plotly.express as…
Alejandro L
  • 147
  • 1
  • 9
0
votes
1 answer

Plot milepost along coastline in python

I want to plot mileposts on a map every 100 miles along the coastline. An example is shown in the figure below: It is easy to plot the coastlines using Cartopy, but how to determine the locations of these mileposts and show them on a map? It would…
Feng Hu
  • 63
  • 6
0
votes
0 answers

Matplotlib -- how to retreive polygons colors from choropleth map

I made the choropleth map using GeoPandas and Matplotlib. I want to add value labels to each polygon of the map in a way that font label color must be a contrast to polygon fill color (white on a darker color and black on a lighter). Thus, I need to…
codkelden
  • 332
  • 6
  • 9
0
votes
1 answer

ShapelyDeprecationWarning: The array interface is deprecated and will no longer work in Shapely 2.0

I have the following dataframe: ID_from ID_to geometry_to geometry_from 0 DE111 DE111 POINT (4260741.157 2851183.129) POINT (4260741.157 2851183.129) 1 DE111 DE112 POINT (4243568.080 2841580.049) POINT…
Andrei
  • 69
  • 6