Questions tagged [geopandas]

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

Filter by
Sorted by
Tagged with
-3
votes
0answers
21 views

Projection not working [closed]

I currently have a shapefile projected to EPSG 4326. But, for some reason the bounds are somewhere in the millions and are outside the (-180, -90, 180, 90) constraint. I'm working on Pandas as will if ...
4
votes
1answer
62 views

Python: shapefile.Reader, how to set up .iloc?

I would like to set up range of reading by shapefile.Reader. I couldn't find any suitable documentation. I would like to read rows 0-100. In Pandas or GeoPandas I use df.iloc[0:100], but what should I ...
1
vote
1answer
21 views

Cannot install GeoPandas on cloned arcgispro env in Anaconda

I have cloned my ArcGIS Pro env into my Anaconda 3 env. My goal was to have access to both the arcpy mod and GeoPandas mod. I tested it in a notebook to make sure arcpy is working and it is. But ...
2
votes
2answers
58 views

Projected coordinate system buffer producing incorrect buffers using GeoPandas

I am still new to GeoPandas. The issue I'm running into this time is although I have projected my gdf, the buffers created still are much too large. I've run this with a number of different ...
0
votes
1answer
28 views

Plotting a time series of positions on a map

Is there a good way of displaying a series of timestamps on a map, in a way that highlights the temporal aspect, as the points are in order of appearance? Basically I am trying to track an object ...
3
votes
1answer
36 views

Define coordinate system for every geodataframe (shapefile) in a list

I am looking to set a coordinate system for every geodataframe in a list of them. So I need this: gdfs[0].crs = "EPSG:6668" gdfs[1].crs = "EPSG:6668" And so on but ...
1
vote
0answers
35 views

Divide each road to 30m long and assign unique id to all points in the segments

I have a big csv that contains this information of trip data for each point in 1s interval: lon, lat, timestamp and street_id. My aim is to segment street to 30m long segments and assign a unique ...
1
vote
1answer
38 views

Cannot get geometry column name from geopandas

I tried calling gdf.geometry.name and I always get back "geometry" as the geometry column name. Using GDAL's ogrinfo, I get the actual name which is "geom". Is there another way of ...
0
votes
0answers
11 views

Get coordinates from rectangle drawn on the map [closed]

Using ipyleaflet how can I get coordinates on rectangle drawn on a map and load them in to geopandas data frame?
0
votes
0answers
19 views

How to road-snap / map-match roaddata to unionize two roaddatasets in Python [closed]

So, I'm working with two roadnetwork data sources: OSM and EStrada (in geojson format). They both contain roads the other dataset does not contain, and they both contain certain roads, but with ...
1
vote
1answer
18 views

Spatial Overlapping - Filter by % of Coverage

I am working with 2 Polygon Shapefiles: parcels & wetlands Essentially what I want to accomplish is to filter the parcels dataset, where I only keep parcels that contain less than 50% Wetlands. ...
3
votes
0answers
43 views

How to check which geometries in a GeoDataFrame are within the bounds/limits of the projection/coordinate system?

Is there a pre-built function that I can use to identify which of the geometries in a GeoDataFrame fall within the bounds of a CRS? I'm asking because, currently, GeoPandas allows me to create points ...
0
votes
0answers
16 views

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 ...
2
votes
0answers
43 views

Reading files with Japanese filenames with GeoPandas

