Questions tagged [geopandas]

an open source project to make working with geospatial data in Python easier.

Filter by
Sorted by
Tagged with
3
votes
1answer
71 views

Directional Buffer increasing radius of geometry

I have a bunch of polygons in the shape of a pie in a geopandas df under geometry as seen below and I am looking at increasing the radius from x to y of the polygons. Can this be done using geopandas ...
1
vote
0answers
38 views

Adding a table to a web map made in Folium [closed]

I have made a nice Folium map however, the amount of data is small, but increasing. Right now it is grabbing a wildfire perimeter GeoJSON from NIFC and then getting points from my organization and ...
0
votes
1answer
52 views

valuerror : Null Layer

I am trying to open a geodatabase file and getting error message ValuError : Null Layer. I am using geopandas.read_file. import geopandas as gpd gdp.read_file("AL_ALFL_conf_final.gdb") I ...
0
votes
1answer
85 views

Using GeoPandas generated .gpkg in ArcMap

I am using GeoPandas to create .gpkg files. Using GeoDataFrame.to_file() When opening the files in ArcMap, it takes a long time updating the file extent. Files already have an spatial index as this is ...
3
votes
1answer
84 views

Applying ArcPy SpatialJoin_analysis in GeoPandas [closed]

I'm trying to implement the same solution as ArcPy's SpatialJoin_analysis in GeoPandas. I have one shapefile which contains Polygons and Multipolygons. I need to perform below spatial operation of ...
0
votes
0answers
14 views

Geospatial way to optimise cluster entropy calculation per LSOA (Polygon)

I've been trying to create the entropy data below after doing a spatial join of the LSOA codes to the pandas dataframe (starting with GeoPandas). My silly "for loop" way is super slow for ...
7
votes
1answer
256 views

Find the intersecting points of 2 polygons in Python

I am trying to get the intersecting point coordinates of 2 polygons in Python. For example intersecting points of the two polygons (polys2). For illustration purpose, I have marked the intersecting ...
1
vote
1answer
309 views

Plotting shapely polygon with holes does not plot all holes

I'm trying to plot a filled shapely.geometry.Polygon polygon with holes in. I have tried 2 methods, both give the same result. Below is the code I have been using to debug from shapely.geometry import ...
0
votes
0answers
208 views

Error while installing GeoPandas libraries using prompt

