Skip to main content

Questions tagged [geopandas]

For questions about using GeoPandas in Python

Filter by
Sorted by
Tagged with
0 votes
1 answer
40 views

Generalize/Denoise Multipolygons [duplicate]

I am looking for any Python function, that is able to denoise the area to become more spatially homogenous. In other words, I would like to vanish all small polygons beyond some tolerance. Maybe ...
Luckasino's user avatar
  • 293
2 votes
1 answer
50 views

Python: Split Polygons where they overlap one another [closed]

I have a python script that produces a shapefile of polygons, created primarily using geopandas. I wish to split polygons where they overlap each other. Ideally removing all but one feature where ...
BlindedByBeamos's user avatar
0 votes
0 answers
23 views

Cannot load a geodataframe (from a shapefile) into PostgreSQL (as table) via SQLAlchemy

I would like to publish a shapefile from a directory to GeoServer by using the Python library geoserver-rest. I understand that in order to do so, I need also to load the shapefile as geodataframe (...
Tms91's user avatar
  • 185
-1 votes
0 answers
26 views

Shapefile looks good in GeoPandas, but when opened in ArcGIS Pro rows are filled with incorrect inputs [closed]

I am fairly new to ArcGIS and GeoPandas. In Jupyter Notebook I wrote a function that would take all the ".shp" files in one folder and clean them (removing unnecessary columns, groupby, sum,...
gow boi's user avatar
0 votes
0 answers
32 views

Create shapefile using fiona geopandas succeed but no feature created

From my script I want to create a shapefile from object detection, when the file is small or medium size (under 150.000 features) its workable, but when it more than that value, the feature is null in ...
Ari's user avatar
  • 1
2 votes
2 answers
59 views

Buffer without overlaps in Python

I have a set of points with respective lat/long coordinates and each point has a given value associated with it (basically a field measurement). I would like to draw buffers of a given radius around ...
André Lourenço's user avatar
0 votes
1 answer
23 views

Unable to read shapefile into geopandas as a geodataframe because resulting in OSError: exception: access violation writing error [python] [closed]

I downloaded a shapefile of New York City's building footprint from NYC OpenData through the following source: data.cityofnewyork.us/Housing-Development/Building-Footprints/nqwf-w8eh I then tried to ...
Lino Sanchez Siegel's user avatar
0 votes
0 answers
24 views

Sample Raster Value code check

I have written code to loop through prism climate data (rasters) data at certain 2-week intervals then take the mean of that interval then append it to the original shapefile. #%% Processing Sinks for ...
Ekkehardt Rosasee's user avatar
1 vote
1 answer
52 views

How to write two geopandas dataframes as layers of a .gpkg file in memory in python?

Currently, to save a geopackage to Google Cloud storage I have to first create and save each layer locally. I would like to write it memory and the copy from memory to GCS. I'm stuck on the writing to ...
learningGeo's user avatar
3 votes
2 answers
134 views

Clip data in GeoPandas to keep everything not in polygons

I have two shapefiles. One is Point Data (Call it Adj). The other is a polygon(s) shape file. I want to clip the data to keep only the points that are not in the polygons. Is there an easy way to do ...
Ekkehardt Rosasee's user avatar
0 votes
1 answer
43 views

Sample raster (Landsat) using points (preferably using Python or maybe GEE Code editor)

I have a point shapefiles that covers an area of Multiple states and multiple Landsat (NDVI) tiles from a span of May-Sept for 2005, 2010, 2015, 2016, and 2021. Let's just focus on 2005 for now. I ...
Ekkehardt Rosasee's user avatar
4 votes
1 answer
67 views

Linking all possible polygons to point within a distance

I am using Python. I have a shapefile with polygons and a CSV with points. My goal is to assign to the points all the possible polygons within a distance of 10 kilometers. I am able to assign the ...
OgeiD's user avatar
  • 618
2 votes
1 answer
62 views

AttributeError: 'GeoSeries' object has no attribute 'is_valid_reason' in GeoPandas

I was going over the documentation for checking on valid geometries. When I wanted to try the example for is_valid_reason, got this error: import geopandas as gpd from shapely.geometry import Polygon ...
saQuist's user avatar
  • 826
-1 votes
0 answers
27 views

SVM for Groundwater detection in Spyder

I am trying to run the code below to detect groundwater potential area whereas the training data is the tubewell data as x and groundwater parameters as y. However, it took a lot of time to run the ...
Syarifah Raihana's user avatar
1 vote
1 answer
53 views

Looping through folders to find shapefiles and then merge them

I am trying to merge shapefiles into one shapefile by looping through folders. I merge them one by one by iterating through each file then merging it with an empty gdf that I set with columns that are ...
Ekkehardt Rosasee's user avatar
0 votes
1 answer
38 views

Combine dissolve aggfunc and lambda function

I am looking to aggregate different polygons and applies analytical functions at the same time. I have tried: df.dissolve(by=['ville','arrondissement','quartier'], aggfunc={'transaction':'count','...
bravopapa's user avatar
  • 485
0 votes
1 answer
41 views

GeoPandas error: AttributeError: You can only set the value of existing options

When I try to set pyogrio globally like this: gpd.options.io_engine = "pyogrio" I get the error: AttributeError: You can only set the value of existing options This however works: test = ...
i.i.k.'s user avatar
  • 1,753
0 votes
0 answers
51 views

After installation of pyogrio Could not detect PROJ data files. Set PROJ_LIB environment variable to the correct path. when importing gpkg

When I import a geopackage with only geopandas all is fine, however, if I try to use pyogrio like this in my jupyter notebook: gpd.options.io_engine = "pyogrio" network = gpd.read_file(r&...
i.i.k.'s user avatar
  • 1,753
3 votes
2 answers
222 views

Getting GeoSeries with all the points and their coordinates from GeoSeries that has multiple types of geometries in GeoPandas

I'm writing a program that reads two MultiLineString shapefiles and intersects them, then processes the result in various ways. The intersection normally will give me a GeoSeries of points, like this: ...
cfnnm's user avatar
  • 33
0 votes
0 answers
27 views

Testing for joint spatial clustering across multiple variables

I have an analysis that I'm uncertain how to conduct. I have a GeoPandas dataframe that consists of a few hundred sample points (rows) and for each point I have counts of different variables. These ...
clifgray's user avatar
  • 409
2 votes
1 answer
42 views

Projection with transformation returns unexpected results using GeoPandas compared to ArcPy

I am using GeoPandas to project a geodataframe of polylines representing water crossing locations across the USA from ESRI:102039 (NAD 1983 USGS Contiguous USA Albers) to ESPG:3857 (WGS 84 / Pseudo-...
mafbarth's user avatar
1 vote
1 answer
68 views

MultiPolygon to Polygon in Python [closed]

I need to change geotype from MultiPolygon to Polygon. Most of the original features are Polygon, but are automatically imported through API as MultiPolygon. How can I change all the types ...
Ilya's user avatar
  • 13
0 votes
0 answers
28 views

Colouring MapInfo polygons from Python

I'm using rasterio and geopandas to generate MapInfo TAB files. The resulting file contains a lot of polygons (~10 000). Here is the function I use: with rasterio.Env(): with rasterio.open(...
Riuss's user avatar
  • 1
0 votes
2 answers
68 views

How to round or limit the number of decimals in geodataframe

I need to limit or round decimals in my GeoDataFrame so that when importing to a shapefile and opening a file in QGIS, the number of decimals remains the same as in the dataframe. In GDF looks like: ...
Ilya's user avatar
  • 13
0 votes
1 answer
46 views

Can't change geometry in GeoPandas

I have an extremely strange issue with my code. I have a dataframe with 2 columns with point geometries, startgeom and endgeom. I want to assign a geometry from startgeom, do some calculations and ...
Geocarto's user avatar
0 votes
0 answers
41 views

How to clip a raster file using a GeoJSON?

I am trying to clip or crop out the area of interest from a multi-spectral tiff file downloaded from Sentinel-2, using Rasterio and GeoPandas. For reference here are the code snippets - import ...
Anurag-Sharma's user avatar
3 votes
1 answer
55 views

Remove OGR_STYLE field while/after writing

I'm using an OGR_Style field to set the styles for a MapInfo Tab file with Geopanadas. Does anyone know if there's a way use the OGR_Style field for styling but not include it as a field in the file?
Prosper's user avatar
  • 115
4 votes
1 answer
124 views

Reasons of slow intersection of two GeoDataFrames using Python [closed]

I am trying to find the largest intersecting area for each Polygon in a layer1 compared to the geometries in a layer2 in python. I use geopandas.overlay for it. However, the geometries in layer2 don't ...
tetje's user avatar
  • 99
2 votes
1 answer
55 views

Converting GeoPandas points to polygons and retaining column information

I have a geodata frame that looks something like this: Index Side UniqueID GroupName geometry 0 Blue S1A1B1-D1 Group1 POINT(##.#####, ##.#####) 1 Blue S1A2B1-D1 Group2 POINT(##.#####, ##.#####) 2 ...
Cardiff's user avatar
  • 23
0 votes
0 answers
14 views

Clip NetCDF data by point shapefile in Python [duplicate]

I have .nc files containing global chl-a data. I want to clip these files using a point shapefile and get the chl-a values specifically for those points. However, every similar code that I have come ...
saba moshtaghi's user avatar
2 votes
1 answer
42 views

Does geopandas overlay use spatial indexing

I have a general question about geopandas overlay method. I want to know whether it already uses spatial indexing or not. If not, how would I apply indexing? Background I do an intersection with ...
tetje's user avatar
  • 99
2 votes
1 answer
80 views

GeoPandas giving wrong distances between polygons and points

I'm trying to get GeoPandas to give me the distance between suburbs (polygons) and the city centre (a point). However, no matter what coordinate reference system I use for the distance measurement (...
aiwl's user avatar
  • 123
-3 votes
1 answer
126 views

How to create a file geodatabase (.gdb) in Python without ArcPy?

I want to make a file geodatabase (.gdb) with GeoPandas and Fiona, but as long as I know there is no way to make a feature class without using ArcPy. Is there a way to make it?
Maldonado's user avatar
2 votes
1 answer
72 views

is this posible to extract coastline or border line from multipolygon geojson but keep them separate

i have multipolygon cities , how to get coastline or border line that not intersect with other cities, and keep separate each cities, is that possible? there any software or programing method (like ...
good112233's user avatar
1 vote
2 answers
92 views

Merge partially overlapping line geometries into a single line feature with QGIS, pyqgis, geopandas, shapely

I have a geopackage file with multiline features. The features are extractions from the same line geometries. Some of those extracted lines do overlap, so they partially share the same geometry. Some ...
i.i.k.'s user avatar
  • 1,753
0 votes
2 answers
62 views

GeoPandas join nearby polygons

I have a geodataframe with polygons I would like to join the polygons with the same 'Name' and that they are separated by less than 5 units and summarize the value of the 'Value' field Starting ...
Eduardo 's user avatar
0 votes
1 answer
69 views

Extracting segment of specified length from line geometry using pointgeometry as middlepoint (not as geometry centerpoint) with Python [closed]

I have a line and point geoemtry. I need to extract segments of the line geoemtry based on the point geometry. The point geometry contains the length of the segment I need to 'cut' as an attribute ...
i.i.k.'s user avatar
  • 1,753
0 votes
1 answer
149 views

Convert WKB geometry to WKT

I am using DuckDB in order to access buildings polygons (an open dataset). query = f""" SELECT type, height, level, class, JSON(names) as names, JSON(sources) as ...
ReutKeller's user avatar
  • 2,169
0 votes
0 answers
97 views

How to infer the cordinate system dynamically from a wkt point, for create buffers?

What about if you have a multiple point of the world? How can infer the cordinate system dynamically from a place in Python, for example Mexico, Brazil, Chile, Canada, etc.? The goal is to create a ...
Cristián Vargas Acevedo's user avatar
0 votes
2 answers
203 views

Open GDB file in Python

I would like to be able to open and view a GDB file (GIS file for raster data) in Python. The data is official US government GIS data, the file can be downloaded publicly here: https://www.fs.usda.gov/...
Mustard Tiger's user avatar
1 vote
1 answer
60 views

Inconsistent plot behaviour between geopandas/folium/leaflet and plotly

I need to plot an interactive map of German postal code regions. For this I would like to employ a plotly.express.choropleth map. For roughly ~7500 of the 8300 regions this works like a charm. ...
J Berz's user avatar
  • 13
5 votes
1 answer
110 views

GeoPandas dissolve only adjacent polygons

With GeoPandas I want to do a dissolve for a field but only for the adjacent polygons. For example, I have the following geodataframe geojson_str = '''{ "type": "FeatureCollection",...
Eduardo 's user avatar
0 votes
0 answers
18 views

Error while installing any libraries in ArcGIS Pro Python notebook

I'm trying to install libraries, but the same error is shown for all library installation.
mangotree's user avatar
0 votes
0 answers
111 views

Could not convert the GeoJSON to ee.Geometry()

My GeoJSON file's structure: { "type": "FeatureCollection", "name": "10", "crs": { "type": "name", "properties&...
Muhammad Waqas's user avatar
0 votes
1 answer
30 views

Why does the polygon saved in geodataframe have a different value from the shapely polygon it came from?

I'm working with Jupiter and ipywidgets and Ipyleaflet , trying to draw polygons on a map and saving to a geodataframe. I have the following in a notebook cell: myDrawControl = DrawControl( rectangle={...
user1592380's user avatar
1 vote
2 answers
104 views

Intersecting geodesic lines with coordinate grid using Python

I am performing an analysis using Python where I am trying to assign emissions properties of flights to individual cells in a 4x5 degree coordinate grid proportional to the length of the segment ...
nsteins's user avatar
  • 11
0 votes
0 answers
87 views

GeoPandas colormap normalization for folium explore

When creating static plots a GeoDataframe with matplotlib, I can use colormap normalization to plot data on a robust scale centered at zero. For example as shown in this question Center / normalize ...
ogb119's user avatar
  • 1
0 votes
1 answer
49 views

Selecting the right CRS for a KML file in Jupyter

I'm working with Ipyleaflet to display a KML file in a Jupyter Notebook I have the following in a cell: import fiona import geopandas as gpd from ipyleaflet import GeoData, Map, basemaps fiona....
user1592380's user avatar
0 votes
0 answers
24 views

Create new rasters by interpolating between pre and post rehabilitation digital elevation models

I have two rasters that cover a regional watershed. For most of the watershed, they are exactly the same, but over a small area defined by a shapefile (remediation_zones), the rasters are different. ...
Em_kath_white's user avatar
2 votes
2 answers
84 views

Colorizing polygons based on a user-defined color scheme determined by the column value

I have a shapefile, and the population density for each polygon is provided in a separate CSV file.I would like to assign colors to each polygon based on a user-defined color scheme determined by the ...
user240392's user avatar

1
2 3 4 5
33