Questions tagged [geopandas]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

Error while installing GeoPandas using pipenv “proj executable not found”

I tried to install GeoPandas using the following command: pipenv install geopandas But I had an error: Installing geopandas… Error: An error occurred while installing geopandas! Error text: ...
2
votes
0answers
14 views

Relating gridded data to polygons [closed]

I'm preparing weather forcing input data (dimensions of time/lat/long/variable) for a machine learning model to predict streamflow. I need area-weighted weather inputs (the weather data are on a grid) ...
0
votes
1answer
28 views

Reading GDB file with GeoPandas throws MemoryError

I have a gdb file that's 32GB and I'm tasked with extracting the attribute values from each of the layers and converting them to CSV for analysis. Here's my code: import geopandas as gpd import fiona ...
0
votes
2answers
48 views

Polygon geometry verify using Python

I wonder if it is possible to check the geometry of multiple polygons using Fiona or shapely library In Python. Whichever polygon does have proper geometry will be kept and the rest will be deleted ...
2
votes
0answers
12 views

Creating world grid with fix number of row and columns without overlap using shapely and geopandas

I'm trying to build a grid over the world and cut it on an AOI. The initial grid have non trivial properties. It is a grid of squares in EPSG:4326. The dimension is not round, they simply cut the ...
2
votes
1answer
25 views

Matching points to polygons and handling points NOT in polygons

I have two GeoDataFrames: one with 191k address points and another with 18 polygons representing catchment areas for specific schools. Theoretically, every address should fall into one of the zones. ...
0
votes
0answers
32 views

GeoPandas legend not displaying correctly the colors