I am getting this error when trying to install GeoPandas libraries..... Anyone with a solution? (base) C:\Windows\system32>conda install -c conda-forge geopandas Collecting package metadata (...
1
vote
0answers
36 views

Open only part of a GeoPackage layer with a certain geometry type in GeoPandas

I have a GeoPackage (743 MB, zipped) that has one layer, but two geometry types inside that layer (Point and Polygon). When I open the file in QGIS 3.10, QGIS presents a dialogue to me that lets me ...
1
vote
1answer
326 views

AttributeError: 'NoneType' object has no attribute 'is_empty' when trying to set new CRS

I have geodataframe that has two geometry fields. I'm trying to set new CRS but every time I get the next error message: AttributeError: 'NoneType' object has no attribute 'is_empty' when I am able ...
3
votes
1answer
120 views

Making multiple convex hulls in a GeoDataFrame based on a categorical attribute in GeoPandas

Suppose I have a GeoDataFrame as follows: | cat | geom ----+--------+------------- 0 | 0 | POINT(0, 0) 1 | 0 | POINT(0, 1) 2 | 0 | POINT(1, 1) 3 | 0 | POINT(1, 0) ...
2
votes
1answer
75 views

Buffering a polygon keeping the same angle/shape using GeoPandas

I have an 'area.shp' (a polygon) file that I would like to buffer with a distance of 1000m. The polygon needs to be read from a folder, and the output needs to be saved with a new name at the same ...
4
votes
1answer
365 views

Creating centroid inside of polygon [closed]

I want to get the centroids of my multipolygons using Python and GeoPandas. But when viewing the polygons and the centroids points on QGIS, the centroids are not inside the polygons. Here is the code ...
0
votes
1answer
104 views

Seeking open source alternative to File Geodatabase

I would like to use geopandas to work on a large dataset which is provided in Esri's file geodatabase format. I would like to be able to read and write this dataset, unfortunately there are still ...
1
vote
1answer
51 views

Get geopandas geo or affine transform

Does anyone know how to get the affine transformation from a geopandas dataframe? I need this for rasterising geospatial vector data with rasterio. shapes = ((geom,value) for geom, value in zip(...
4
votes
2answers
141 views

Applying geometric operation on multiple GeoDataFrames

I have a collection of geodataframes in my Python environment. How can I apply for each GeoDataFrame the same spatial operation using following manner and create a new variable with the reference that ...
3
votes
1answer
121 views

Generate points inside multipolygons using GeoPandas

I have a shapefile which has multipolygon geometries. I want to generate random points inside them using GeoPandas. I tried with the below code but it's not giving geodataframe of points. df = gpd....
1
vote
1answer
118 views

Spatial join with GeoPandas with two geometry columns

I have one GeoDataFrame which contains two geometry fields - one is polygon and one is the polygon centroids. The table has also other fields. I have run spatial join between the gdf and another ...
1
vote
1answer
64 views

Pandas dataframe to geodataframe

I have pandas dataframew ith two fields: ID and geometry (geometry is already in WKT). I want to change this dataframe into geodataframe so I can save it as shapefile. I have tried to change it into ...
1
vote
1answer
54 views

Spatial join list lat,lon and multipolygon Python

I have a dataframe with lat, lon columns in WGS84. I also have a multipolygon layer (GeoJSON, I can also convert it to a SHP) with all countries' boundaries, where the name of the country is in the ...
3
votes
1answer
153 views

How to densify LineString vertices in Shapely/GeoPandas

I'm looking for an equivalent of densify tool in ArcGIS, but with GeoPandas or Shapely. I have a line that would like to be densified with a specific distance; how to add vertices of a line using ...
0
votes
0answers
112 views

Extract longitude and latitude coordinates into separate columns with GeoPandas geometry

I am currently working on an Exploratory Data Analysis for the NYC taxi dataset. Since the new datasets had location ID's instead of long and lat coordinates. sf = gpd.read_file(r"shape/...
1
vote
1answer
64 views

Why are my circles plotted on maps, using buffer data from GeoPandas, not the same size as if I plot on Google Earth?

I am using GeoPandas and matplotlib to plot some circles of desired radius around a set of points. I find that the circles are not the right size on the maps, but the equivalent sized circles drawn on ...
3
votes
2answers
236 views

Unable to read in shapefile using GeoPandas

I am trying to read in a shapefile: sph = gpd.read_file("taxi_zones.shp", encoding="utf-8") but I am getting this error: 'taxi_zones.shp' not recognized as a supported file format....
5
votes
1answer
114 views

Adjusting edges around markers in legends in GeoPandas plot

I am trying to adjust the edges around the markers in my legend. Currently my code looks like this import matplotlib.pyplot as plt fig, ax = plt.subplots(figsize=(15,10)) lri_map.plot(column= '30', ...
1
vote
0answers
80 views

Shrink polygon on a particular side using Python [closed]

I have a polygon geometry (with vertices 1,2,3,4) as shown in the figure below. Now my requirement is that I want to get this polygon shrink/compress to a new polygon (having vertices 1',2',3',4') as ...
1
vote
1answer
1k views

UserWarning when trying to get centroid from a polygon GeoPandas

I have this geopandas dataframe: df1 = gpd.GeoDataFrame(df,crs=rasterio.crs.CRS.from_string("epsg:4326"), geometry=df['geojson'].apply(json_load)) df1 = df1.set_crs(epsg=4326) print (df1....
1
vote
0answers
44 views

Packaging geospatial libraries for cross-platform application, or using docker container?

I am developing some python tools to help some less technical users process geospatial imagery. They generally need to do simple stuff like compress images, reproject images, etc. The users will be on ...
1
vote
0answers
39 views

How to deal with flawed line geometries in Geopandas?

I have a big dataset containing line-geometries. I would like to delete overlapping lines using the intersection statement in geopandas overlay in the following manner: import geopandas as gpd from ...
0
votes
0answers
26 views

Saving a file consisting of two layers

I have a geopandas dataframes (A) and (B). I wanted to save them into disk using a same file but with two different layers. I knew to save one dataframe as follows: A.to_file('out.kml', layer='A', ...
0
votes
2answers
118 views

Re-projection from BNG to WSG84 consistently fails using geopandas' .to_crs

I am trying to use a shapefile of Great Britain to display some heatmap results on top of it. My data is in EPSG 4326 (longitude, latitude), but the shapefile is in EPSG 27700. I tried re-projecting ...
1
vote
1answer
40 views

Change of Internal polygon area after intersecting polygon

I am checking the polygon change after the intersection(Using geopandas, gpd.overlay). In the meantime, it was found that the area of the polygon inside the boundary was changed. In my opinion, this ...
4
votes
1answer
52 views

Remove polygons within other polygons in a dataframe

Given a dataframe, is it possible to find polygons that lie within another polygon in the same dataframe and remove them based on a condition? For example, consider the following dataframe ...
1
vote
1answer
100 views

Create polygon after excluding extents from raster data having no-data values

I want to get extent of raster dataset after excluding the extents containing no-data values in the raster data which I then want to export as a shapefile. Till now I have used the following code: ...
0
votes
0answers
50 views

What is the most stable implementation of GeoPandas for sjoin and Overlay?

I am working with GeoPandas in VS Code on a Windows 10 machine in Python 3.7-32 bit and GeoPandas 0.8.1. For the script I am working on I also need to get data from a SQL server, and need functions ...
2
votes
1answer
149 views

Overlapping legend: How to put geopandas legend next to the map?

I am using geopandas and contextily to plot building data (polygon) from OpenStreetMap. The problem is, the legend is overlapping the map. Is there any way to put the legend next to the map? or plot ...
0
votes
0answers
216 views

ImportError in GeoPandas

I get the following error when importing GeoPandas. I using pip and anaconda to install GeoPandas, but I still get the same error. What I should do? ----------------------------------------------------...
2
votes
1answer
154 views

Spatial join and sum aggregation of two polygon GeoDataFrames in GeoPandas

I would like to join two GeoDataFrames with polygon geometries (purple and green, see screenshot below). However, I would like to get the sum of all intersecting green areas per purple feature they ...
1
vote
0answers
36 views

Aggregating data and displaying counts with GeoPandas

I have two datasets that I want to use. The first is a shapefile of King County that has polygons broken up by school districts. It has boundaries saved as polygon features on a geo-dataframe. The ...
2
votes
1answer
178 views

GeoPandas sjoin speedup

I am using GeoPandas's sjoin function to join 2 dataframes: dataframeA has latitude and longitude information whereas dataframeB has polygon information. Number of rows in dataframeA may vary (~70M) ...
0
votes
1answer
94 views

Extracting lat lon of points from list of postal codes

I have scraped a list of postal codes for which I want to extract (lat, lon) data. extracted postal codes In Postal Codes Germany, I was able to extract lat lon for the postal code by is there a way ...
1
vote
0answers
32 views

Testing for spatial autocorrelation in residuals of OLS regression

I'm currently working on a dataset that is most likely to have spatial autocorrelation issues. In particular, I have observations at the region level and I'm trying to run a regression to check ...
0
votes
0answers
89 views

Issue while plotting Raster and Shapefile on tkinter canvas

I am trying to plot shapefile (EPSG:4326) and raster data (EPSG:32645) on tkinter canvas using rasterio and geopandas. I am using the following code to plot the same: from tkinter import * import ...
2
votes
0answers
131 views

Unable to install geopandas using conda install

I'm trying to install GeoPandas using the Command Prompt terminal. I have Python 3 and ArcGIS installed. I keep getting these messages that say there is a conflict with various packages. For example: ...
0
votes
1answer
159 views

Apply same coordinate system to raster image and GeoJSON with rasterio

I have a dataset containing raster images and corresponding features in geojson files. I would like to use rasterio.features.rasterize to create a footprint image of the features on the raster image, ...
0
votes
1answer
178 views

How to extract a specific country boundary data from a GeoPandas dataset

I want to extract Singapore country boundaries from 'naturalearth_lowres' dataset from GeoPandas. world_filepath = gpd.datasets.get_path('naturalearth_lowres') world = gpd.read_file(world_filepath) ...
2
votes
1answer
216 views

How to vectorize creating a Shapely Polygon in Pandas

I have a GeoPandas DataFrame with a polygon in each row. I want to add a column with coordinates of a bounding box of each polygon. I can do it this way: def create_bbox(row): xmin, ymin, xmax, ...
1
vote
2answers
149 views

ogr2ogr large gdb file to SQLite warning: “organizePolygons() received a polygon with more than 100 parts”

I'm trying to write a .gdb file (could also be any other format, geojson, gpkg, etc.) to a Spatialite DB but it takes awhile and I am getting a warning. Command: ogr2ogr --config OGR_SQLITE_CACHE 1024 ...
3
votes
1answer
118 views

Find the nearest point on polygon (coastline)

In python I have a shapely polygon (which defines the coastline of the UK), given a point within the UK I would like to find the closest point on the polygon (coastline) to that point. I have been ...

1 2
3
4 5
17