Questions tagged [geopandas]

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

242 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
28 views

Error d'initialization pyproj

I have an Access database(.mdb) and I want to create a shape points from this database by using a library of GeoPandas. My script is working properly, but recently I encountered this problem after re-...
0
votes
0answers
20 views

Reading text-anchor and text-angle from DXF using geopandas -> fiona -> gdal

I am working on a Pyhton desktop app that publishes CAD-files (dxf) to Postgresql/ GeoServer. It uses geopandas to import the dxf-file. The resulting geodataframe doesn't contain the anchorpoint and ...
0
votes
0answers
48 views

Read / write MapInfo Tab and convert it to CSV format

I am very new in python and trying to read MapInfo (.TAB) file and convert it in to CSV format in following way: import geopandas as gpd input_file = 'F:/.../QGIS/sites.tab' test = gpd.read_file(...
0
votes
0answers
40 views

Field length in geopandas shapefile output

I am converting an excel sheet to .shp via pandas i.e. I have a dataframe with 150+ columns and ~900 records (increasing by about 50 every day), that I convert to geodataframe and export to shp: ...
0
votes
0answers
33 views

Creating plots for each hour of each day with Python

I am trying to create an animated map (by generating multiple plots) of road traffic throughout a week, where the thickness of roads is represented by the volume of traffic at a specific time of day. ...
0
votes
0answers
20 views

Getting a rotated shape when I change projection using GeoPandas

I have a GeoPandas dataframe that I can properly plot f,ax=plt.subplots() myGdf.boundary.plot(ax=ax) If I change projection I get, a rotated geometry of 90 degree. myGdf1 = myGdf.to_crs({'init': '...
0
votes
0answers
18 views

FutureWarning: Sorting because non-concatenation axis is not aligned. Converting a Google Earth Engine Dataset into a Pandas/Geopandas Dataframe

I am trying to get a pandas or geopandas dataframe returned from a Google Earth Engine FeatureCollection for specific point data. Basically like a spatial intersect where all values from the feature ...
0
votes
0answers
58 views

Installing GeoPandas on Apple M1?

I have the new Macbook Pro M1 with BigSur. I have installed miniforge via new Homebrew (compatible for M1 chips). Then I created a new conda environment and then installed few libraries, one of them ...
0
votes
1answer
56 views

OSMNX - City Suburbs Polygons

I'd like to extract, given a city name, all suburbs and relative polygon geometries. For instance: https://nominatim.articque.com/details.php?place_id=230259366 So, I run the code: place = 'Torino, ...
0
votes
0answers
21 views

geopandas.to_crs(epsg=3395) does not work in jupyter notebook. it seems some mismatch with pyproj & geopandas versions?

After importing geopandas df , with epsg =4326, I tried to re project it to epsg =3395 using gdf.to_crs(epsg =3395) in jupyter python note book. I got error "RuntimeError: b'no arguments in ...
0
votes
0answers
22 views

Converting polygon to numpy array for CNN using Python

I need to create the current data set for CNN. So I want to convert the number entering a section of a certain area into a numpy array. For example, at the point where the geohash code is precision 6, ...
0
votes
0answers
24 views

How to rotate a Contextily basemap in matplotlib and Jupyter notebook

I asked this question on Stack Overflow because I thought the Jupyter Notebook and matplotlib aspects were better suited for that forum, but I didn't have any luck; it is also a geopandas and ...
0
votes
1answer
25 views

How to specify from which file duplicates should be deleted after appending two datasets

I am using python script and ArcGIS Desktop 10.8.1 to synchronize two datasets. There are many (thousands) of duplicate features that I would like to drop in an output. How can I specify that, in the ...
0
votes
1answer
47 views

GeoPandas/Geoplot losing first row when reprojecting

I'm trying to work with the London Borough borders file (https://data.london.gov.uk/dataset/statistical-gis-boundary-files-london) in geopandas/geoplot. It comes in National Grid Easting/Northing ...
0
votes
0answers
194 views

Extract one geometry type from GML file in GeoPandas

I try to use GML data from Landesvermessung Brandenburg in GeoPandas. It generally works to load files like this: df = gpd.read_file(r'/vsizip//vsicurl/https://data.geobasis-bb.de/geobasis/daten/...
0
votes
1answer
211 views

Removing duplicate points in GeoPandas using distance and time

I have a list of of coordinates that have areas mapped out on a map user_id id latitude longitude requested_at 84 106 13.0472367 77.5022635 12-10-2020 14:59 84 107 13.0472789 77.5024498 ...
0
votes
0answers
124 views

Fixing a corrupted geometry column with Python GeoPandas

I had a shapefile which I converted to a geodataframe, and created a geometry column. I did some manipulation with it in pandas. I am now trying to convert it back into a geodataframe and eventually a ...
0
votes
0answers
51 views

How to delete nodes that are unnecessary

I got a OSMNX graph, and put edges and nodes in two separated GeoDataFrames. Now I want to delete the nodes that dont intersect with the edges, or nodes that are not very, very close to the edges. I ...
0
votes
0answers
35 views

GeoPandas plot range problem

I read a .csv file with geometry like this: trajs = pd.read_csv("trajs.csv") trajs["geom"] = trajs["geom"].apply(wkt.loads) trajs = gpd.GeoDataFrame(trajs, geometry="...
0
votes
0answers
68 views

Plotting two shapefiles in same plot. Legend of 1st shapefile hidden by second shapefile. Python GeoPandas

With ax = gdf.plot(cmap="jet", column=ColumnaAVisualizar, categorical=True,figsize=(12,12),legend=True) ax2=ZDE.boundary.plot(ls="--",color="k", label="Zona de ...
0
votes
0answers
21 views

Geopandas Overlay Union Issue

I was trying to develop an equivalency file between two sets of zone systems (polygons). My script reads in two separate shapefiles, reprojects them to the same projection, calculates the total area ...
0
votes
0answers
74 views

GeoPandas and Cartopy how to dynamically zoom to Multiline

I am new to GeoPandas and Cartopy. I am trying to generate map plots for different regions dynamically. When generating the image from geopandas ('df.plot()') the size is correct, but when I generate ...
0
votes
1answer
81 views

GeoPandas setting geometry for a row with .loc and Multipolygons

Given the following example: def merge_with_largest(input_gdf,poly): # select the polygons bordering polygon close_by_gdf = input_gdf[input_gdf.geometry.intersects(poly)] # selects ...
0
votes
0answers
50 views

Self union a geodataframe whilst retaining columns of overlapping features

I have a geodataframe with overlapping polygon features. I want to mutate this to create a non-overlapping polygon geodataframe. I know I can merge the geometries by using unary_union as shown here: ...
0
votes
1answer
137 views

Polygon Produced Using Geopandas Buffer Not Correct Size

I have created 2 plots as pictured: The blue (with red outline) polygon should be a 10KM circle around the central dark green point in both plots. This is correct for the right hand side plot (the ...
0
votes
0answers
101 views

AttributeError: 'NoneType' object has no attribute 'length' when running function for compactness

I want to calculate compactness indices for geometries I have in a geodataframe. I'm using the following function as was mentioned here (Measuring compactness in Python) by Kadir in order to ...
0
votes
0answers
19 views

Equal Distance projection in GeoPandas

Does GeoPandas offer some dedicated Equal Distance projection like it is available for example in FME during buffering (https://www.safe.com/transformers/geographic-bufferer/) or in ArcGIS when ...
0
votes
0answers
16 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 ...
0
votes
0answers
253 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 (...
0
votes
0answers
149 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/...
0
votes
0answers
29 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
0answers
73 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 ...
0
votes
0answers
276 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? ----------------------------------------------------...
0
votes
0answers
115 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 ...
0
votes
0answers
123 views

Plot a map with arrows for commuters

I'm trying to plot a map, where arrows indicate information. In my specific case I have several data from commuters, from town A to town B, from town C to town B and so on. I'm missong some keywords ...
0
votes
0answers
216 views

Shapely WKT dumps and loads does not always preserve rounding_precision

Shapely's WKT loads and dumps can be useful for rounding overprecise geometries, as pointed out here (Rounding all coordinates in shapely?) and here (Geopandas [Shapely] spatial difference: ...
0
votes
0answers
69 views

Distance computation for geospatial clustering of lat/lon points

I am working with a pretty large dataset (~500K data points) in Python (GeoPandas) and I would like to perform geospatial clustering on some subsets (~60K points) of the data. My question has to do ...
0
votes
1answer
420 views

How do I change the display size of a map from a shapefile with matplotlib?

I'm completely new to shapefiles. I was able to use GeoPandas to plot some data over a map of the US I got from census.gov. I'm having getting the map to be at a viewable size. I adjusted the figsize ...
0
votes
0answers
40 views

Find polygon geometry of a place

I am reading in a shapefile of Metro areas in the US and then select the metro area of interest. # Read shape file px_shp = 'data/map/az/cb_2018_us_cbsa_500k.shp' geodata = gpd.read_file(px_shp) ...
0
votes
0answers
85 views

Creating a Origin-Destination flow map with Non-Spatial dataset

I am working on a project where I am trying to learn some geopandas. The dataset that I am using is the LEHD Origin-Destination Employment Statistics that gives you a csv that has a work/home geoid ...
0
votes
0answers
47 views

Shapefile extremely slow to read in Jupyter Notebook

I have a shapefile of Phoenix, AZ of size 172mb which I am loading in to the Jupyter notebook. It's a extremely slow process to read the file in. I am running the notebook on locally and the files are ...
0
votes
1answer
441 views

Reprojecting unequal number of latitude and longitude: pyproj.exceptions.ProjError: x, y, z, and time must be same size

I have a rectangular matrix of geographic climate data with a 1d row of latitude coordinates (size=834) and a 1d column with longitude coordinates (size=1115). They are both in unit of m (EPSG:32630) ...
0
votes
0answers
54 views

Display raster with earthpy shows one color raster without values

I'm new to Earthpy, I am trying to display raster and on top of it I want to display polygon. The problem is that when I display the image it looks like blue rectangle and doesn't have different ...
0
votes
0answers
40 views

OSM or Google Tile problem fitting to Geopandas Dataframe

I found this good post on how to get basemap tiles from open sources like OSM, Google, Bing, ESRI using python in geographic lat/long. I'm now trying to add the tiles I successfully got into a ...
0
votes
1answer
38 views

Problem with intersection between two Geopandas Dataframes

I have 2 shape files one "country.shp" (containing the tiles geometry covering the whole country) & other "district.shp"(containing one particular district). Now I want to get the tiles ...
0
votes
0answers
67 views

Optimising Cross Join PostGIS Query

I have tried performing the query shown below via ogr2ogr and the gpd.GeoDataFrame.from_postgis() method in geopandas. from osgeo import ogr import psycopg2, os import geopandas as gpd import pandas ...
0
votes
0answers
42 views

When I get the total bounds of a shapefile, which are llcrnrlon, llcrnrlat, urcrnrlon, and urcrnrlat? Need it to use Maptlotlib Basemap

The goal is to use an ESRI webmap as a basemap beneath a shapefile for a script that visualizes earthquakes in the Philippines. But first, I'm practicing in using Basemap in a separate script. ...
0
votes
0answers
12 views

Fast way of selecting Points that are in a Shape

I am using GeoPandas to select the points that are part of a shape. The dataset is quite large, with 10's thousands of points and shapes. This is how I do it right now, and it takes me days to run for ...
0
votes
0answers
39 views

Plotting via GeoPandas but only one point shows. What's wrong with my code? Map and points are in same projection

I've been stuck at this for two weeks and have tried already solutions online. I am using Python 3.8. from shapely.geometry import Point import geopandas as gpd from geopandas import GeoDataFrame ...
0
votes
0answers
176 views

Try to merge multiple shapefiles and write as one new shapefile via Geopandas in Python

The goal is to use Geopandas in Python to merge all shapefiles into one new shapefile. I ran a test code before creating the loop to merge all shapefiles together, import geopandas as gpd import os ...