I'm trying to read all shapefiles in a folder using this script: import glob import geopandas as gpd infolder = r'E:/folder/test_input' shapefiles = glob.iglob(infolder+'/*.shp') gdfs = [gpd....
3
votes
1answer
32 views

Save geodataframes from list to separate shapefiles

I have a list of geodataframes which I imported from a folder full of shapefiles: import glob import geopandas as gpd shapefiles = glob.iglob('E:/folder/shapefiles/*.shp') gdfs = [gpd.read_file(file) ...
1
vote
2answers
40 views

How do I iterate a clipping process through a list of geodataframes?

I have a folder full of shapefiles, I would like to read them into geopandas and then clip them all to one boundary iteratively. I have loaded all of the shapefiles into a list with this correctly ...
1
vote
0answers
24 views

Add a category variable that gives a unique id for each segment of 10m of each street

I have a big csv (12Go) that contains this informations of trip data for each point in 1s interval: lon, lat, timestamp and street_id. My aim is to segment street to 10m long segments and assign a ...
2
votes
1answer
50 views

Reading all shapefiles in a folder using geopandas and then clip them all iteratively

I have a folder full of shapefiles, I would like to read them into geopandas and then clip them all to one bounding box iteratively, however I'm stuck on the first part which is reading each shapefile ...
2
votes
0answers
36 views

Very slow segmentation using Python

I used both Python and QGIS to perform polygonization of a raster but the waiting times with Python are very long, while with QGIS the operation is done in a few seconds. Could you tell me the reason ...
2
votes
1answer
39 views

Using geometry points to get data in order to plot heatmap?

Excuse me if the title is confusing, English is not my main language, I'll try to explain myself as best as possible, also, I'm not great graphing, I'm learning. My code plots points on a shapefile ...
0
votes
0answers
52 views

ImportError: DLL load failed: The specified module could not be found. while importing GeoPandas

How can I fix the error and get GeoPandas to work on my Win10 machine? Solutions tried: New environment following instructions here Uninstalling and reinstalling Geopandas Detailed error: import ...
0
votes
0answers
40 views

Merging neighbor polygons up to a specific area size in Python

I am looking into a way to merge neighboring polygons in Python into 10 groups so that each group has a specific area size. At the beginning I have 389 micro-zones stored in outmulti which I want to ...
2
votes
1answer
43 views

How to write a list of Polygons to a .shp file in Python

I create a list of Polygons and MultiPolygons outmulti as follows: for pol in polygonToMulti: for pol2 in tre: if pol.intersects(pol2)==True: counter = counter+1 # ...
1
vote
1answer
25 views

GeoPandas clip returns empty

I'm trying to clip a set of polylines to a polygon with geopandas but it's returning an empty set. Here's my code: >>> import geopandas as gpd >>> import matplotlib.pyplot as plt &...
0
votes
0answers
39 views

Creating mask of geospatial data with maximum side-length(triangulation)

Earlier I asked a question, about Python GeoPandas crops result or sets boundary to data And I still cant understand how to work with geospatial data. I generate coordinates and create a plot with ...
1
vote
1answer
40 views

Array memory error when reading rasters

I'm attempting to make a spatio-temporal statistics analysis on a few chunks of data using rasterstats, rasterio and pandas/geopandas on Python. # create dataframes for areas of interest and specify ...
2
votes
1answer
41 views

Keeping geometry column from both dataframes when applying sjoin() using GeoPandas

I am trying to use sjoin() to spatially join two geo dataframs and then use both geometries for later spatial calculation, however, I noticed that from the official docs, only one geometry column from ...
0
votes
1answer
28 views

GDAL Fails Importation of GeoPandas to QGIS

I am trying to install GeoPandas on QGIS. I have first checked these pages : https://www.youtube.com/watch?v=Bm3qyh1fO-M https://anitagraser.com/2019/02/02/movement-data-in-gis-20-trajectools-v1-...
1
vote
1answer
86 views

Python GeoPandas crops result or sets boundary to data

When I create GeoDataFrame from source data and then show it by pyplot all good, because I didn't do anything with the data. It looks like this: If I plot it with tricontourf, it looks like (errors ...
-2
votes
0answers
28 views

Trimming a polygon to reduce overlap with adjacent polygons [duplicate]

I am attempting to count how many dissemination areas are in a group of school catchment areas. I am using two shapefiles from different sources and use GeoPandas' overlay function to generate a ...
2
votes
1answer
45 views

Trimming polygons using GeoPandas?

I am attempting to count how many dissemination areas are in a group of school catchment areas. I am using two shapefiles from different sources and use GeoPandas' overlay function to generate a ...
0
votes
0answers
21 views

Getting all edges from a graph in a radius with osmnx

I want to get all edges for a given radius(distance) from a graph or geopackage in osmnx (without using osmnx.geometries.geometries_from_point). Is there a way to do that? The reason I want this is ...
-1
votes
1answer
18 views

Shared border between polygons with Geopandas

How could I measure the shared border of a polygon with other polygons in Geopandas? The result could be an n x n matrix of polygons with the longitude of the segment of border they share.
2
votes
2answers
41 views

How to know if a point is on linestring or near one (<0.01units) using GeoPandas

I want to know if a point intersects/touches/on the line/linestring or if the point is less than 0.01 mts (units) from linestring. import geopandas as gpd import matplotlib.pyplot as plt lines_gdf = ...
0
votes
0answers
103 views

Spatial kernel density in Python

I have the data of the volume per area for Madrid. from mpl_toolkits.axes_grid1 import make_axes_locatable def setColorbar(ax, colormap, vmin, vmax): divider = make_axes_locatable(ax) cax = ...
3
votes
0answers
45 views

Plugin development for QGIS 3.16 (Windows): how to handle dependencies on external packages?

I've been working on a plugin for use with QGIS 3.16. I have developed it locally and I want to now deploy it so others can use it. The problem or rather question I'm having is: How do I deal with ...
2
votes
2answers
38 views

Finding number of overlapping polygons in two geodataframes using Python

I have two shapefiles: catchments: polygons for 18 catchment areas (tend to be 'regional') DA: polygons for ~2300 Dissemination Areas from Statistics Canada (tend to be 'neighborhood sized') I want ...
2
votes
0answers
38 views

GeoPandas: how to merge together adjacent polygons?

I have a GeoPandas dataframe like the following one f,ax=plt.subplots() gdf.boundary.plot(ax=ax) I would like to merge/dissolve the adjacent polygons. gdf2 = gpd.geoseries.GeoSeries([geom for geom in ...
2
votes
0answers
33 views

Inserting geography data types with GeoPandas

I would like to insert a geodataframe containing point geometries in SRID 4326 to an existing table in PostGIS+PostgreSQL. The issue is that I would like to retain the existing table structure, which ...
1
vote
0answers
78 views

PySAL, ValueError: cannot assign slice from input of different size

I want to calculate local moran's I statistics using pysal with Queen contiguity but I'm getting error. import geopandas as gpd from pysal.explore import esda from pysal.lib import ...
2
votes
1answer
58 views

Buffering one side of line using GeoPandas

I have these transects I've buffered as training data, but now we had "edges" defined where we need a simple buffer on ONE side of the line. I run my scripts within Jupyter Notebooks, so it ...
2
votes
1answer
27 views

Trying to extract xyz from multipolygon shapefile

I want to extract the x, y and z from shapefile polygon vertices where the geometry is multipolygon. Once extracted would like to have them in a geopandas data frame. I have seen a couple of ...
1
vote
1answer
62 views

I need to calculate shortest distance from an inputted point to the nearest lines. Nearest 4 lines

I have a huge dataset of points and roads. The point file is of Residential houses or Comercial shops/ markets. And the Line network is the roads around them. Ideally, I want to take 1 point (input) ...
1
vote
1answer
36 views

Dissolve polygons in Single-parts and calculating statistics for those single-part polygons only

I have a polygon shapefile. Which have some numeric attributes (A, B). I clustered the shapefile in five groups (labels) based on an attribute(A) and want to dissolve them while aggregating other ...
0
votes
0answers
30 views

Not able to find out if polygons in one shapefile intersect with polygons in other shapefile using GeoPandas [duplicate]

Santa Barbara contains some places from CA_Places. But when I use intersects, I get noting but all False. I have spent hours on this. Both shapefiles are here for reference. CA_Counties = geopandas....
0
votes
0answers
23 views

Warning while importing GeoPandas in Jupyter notebook

While importing geopandas in jupyter notebook, I'm getting following warning. import geopandas as gpd Warning: PROJ: proj_create_from_database: SQLite error on SELECT name, type, ...
0
votes
2answers
29 views

Combine multiple rows in a CSV using Pandas

I have over a hundred CSV files that I will join with selections of a shapefile to represent visually in QGIS. However, in these CSV files, the data is sometimes split into rows of 1A and 1B, or 13A ...
2
votes
2answers
40 views

Calculating the area of multiple polygons using GeoPandas

I am writing a Python script to calculate the area of polygons, as I have a small polygon, I am getting the area of polygon 0.000. A shapefile contains multiple shapefiles. I am thinking due to the ...
1
vote
3answers
88 views

Python Create Dictionary with Shapely Points from Linestring coordinates

I have a Geodataframe with Linestring Z geometries as follows: id_line geometry 1 LINESTRING Z (0 0 0, 5 6 9, 1 2 3, ...) 2 LINESTRING Z (7 8 9, 9 8 7, 1 2 5, ...) each of the Linestring is made ...
0
votes
1answer
31 views

Error saving geodaframe to shp: AttributeError: 'Series' object has no attribute 'to_file'

I have been struggling with a problem related to Getting AttributeError: 'DataFrame' object has no attribute 'to_file' from GeoPandas even though file converted into GeoDataframe ...

1
2 3 4 5
19