I need a legend where for every bin that I defined there is a color from a colorscale. I wrote this: ax= merge.plot(column=dates, figsize=[15,15], cmap='OrRd', ...
0
votes
0answers
20 views

Clustering adjacent polygons with values over a given threshold with Python

I have a GeoPandas dataframe that looks like the following geometry raster_val 0 POLYGON ((1.85626 49.12003, 1.85626 49.11171, ... 28.530001 1 ...
1
vote
1answer
29 views

Parallel offset on Folium

Is there any way to add parallel offset for those lines which oneway road are False? All line here are straight (segment). So We just have two points for each line (start and end points). # There is ...
0
votes
0answers
32 views

Iterating over dataframe and checking points using shapely

I am getting the error when I try to delete row from dataframe. The code checks if polygon contains points. If not I would like to delete this row, but I am getting the error. Why? Error: IndexError: ...
0
votes
1answer
42 views

How to write merged geodataframe to shapefile

Tried the following code. I am able to see the merged data in the console but I don't get any output file. Running my code does not raise any errors either. import geopandas import pathlib import ...
0
votes
1answer
45 views

Counting points and adding to column with shapely

I have a small dataframe and created new column. I would like to add to every record in column 'vertex_counter' value of n. I have the problem because it is doesn't work and I have in every record in ...
1
vote
1answer
31 views

Crop a raster image with the coordinates in a CSV file in Python

I am trying to crop a satellite image with geographical coordinate from a CVS file. I have never cropped an image using coordinates from CSV file. I tried searching a lot but I can only find cropping ...
3
votes
1answer
34 views

Converting a string to LineString

I have a string read from a csv file: 'LINESTRING (-79.494722 43.777724, -79.494805 43.777636, -79.49503799999999 43.777581, -79.495277 43.777524)' I want to convert this string object to shapely....
1
vote
0answers
21 views

Adding custom names to a GeoPandas legend

I have a shapefile which has an attribute table with a column I would like to make a map/plot of. The attribute values are numerical (integer). I have made two dicts to map the colors and names I want ...
1
vote
1answer
30 views

Creating a grid from pixels of a georaster in Python with GeoPandas

Let say we have a georaster file with a given resolution. Is is possible to create a grid where each cell of the grid correspond to each pixel? Is it possible to store this grid as a GeoPandas ...
1
vote
2answers
38 views

GeoPandas dissolve using an attribute filter

I am wondering if it is possible in one pass to use GeoPandas' dissolve to merge together only the records matching a query. Specifically, I have many small areas that should be merged to the larger ...
0
votes
0answers
32 views

Using GeoPandas to generate shapefile from GeoJSON that could be open for ArcGIS

I got from an API a layer of parcels in format GeoJSON, just like the file in this .zip https://www.dropbox.com/s/5eqi8bbqt6ej6lc/json_data.rar?dl=0 I need to convert this to a shapefile that could ...
1
vote
0answers
16 views

Spatial join two identical layers

I'm working with Python and GeoPandas. I have two parcel layers that are identical and in the same coordinate reference system. The parcel number field is not unique so I am unable to join on that ...
0
votes
0answers
13 views

Problem with Python code to visualize a map in the geospatial analysis

You can download relevant files to execute my python code as below: https://drive.google.com/drive/folders/1WmkZ9t3RnAsd4Dy83TRdjWIsAdby4IwI I want to visualize data at the postal code level with ...
0
votes
0answers
25 views

Choosing coordinate reference systems for esriGeometryPolygon in GeoPandas

I extracted a layer of parcel Geometry Type: esriGeometryPolygon and save as JSON, this is a fragment of one row of this JSON: { "attributes": { "OBJECTID": 171195, &...
1
vote
0answers
18 views

Opening gkpg in geopandas throws: UnsupportedGeometryTypeError: 12

I wanted to open a gkpg file in geopandas 0.8.2, on windows, using conda mith channel conda-forge obj = r'path.gpkg' layer="layername" gdf = gpd.read_file(obj, layer=layer) Throws the ...
1
vote
2answers
33 views

Exchange of coordinates in GeoPandas

I was plotting some points with the plot function in GeoPandas. I realized that when I plotted using Point.lat, Point.long, the points didn't fall at the right place but when I exchanged the ...
0
votes
0answers
19 views

Adjusting pixel values of a raster based on geopandas colums or fields

I have a geodataframe with geometry column containing Polygons and 5 fields or columns('Crop1', 'Crop2', 'Crop3', 'Crop4' and 'Crop5') as well as a raster image. There are 159 rows in the geodataframe ...
0
votes
0answers
29 views

How to fetch lightning data with Python Pandas?

My code which I have effectively takes in as input the lightning data (in its case- http://wwlln.net/ but in my case, it's GHRC data), the global shapefiles, and population density data. How would I ...
1
vote
0answers
50 views

Detect one-way road from origin_id and destination_id

How do I detect the one-way roads? I have a graph G( MultiDiGraph(G) with origin(Id) and destination(Id) nodes. I would like to detect one-way roads. Example if there is an edge from the origin "...
0
votes
0answers
23 views

geopandas: clip() not working as expected

I have two dataframes--one with a polygon (POLYGON Z in region column), and one with one linestring (LINESTRING Z in path column) per row. I was expecting that the following code calling .clip() ...
1
vote
0answers
44 views

Count overlapping features using Geopandas

Is there a way to easily count overlapping polygons using Geopandas, the same way as the ArcGIS Pro Count Overlapping Features works? So far my approach was to do union overlay and then dissolve 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-...
2
votes
1answer
38 views

Adding columns to GeoDataFrame

I would like to add columns xmin, xmax, ymin, ymax and I take coordinates from column 'geometry'. I have exemplary dataframe with 1 records. Where is the problem? Data: FID_1 GODLO ...
1
vote
1answer
18 views

Python: Cannot construct empty GeoDataFrame with columns

My script import geopandas as gp test = gp.GeoDataFrame(columns=['geometry', 'costs']) the error: File "/usr/local/lib/python3.7/dist-packages/geopandas/geodataframe.py", line 89, ...
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 ...
1
vote
1answer
22 views

How to ensure the values set in the CSV are captured within the GeoJSON feature values when merging CSV attributes into a GeoJSON

I create a GeoJSON but the merged values are null. The length of the datasets do not match -- is this a potential issue? If so, how do I merge for all covid matches. (FYI this isnt Covid19 related COV ...
1
vote
1answer
39 views

Set geometry in geodataframe to another column fails : TypeError: Input must be valid geometry objects:

I have CSV file which I read with geopandas. I use "read_file",define the crs , but seems like it doesn't know to choose the correct geometry column. I have tried to use "set_geometry&...
0
votes
0answers
49 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(...
2
votes
0answers
26 views

GeoPandas: Calculate coordinates of a point within a linestring [closed]

I have two datasets, one is a GeoJSON of a highway with around 1509 linestrings. The other is a list of incidents that have occurred along said highway, but, instead of coordinates, the file specifies ...
1
vote
0answers
41 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
11 views

CSV with geometry column in JSON format to GeoDataFrame [duplicate]

I have a csv, that I want to open as a GPD, the problem is the geometry column "geo_shape" I want to convert that column to the proper geometry format, could you help me? The link to the ...
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
1answer
28 views

How to plot coordinate system from EPSG 4326 on north pole centered map in Python?

I have the following pandas dataframe (df) which looks like this with column headers and data values, 3 points each: temperature: array([-101.6015625, -100.9296875, -85.4296875]) latitude: array([32....
1
vote
2answers
19 views

Geopandas and Matplotlib Plotting error

I am trying to plot a point on top of a shapefile. the Coordinates of the point are accurate. I verified it using the go to XY tool of ArcMap. but when I try to plot overlay using Python the location ...
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': '...
1
vote
0answers
19 views

Return Geometry in a Pandas Dataframe Google Earth Engine

I have found some sample code that returns features from a GEE image to a pandas dataframe based on specific points in my feature collection. The challenge is I need the geometry on these points to be ...
0
votes
0answers
19 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
26 views

Angle in minimum_rotated_rectangle [duplicate]

I have a simple question, but I can't find the answer I am looking for the principal angle of a minimum_rotated_rectangle polygon in relation to a latitude or a longitude. df4....
1
vote
0answers
42 views

How to download buildings data from OSM with a polygon (shapefile) as the bounding box?

I am struggling to complete this task. I am trying OSMnx which can be used to download data from OSM above however I am getting an error when using its from_polygon feature when trying to download ...
0
votes
0answers
62 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 ...
1
vote
2answers
44 views

Splitting line GeoDataFrame basing on given lengths

I am trying to split line GeoDataFrame into sections. I have lengths on which splits should be made stored in column. My idea was to generate points along the line using shapely.ops.interpolate and ...
0
votes
1answer
57 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, ...
2
votes
1answer
81 views

Showing two roads lane of one road

I am using osmnx package to visualize a street network. I would like to visualize both (two) lanes in opposite directions of a road. I am using this code https://github.com/gboeing/osmnx/issues/162 ...

1
2 3 4 5
18