Questions tagged [fiona]

Fiona is OGR's new, neat, Pythonic API

Filter by
Sorted by
Tagged with
1
vote
1answer
15 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
60 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
31 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
41 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
38 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
21 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
32 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
22 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
67 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
42 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
0answers
39 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
45 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
27 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
29 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 ...
0
votes
1answer
36 views

Merging two point shapefiles as one in using shapely and fiona

I am a little bit confused. I have two point shapefile in the same Co-ordinate reference system, and I am trying to merge them using shapely to merge them together as one and output the geom with ...
-1
votes
1answer
45 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
18 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
1k 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
602 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 ...
2
votes
1answer
177 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 ...
0
votes
0answers
12 views

Max text length Fiona\GeoPandas enables

I have a GeoDataFrame that i am trying to save as a JSON however when the length of a value is longer than 253 chars it is being cropped. Does anyone know how to change it?
0
votes
0answers
45 views

How to use fiona to directly write to a zip file

Is there a way to directly create a new .zip file that contains shapefile data using fiona? The minimal working example below works as is to produce the shapefile contents in the test/ directory. I ...
1
vote
1answer
200 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
29 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
350 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
0answers
335 views

Installing Fiona using GDAL 2 on Windows?

When I try to install Fiona using 'Fiona-1.8.13-cp37-cp37m-win_amd64.whl' from Unofficial Windows Binaries for Python Extension Packages I am getting the following error D:\>pip install "Fiona-1.8....
1
vote
1answer
280 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....
3
votes
1answer
168 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
86 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
50 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 ...
1
vote
2answers
412 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
94 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 ...
2
votes
0answers
127 views

Offset after clipping an image using rasterio.mask (illustrated with figures) [closed]

I want to clip an image named img_A of dimensions 14000x10000 using a polygon shape in order to get the same dimensions than another image named img_B of dimensions 1925x1372 (see figure 1 below). The ...
3
votes
1answer
132 views

Setting DXF colors via Fiona

One might expect that the "Color" CAD field would control this, but the driver doesn't allow it to be set. schema = {'Layer': 'str', 'Color': 'int'} with fiona.open(path, 'w', 'DXF', schema=schema) ...
3
votes
1answer
247 views

Find the closest line to a polygon Python Rtree

I have a series of fields and roads I am trying to find the nearest road to each field. I want to add field to each of my polygons with the index/name/etc of the closest road. Would this be the ...
1
vote
1answer
699 views

How to write a multi geometries .geojson file with Shapely/Fiona?

I am very new to fiona and shapely, and trying to do something that doesn't seems to be designed : I have a list of points and a shapely.MultiPolygon (Voronoi polygons from the previous list of points)...
1
vote
1answer
2k views

Convert lines to polygons with shapely polygonize

I have a line shapefile that I am trying to convert to polygons with python using fiona and shapely. inFile = '/content/drive/My Drive/polyline.shp' outFile = '/content/drive/My Drive/polygon.shp' ...
1
vote
0answers
294 views

Reading GeoPackage file bigger than RAM size with GeoPandas?

I have a gpkg file that's around 10GB, and 8GB of RAM. So, if I were to read my file: import geopandas as gpd fp = "/path/to/my/file.gpkg" data = gpd.read_file(fp) print(data.shape) My computer ...
0
votes
2answers
838 views

Python convert lines string to polygon if closed

I have a series of contour linestrings some are closed and some are not. The linestring values are between -1 and 1. I am trying to create polygons from the linestrings if they close and keep the ...
1
vote
1answer
945 views

Getting CRS to export shapely polygon to shapefile

I am trying to export a shapely polygon to a shapefile. I have tried this, but the CRS is missing, when I try to import it in to QGIS. The shapely polygon is from this OSMNX example but edited to ...
1
vote
2answers
97 views

Getting MemoryError from Fiona when merging large amounts of buffered data (Python)

I am using fiona and shapely together to buffer points and then merge them and write them to a shapefile. For almost all of my datasets, this is working fine. However, I am currently getting a ...
1
vote
0answers
41 views

Obtaining least number of grids (polygons) covering a separate polygon while the grids are overlapping

I have grids as polygons where the grids are overlapping. I want list of grids covering a separate polygon. The image below demonstrate the problem. The red lines are the edges of the grids and the ...
0
votes
1answer
279 views

Installing rasterio and Fiona together?

I work on Windows; I use Christoph Gohlke wheels; Python 3.7 After installing GDAL-3.0.1 and Fiona-1.8.6 an error occurs on import of fiona from fiona.ogrext import Iterator, ItemsIterator, ...
3
votes
1answer
532 views

Convert contours to polygons maintaining attributes using Python?

I have a series of polylines(contours) that i want to convert to polygons using Python (GeoPandas, Fiona, Shapely). Because these are contours, there will be donut polygons, can anyone point me to how ...
2
votes
1answer
435 views

Creating equally spaced coordinates on California state map created with basemap?

I have created a California state map with basemap Python library and this shapefile. Code is below from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt fig, ax = plt.subplots(...
5
votes
1answer
2k views

Geopandas read_file only reading first part of KML

I am trying to read the following file with GeoPandas: import geopandas as gp gp.io.file.fiona.drvsupport.supported_drivers['KML'] = 'rw' df = gp.read_file('http://watchthemed.net/index.php/json/...
1
vote
0answers
38 views

Select features of a shape which are not in another shape

I have a shape with some features (let's say 100) and a second shape with some of this features (50) buffered (5 meters inside buffer). I want to select and write in a new shape every feature of the ...
0
votes
2answers
349 views

Fiona and Geopandas not applying CRS to shapefile during creation

I'm trying to create a shapefile of points from a coordinate list. But, when I use fiona to create the shapefile Arc Catalog is showing that there is no CRS. I tried to add the CRS with Geopandas and ...
5
votes
1answer
173 views

Using libraries other than PyQGIS to develop plugin for QGIS?

I develop a plugin for QGIS. Before to integreted it in the QGIS I developped it with GIS library (Fiona, shapely, geopandas, ...) and it work well. Now I try to build it with plugin_builder of QGIS. ...
2
votes
1answer
1k views

Quickly find all polygons that overlap with two or more polygons in Shapely

I have a set of Polygons (in Shapely) that I wish to find all intersections that are comprised of overlaps of two or more polygons. I have been working based off the code found in this answer. I have ...

1
2 3 4 5