Questions tagged [fiona]

Fiona is OGR's new, neat, Pythonic API

Filter by
Sorted by
Tagged with
2
votes
1answer
35 views

How to write attribute-only tables in Geopackages with GeoPandas

I searched around and found similar questions (Writing Non Spatial Table into Geopackage - Python), but that discussion is on a slightly different topic. Is there a way to write attribute-only tables ...
1
vote
0answers
53 views

Extend the contours of the polygon into a polygon

I would like to be able to extend the vertices of one polygon to the edge of another polygon, how does the snapping between poligons using python. The photo shows a representation of my problem. I ...
2
votes
0answers
29 views

Converting GeoJSON to shapefile in Python with Fiona: problem with Geometry Collection

I have a function, using the Fiona package, to convert a GeoJSON to their respective shapefiles (going to figure out later to get merge them back together later on) However the problem is the GeoJSON, ...
1
vote
1answer
33 views

How to find geometries of all intersections in a polygon and calculate their areas and perimeters using shapely and fiona?

I am able to open the shapefile and convert it into a shapely polygon but I am struggling with the logic required to isolate intersecting polygons and calculate their areas and perimeter. from shapely....
0
votes
1answer
58 views

FionaDeprecationWarning: Collection.__next__() is buggy and will be removed in Fiona 2.0. Switch to `next(iter(collection))`. record = next(c)

