Skip to main content

Questions tagged [fiona]

Fiona is OGR's new, neat, Pythonic API

Filter by
Sorted by
Tagged with
0 votes
0 answers
27 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
1 vote
1 answer
44 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
1 answer
54 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
-3 votes
1 answer
117 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
78 views

How to handle fiona._err.CPLE_AppDefinedError when using geofileops.makevalid on large files?

I am testing geofileops.makevalid. To do so, I create a GPKG file with a number invalid of geometries to fix. First, I create this Python script, test.py: import geofileops as gfo import geopandas as ...
zabop's user avatar
  • 2,224
0 votes
0 answers
91 views

Fiona Throws Error Null layer: ''

I have a file Mapp.kml (1 of 5). I am trying to read this file into Python through Fiona. I keep getting an error ValueError: Null layer: '' Things I have tried: polygon_1 = gpd.read_file('../MAPP....
Kinshuk Singh's user avatar
1 vote
1 answer
610 views

Validate GeoJSON geometries using geojson Python package via Fiona

I have an application that allows users to submit a shapefile or GeoJSON file. I would like to use Python to validate the files and geometries within them to make sure I process valid geoms. Im having ...
glw's user avatar
  • 187
0 votes
1 answer
337 views

how to install fiona on a newly generated github codespace?

This question as been asked multiple times here and on SO but it seems anything related to GDAL in the python realm requires special care on any new environment. So here is the Github codespace one. I ...
Pierrick Rambaud's user avatar
0 votes
2 answers
209 views

Determining minx/miny/maxx/maxy for shape from polygon in GeoJSON file

I have implemented the following code to search a GeoJSON file for a point (not asking for a code review or critique): #!/usr/local/bin/python3.11 import os import sys import fiona import shapely def ...
Joel Breazeale's user avatar
2 votes
1 answer
123 views

Updating metadata in geodatabase using fiona

I am trying to update the metadata on an already written .gdb with n layers. I would like to add the same metadata to each layer. When I read in the file and update the metadata dictionary, the added ...
Ilan Rich's user avatar
0 votes
1 answer
189 views

Trouble loading fiona

I'm having trouble loading fiona. I am able to import/run GDAL and GeoPandas with no issues but when I try loading fiona, I get an error message (please see below). I have python (3.9.11) through ...
user228948's user avatar
1 vote
1 answer
141 views

Does geopandas handle shapefiles (in lat/lon) that straddle the anti-meridian properly?

I have been looking for a way to check if a point lies within a shapefile. i had some code that worked for the most part (using shapely and fiona) but my understanding is that it will exhibit ...
Alan Sanchez's user avatar
0 votes
0 answers
96 views

Working with NHDPlus data in GDB file format using GeoPandas

I am trying to work with the NHDPlus High Resolution dataset from the USGS. Looking at the documentation, there should be all sorts of data table available as well as mapping layers but the only thing ...
Wesley Young's user avatar
0 votes
1 answer
1k views

Limiting Voronoi polygons from shapely.voronoi_polygons to a shape with extend_to

I'm trying to get some voronoi polygons from a set of coordinates distributed within a country, I don't need said polygons to extend out of the country, I tried using extend_to from voronoi_polygons ...
Gustavo Marin's user avatar
0 votes
0 answers
315 views

Comparing two GeoDataFrames that are written using different drivers

I'm trying to write one of the GeoDataFrames available with the GeoPandas package to a File GeoDataBase, read this back into memory, and then measure equality across these two GeoDataFrames. For some ...
philiporlando's user avatar
0 votes
0 answers
696 views

GeoPandas fails silently when reading GeoJSONs

I have a file example.geojson. This file has 68 features (jq '.features | length' example.geojson returns 68). If I try to load this file to a GeoPandas dataframe (gpd.read_file docs), I can choose ...
zabop's user avatar
  • 2,224
0 votes
0 answers
146 views

Generate points inside polygons in Python

I have one raster image and one vector field. I cut the raster image according to the vector area. I want to get the coordinates of each pixel of the cut image, but I couldn't. While the expected ...
geomaticpoly's user avatar
1 vote
1 answer
1k views

Converting contours in an image to lines in shapefile using Python

I have processed a screenshot from Google Maps using OpenCV and identified some contours for the red road sections, and I want to project these contours to a shapefile. I have searched but couldn't ...
ali bakhtiari's user avatar
0 votes
1 answer
392 views

GeoPandas - can't write to file because field names are tuples (AttributeError)

I have created a new shapefile by dissolving and computing centroids from an existing shapefile. I have also aggregated values of the existing shapefile to use in the new shapefile. However, when I ...
Maarten 's user avatar
0 votes
1 answer
202 views

Why do we need to specify a format driver with fiona?

What are format drivers for? For example why is this necessary: with fiona.open(save_file, "w", driver="ESRI Shapefile", schema=schema) as c: Shouldn't it just be able to ...
jlcv's user avatar
  • 345
0 votes
0 answers
60 views

Cannot read SHP polygon using Geopandas [duplicate]

I am trying to read ESRI SHP Polygon using geopandas: polygon=gpd.read_file(r'Path.shp', encoding='utf-8', driver='ESRI Shapefile') But I am getting this error: NotImplementedError: A polygon does ...
adamekcerv's user avatar
1 vote
0 answers
25 views

Creating branched linestring [closed]

I have a shapefile where a cable consists of multiple parts. In the example below the highlighted cable consists of three parts. I have exported the attribute table and am trying to write a Python ...
RutgerTauw's user avatar
4 votes
1 answer
2k views

Trying to convert GeoPandas Dataframe with date to ESRI Shapefile

Created a GeoPandas dataframe from an excel sheet. The schema for the dataframe is: {'geometry': 'Point', 'properties': OrderedDict([ ... ('DISTID', 'int'), ('...
parchinkos's user avatar
2 votes
1 answer
478 views

Finding distance between points using Python

I have a shapefile containing 10 test points like so: The spatial reference is 2157 - Irish Transverse Mercator I am wanting to find the distance between each point in Python. Ideally, something like ...
user9821840382's user avatar
6 votes
1 answer
691 views

Read xml with CurvePolygon with Geopandas / Fiona

I am trying to use the Dutch BGT Api via https://api.pdok.nl/lv/bgt/download/v1_0/ui/ with the following code: # Native import requests from requests.structures import CaseInsensitiveDict import json ...
pzman's user avatar
  • 155
1 vote
0 answers
44 views

Calculation of the greatest fall in the river [closed]

I have a task to write a Python program using the 'gdal', 'geopandas', 'reasterio' and 'fiona' libraries. This program is to calculate the greatest fall in the river (height difference between the ...
xyz's user avatar
  • 11
5 votes
2 answers
4k views

DriverError when reading GeoPackage with geopandas

I develop an import system that supports popular geoformats. Sometimes I get a DriverError reading GeoPackage files with geopandas, but at times it works well. My code is simple: gdf = gpd.read_file(...
Anna Mikhailova's user avatar
1 vote
1 answer
1k views

How to get all records if WFS output limited to 1000?

I use WFS quite a lot to collect my data with the script below. It works most of the time, but I notice that some of the WFS-services I come across have a limited output, as only 1000 records are ...
SJAAK's user avatar
  • 55
1 vote
1 answer
1k views

Measure distance between points in python

I am trying to determine a rough distance between points in my shapefile. The shapefile I am working with has 28 million points in the structure x y z. I am hoping to find the most common distance ...
fuzzy_raster9873's user avatar
1 vote
0 answers
2k views

Import Errors: fiona and gdal

I can neither import fiona nor gdal. I installed the following Python version: Python 3.9.4 (tags/v3.9.4:1f2e308, Apr 6 2021, 13:40:21) [MSC v.1928 64 bit (AMD64)] Furthermore I installed the ...
Carabi's user avatar
  • 11
2 votes
0 answers
322 views

Can GDAL read/write Geopackage on RAM instead of disk?

I am working on a Python project that makes extensive use of GDAL's Geopackage vector and raster drivers. Since geopackage is essentially SQLite, I also use the Python SQLite library to do lots of ...
Johnathan Tenny's user avatar
1 vote
2 answers
6k views

Python error handling opening a shapefile with fiona

I've written a python script where I read a bunch of files trying to catch various errors (FileNotFound, Import), for example try: df = pd.read_excel(os.path.join(path_to_data, fname_data)) except ...
konstanze's user avatar
  • 133
0 votes
1 answer
487 views

Clip data while reading file into Python with GeoPandas

Geopandas is able to read in only part of a file using: roi= geopandas.GeoDataFrame(geometry) indexed_data = geopandas.read_file("path-to-file", mask=roi) or geopandas.read_file("path-...
sir_olf's user avatar
  • 71
0 votes
1 answer
3k views

Specific WFS error - Fiona: fiona.errors.DriverError: '/vsimem/4ec3f86c094340cc8704fe5b9aa0f517

I am trying to receive some data through several WFS servers. While two work with my code, one gives an error. I don't have enough experience with WFS to see how this one is different from the others. ...
SJAAK's user avatar
  • 55
4 votes
1 answer
4k views

Problem exporting geodataframe to Esri shapefile having datetime field using Geopandas

I had a geodataframe having 4 columns (viz. name, time, description, geometry fiels). I am trying to export the geodataframe to ESRI Shapefile but it is throwing following error: DriverSupportError: ...
RRSC NGP's user avatar
  • 658
1 vote
2 answers
3k views

Error when viewing GeoDataFrame in GeoPandas: "OSError: exception: access violation reading 0x0000000000000000"

When running the following script import fiona import geopandas as gpd data = gpd.read_file(r"C:\data.shp") data.head() I receive the following error Access violation - no RTTI data! ...
obeart's user avatar
  • 41
0 votes
0 answers
146 views

Can't install Fiona in OSGeo4W Shell on Windows 10

When trying to install "Fiona‑1.8.20‑cp39‑cp39‑win_amd64.whl" in the OSGeo4W Shell I get the following errors: extensions/gdal_wrap.cpp(3198): fatal error C1083: Datei (Include) kann nicht ...
Juli's user avatar
  • 29
1 vote
1 answer
554 views

Why is fiona not writing these records?

I'm running through a UTM grid in geojson format with fiona, attempting to add/populate a field based on other field values and then write out to a new file. It appears to successfully build the ...
auslander's user avatar
  • 1,567
0 votes
1 answer
191 views

When using Fiona, DBF missing headers when no records provided

I'm creating a Esri Shapefile using Fiona. If I don't add any records, the dbf created by Fiona does not include the headers defined by the schema. My customers claim that results in an invalid ...
Jared Holmberg's user avatar
0 votes
0 answers
308 views

Fiona schema property name length

Is it possible to increase property name length in schema? If I define schema like this: my_schema = { 'geometry': 'Point', 'properties': {'Here is very long property name': 'float:12.3'} And in ...
DerianFox's user avatar
3 votes
1 answer
3k views

Opening DGN using Python

I'm trying to open a DGN file with Python. I've tried with OGR: driver = ogr.GetDriverByName("DGN") file = driver.Open("C:\path_to_dgn\example.dgn") which returns a NoneType ...
lachlan's user avatar
  • 33
4 votes
1 answer
1k views

Including metadata in GeoPackage file written using GeoPandas/Fiona

I have a Geopandas GeoDataFrame with a couple of categorical columns that I want to write to a GeoPackage file. GeoPandas/Fiona/GeoPackage does not support categorical columns directly, so I'm ...
Timothy W. Hilton's user avatar
6 votes
2 answers
6k views

Listing every layer in Geopackage using Fiona

I loaded a GeoPackage into Python and I can't figure out how to list all the layers in the file. How do I do that? Input: GeoPackage loaded into Python. Desired output: A list of the layers in the ...
Zorro's user avatar
  • 95
4 votes
1 answer
1k views

Writing properties corresponding to a given schema within the GeoDataFrame.to_file() method?

I currently have the following code to write a multipolygon Shapely feature to a GeoPackage: import fiona myschema = {'geometry': 'MultiPolygon', 'properties': {'id': 'int'}} with fiona.open( '/...
swiss_knight's user avatar
  • 10.4k
1 vote
0 answers
904 views

Pyinstaller .EXE AttributeError: partially initialized module 'fiona' has no attribute '_loading' (most likely due to a circular import)

I am trying to create a geospatial Python GUI app using PyQT5, Geopandas, OSMnX, and Folium. I am converting the app into an .EXE file using pyinstaller. Previously, I was successfully able to create ...
Magnum Python 93''s user avatar
2 votes
1 answer
40 views

A raster clipping script does not produce output

I am using the following code to first divide a vector layer to many polygons and after that use them for clipping parts of a raster layer. It successfully split the vector layer to many polygons, but ...
rayan's user avatar
  • 204
3 votes
2 answers
365 views

Raster clipping from many polygons: 'error: NoneType' object is not subscriptable

I am using the following code to first divide a vector layer to many polygons and after that use them to clipping parts of a raster layer. The Name attribute in the vector data has a text data type. I ...
rayan's user avatar
  • 204
3 votes
0 answers
489 views

Split Raster into Tiles - Set Extent

I am using this questions solution to split a raster I have into 1500x1500 tiles. The code works. I have recently been trying to figure out how to set the starting and ending points of the raster ...
Binx's user avatar
  • 1,380
2 votes
1 answer
472 views

GDAL extracted EPSG not compatible with Fiona

I am creating Shapefiles from features extracted from JP2 images in python. My current method of creating Shapefiles by extracting the EPSG from the source image with GDAL and using Fiona is as below ...
g0atm1lk's user avatar
0 votes
0 answers
1k views

Fiona Saving Gives DriverIOError

I have a script that I used before to clip polygons. I modified it a touch to use in another place, but am running into a fiona.errors.DriverIOError. As far as I can tell, all the code is working ...
Binx's user avatar
  • 1,380

1
2 3 4 5
7