I have some Python3 code used to import shapefiles using fiona. This is the main set of lines: I created some code (Python3) with these lines: c = fiona.open(dataDir + "/" + sourceFile, ...
3
votes
0answers
47 views

Flatten API JSON response containing nested structures including a GeoJSON to a GeoDataFrame while keeping the GeoJSON geometry as is

TL;DR: I have a JSON response from an API that I'd like to convert to a GeoDataFrame. But some of the attributes in the response structure are nested dictionaries, including a GeoJSON object and if I ...
0
votes
1answer
24 views

How to open a GMLAS layer in Fiona or GeoPandas

I want to open a GMLAS layer. When I open the file with: ogrinfo -ro GMLAS:D:\path\to\file.gml Output: INFO: Open of 'GMLAS:D:\path\to\file.gml' using driver 'GMLAS' successful. ... 15: roofsurface ...
1
vote
2answers
45 views

Obtain Polygon Extent with Multiple Polygons within Shapefile

I have a shapefile that contains multiple polygons. I would like to extract the extent of each of those polygons within that shapefile. The majority of answers that I have been able to find use arcpy ...
0
votes
1answer
81 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 ...
2
votes
0answers
43 views

Clipping multiple raster with multiple shapefiles in Python

I am trying to adopt existing code for clipping multiple rasters with multiple polygons based on this link: Subsetting multiple rasters with multiple shapefiles using Python I added the following ...
0
votes
2answers
66 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 ...
0
votes
1answer
30 views

Match a list of shapefile names to list of raster names then do something

I have a list of shapefiles and a list of rasters that I would like to match the names then do some data extraction for later analysis. The beginning of each raster and shapefile begins with "...
1
vote
0answers
33 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 ...
0
votes
1answer
67 views

Load a shapefile into geopandas from a request.files

I'm trying to receive a simple .shp file, without been zipped, via web request and convert it to a geopandas dataframe. I tried to use io.BytesIO to wrap the file but also didn't worked.. I tried to ...
0
votes
0answers
36 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
50 views

Clipping ENVI files loses information in header (.hdr) file

I have created a command-line operated python-script to cut AVIRIS imagery with polygons. I do this by using rasterio to load the imagery and fiona to load the polygon. The AVIRIS imagery comes in two ...
2
votes
1answer
54 views

Cannot write int value into a Geopandas GeoDataFrame

description of the problem I'm writting a function to simplify my use of rasterstat. def zonal_stat(src_rst, mask_vector, out_vector, measurments=available_stats[:4], verbose=False): ""&...
3
votes
0answers
50 views

Inconsistently getting “Input shapes do not overlap raster”, CRS appear to match

Masking topographic raster data by a shapefile (bedrock geology polygon). Following this guide I do this: with fiona.open("geology.shp", "r") as shapefile: geology_mask = [...
2
votes
1answer
141 views

Problem with using Fiona to write out GeoJSON objects to GeoPackage layers

I'm attempting to use fiona to write out a number of GeoJSON objects to different layers in a single GeoPackage. Here's an example json.dumps() representation of the GeoJSON object containing one ...
1
vote
0answers
288 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
0answers
123 views

Symmetrical Difference using fiona and shapely

I have a polygon that I want to merge into an existing polygon. To do this I first need to run symmetrical difference between the two overlapping polygons, and then merge them. Before symmetrical ...
1
vote
1answer
73 views

PermissionError when trying to load the layers in an ESRI File Geodatabase

I am trying to list the layers of a file geodatabase using fiona. I would like to then pick a layer and use geopandas to extract the layer as a geodataframe: import fiona layers = fiona.listlayers(r'...
1
vote
2answers
70 views

What coordinate system is this? How can I project it to WGS84 (lat-long) system in Python?

I had an AutoCAD drawing of a floor plan. I imported it to python using Fiona and checked the metadata. The CRS is empty. When I checked the coordinates for the geometry, it was in the following form, ...
1
vote
1answer
36 views

Determining driver, spatial reference and other props from an open GDAL layer

I have a very large network share full of data (raster, vector, sometimes mixed inside of geopackage and/or file geodatabase containers). I have a set of classes that crawl through it all and use ...
3
votes
2answers
57 views

Performance regression: fiona.transform much slower since GDAL 3

I have run into some severe performance degradation when upgrading an environment to GDAL3. I could track the issue down to fiona.transform, which is a lot slower (about 15 (!) times) now than it was ...
0
votes
1answer
133 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 ...
1
vote
0answers
61 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
152 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 ...
0
votes
0answers
38 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', ...
2
votes
1answer
122 views

Difference in geometries of shapefiles

I have the geometry of the outline region as part of one shapefile (which is only one feature and there are other features in it apart from this). Other polygon regions' boundaries which are colored ...
1
vote
1answer
66 views

Unpack error occuring when sampling raster values to points with rasterio

I'm new to Python. I'm trying to sample raster values to points based on the geometries of a shapefile using the below code but I'm receiving the below error . import fiona import rasterio as rio ...
0
votes
1answer
168 views

Select only raster overlapping shape files using Rasterio

I'm cutting out several polygons from different rasters using the IDs of a shapefile and I would like the images to be just those polygons that overlap the raster without saving the empty images. ...
1
vote
0answers
131 views

How to write to geopandas dataframe directly to (Google) Cloud Storage?

I would like to write a geopandas.Dataframe directly to (Google) cloud storage, from the documentation fiona enables this, however I am not sure how to supply the correct **kwargs for the geopandas....
0
votes
1answer
28 views

Computing linestring between two different point shapefiles

I have two point shapefile representing towns within a state and I want find the distance between them. Since the points are in different shapefiles, should I merge them so they would be in the same ...
0
votes
1answer
37 views

Errors relating to merging point shapefiles

I have created two different point shapefiles which represent towns within a state. However I want to know the distance between both towns, but first I want to draw a line between them. Is this ...
-1
votes
1answer
70 views

How to add a geocode in long,lat instead of lat,long [closed]

I am a bit confused. I am trying to geocode coordinates of a point shapefile, but in long lat instead of lat long and add the address to a new shapefile. Any ideas? import fiona from geopy.geocoders ...
0
votes
0answers
19 views

how to output convex_hull polygon of points shapefile [duplicate]

i have a shapefile of more than 8 points and i have written a code get the convex_hull geometry of of the points and output it as a shapefile using fiona. however the code returns an error saying: ...
3
votes
1answer
3k views

Computing convex hull of points using shapely

I have a points shapefile and I want to compute the convex hull of the points using shapely, and output the result as a shapefile using Fiona. Does anyone know how I can do that? This is what I have ...
0
votes
0answers
966 views

Geopandas geodataframe copy with where clause causes geometry issues

Question up front: What is likely happening here, where when I take copy of the dataframe with a where clause present that there is an apparent break in the geometry, as implied by the linestring ...
3
votes
2answers
309 views

Installing Fiona into cloned conda environment in ArcGIS Pro gives ImportError

I am trying to install Fiona into a cloned conda environment in ArcGIS Pro. I have cloned the default environment and tried to install it both through ArcGIS and through the conda prompt (through ...
1
vote
1answer
886 views

Finding the centroid of a merged polygon using shapely function

I have a polygon shapefile and I want to find the centroid of the polygon, and output the centroid as a new shapefile before I geocode. How I should do this with Python functions shapely and Fiona and ...
1
vote
0answers
32 views

Trying to fuse 4 local authorities (polygons) as one [closed]

I am trying to extract 4 polygons (LA) from a country shapefile, combine them together as one. However, I ended up extracting those specific 4 polygons I was looking as a shapefile, but was unable to ...
1
vote
2answers
1k views

Selecting specific rows and column from a shapefile using Fiona and Shapely

I am new to using PyCharm, but I am trying to cut out 4 rows from a county shapefile from that 4 rows specify the columns or attributes to also be extracted and output the result as a new shapefile....
2
votes
2answers
892 views

When installing Fiona on Windows 8.1 it does not fetch correct GDAL version

When I try to install Fiona binary C:\Python37\Scripts>pip install "D:/Fiona-1.8.13-cp37-cp37m-win_amd64.whl" using the 'Fiona-1.8.13-cp37-cp37m-win_amd64.whl' from the Unofficial ...
2
votes
1answer
801 views

Cannot open zip, compressed, file on external drive with GeoPandas or Fiona, it opens on C drive [closed]

I am working with Windows 10 and GeoPandas version '0.4.1' which utilizes Fiona version '1.8.11' I am trying to open a shapefile from a compressed folder (as described here https://geopandas.org/io....
4
votes
1answer
350 views

Missing columns opening GDB with GeoPandas/Fiona

I am trying to import a GDB file database table and convert it to a (Pandas) dataframe. I have been trying to do so using GeoPandas and Fiona. The problem is however that not all columns are being ...
0
votes
1answer
130 views

Clip vector by extent in fiona [closed]

I'm relatively new to fiona and I'm wondering how I can crop/clip a vector file with a bounding box. It is important to mention I want to clip, not only to get the features withing the bounding box. ...
2
votes
0answers
58 views

Polygonize every single pixel of a raster

How can I get every pixel separated? When I calc unique values, if two pixels have the same value, it converts in one row in the final shape. I need every single pixel converted into one unique ...
2
votes
2answers
611 views

CRS error working with Solaris [closed]

result_polys = sol.vector.polygon.georegister_px_df(mask2poly, affine_obj=tile_tfm, crs= 'epsg:4326') ...
4
votes
1answer
143 views

GeoPandas Intersect function gives different result to Shapely

Using this example dataset of country geometries, I seem to get a different result on whether or not the USA and Mexico intersect when I do the calculation with GeoPandas as opposed to directly with ...

1
2 3 4 5 6