We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [fiona]

Fiona is OGR's new, neat, Pythonic API

Filter by
Sorted by
Tagged with
3
votes
1answer
745 views

Define Shapefile Projection with Shapely/Fiona

I am writing a fairly straight forward script of converting GeoJSON data into a shapefile using Shapely and Fiona. My script works but I cannot figure out how to define the CS in the script. def ...
1
vote
2answers
851 views

Fiona throws KeyError when attempting to read a shapefile

I'm attempting to read the AADT_2014.shp file from the New York State Department of Transportation average traffic data (TDV_Shapefile_AADT_2014.zip specifically through fiona (by way of geopandas). ...
2
votes
1answer
668 views

Deleting shapefile element using Fiona?

I have downloaded a shapefile (.shp) that I'd like to read in using fiona.open and delete records. The reason I'd like to delete records is that some records have "None" geometries. So I want to ...
3
votes
1answer
865 views

Attempting to install pip package produces gdalversion is not defined error

I'm very new to using packages in python. I'm on Windows 7 64 bit. I've installed OSGEO4w, and I've checked numpy and scipy are installed. I assume GDAL is installed when I installed OSGEO4W, and I ...
1
vote
1answer
131 views

Is Fiona's collections.OrderedDict immutable?

After opening shapefile I want to use all of its attributes (geometry column, crs, etc), but want to delete the contents of the OrderedDict in the 'properties' key. I want to append new data to it, ...
12
votes
1answer
8k views

GeoPandas to_file() saves GeoDataFrame without coordinate system

I have GeoPandas 0.2.1 py27_0 fiona 1.7.0 np110py27_1 Python 2.7.10 installed in Anaconda 2-4.1.1-Windows-x86 environment. I am able to construct GeoDataFrame by reading input datasets and ...
1
vote
2answers
560 views

Using Fiona to Convert file geodatabase to PostgreSQL / PostGIS?

Is there a way to use Fiona instead of OGR to convert a GDB over to postgresql / postgis within Python? If so, how or where can I look? I cannot seem to find this within the Fiona site or by simply ...
3
votes
2answers
800 views

Save Start/End Points in another shapefile using Shapely

I'm trying to get the start/End points of a Shapefile which geometry type is lines, using Shapely. Here's what I tried : import geopandas from shapely.geometry import * import fiona schema = { '...
8
votes
2answers
11k views

Geopandas Polygon to matplotlib patches Polygon conversion

Unfortunately geopandas plotting is extremely slow and takes a lot of resources, hence I would like to use instead matplotlib for plotting. When I use pure Fiona to open and read the shapefile I ...
5
votes
2answers
2k views

Find common borders of features and get their attributes using fiona and shapely

I would like to find neighboured features in a shapefile using fiona and shapely. As shown in this answer https://gis.stackexchange.com/a/95595/62250 it's easy to get common borders between features. ...
4
votes
1answer
612 views

Read only geometry from shapefile with python/geopandas

I would like to open a shapefile(shp) without loading the attributes(dbf), as I do not care about attributes and it takes about 25 minutes to load them. I am using Python Geopandas, so any Fiona or ...
2
votes
0answers
587 views

Find Properties of Nearest Line Segments to Point in Python

I have been trying to find a workable Python approach to finding nearest line segments to one (or more) points, and came accross @gene's solution to @RustyMagoo's problem here: from shapely.geometry ...
3
votes
1answer
4k views

How To Properly Implement a Bounding Box for Shapely & Fiona?

I am trying to spatially analyze two layers within same GDB file using Python / Shapely. Another user was kind enough to give me a procedure to go by in trying to reduce the number of senseless ...
0
votes
1answer
303 views

Why Does Fiona Crash Python When Creating an Output File?

I've basically followed the Fiona online manual verbatim to write an output file but my code crashes when I call Fiona.open() to create said output file. Traceback reports that the reason for the ...
3
votes
2answers
202 views

Can this Be Recoded to Be More Efficient with Respect to Processing Time?

I'm very new to GIS but have been asked to parse through any given ESRI GDB file-folder without using any ESRI product. I've been trying to focus on using Fiona and Shapely as these seem to be ...
7
votes
1answer
4k views

Plot shapefile on top of raster using plot and imshow from matplotlib

I need to plot a shapefile on top of a raster. I would like to use the python package rasterio and some combination of fiona or geopandas to load the shapefile. I found an example in the rasterio ...
2
votes
2answers
2k views

Troubleshooting File Geodatabase Parsing in Python / Fiona?

I have a test GDB file-folder that I have been able to verify that it does contain features through using some of ESRI's tools. The code I have seems simple enough, but it keeps crashing when I try ...
0
votes
1answer
608 views

How to do a Spatial Join after opening a GDB file with Fiona?

After I successfully open up an ESRI GDB file/folder with Fiona, what open-source Python package should I use to do a spatial join? I was told Shapely is not the appropriate package for this. I am ...
11
votes
3answers
7k views

How to add support for FileGDB (Esri file gdb API) driver in fiona?

There has been a tons of questions on that but none of them solved my problem. I have a machine with: Windows 7 x64 Python 3.4.3 x64 gdal installed: gdalinfo --version --> GDAL 1.11.4, released ...
1
vote
1answer
414 views

How to Parse Through a ESRI GDB File/Folder After Opened with Fiona?

I should point out that I'm a noob. I'm playing around with making a python gui app and believe I have opened an ESRI GDB file/folder using: with fiona.open(GDBPath, 'r') as sourceGeoData What I'd ...
0
votes
1answer
582 views

Fiona does not specify CRS

I try to write a geoJSON from a shp with the fiona package. Works, but fiona does not include the CRS information. with fiona.open(path) as shp: takeCRS = shp.crs takeSCHEMA = shp.schema ...
2
votes
3answers
1k views

Fiona error adding property to shapefile

I'm getting the following error when trying to add a property to a .shp file using fiona in python: Traceback (most recent call last): File "<ipython-input-38-5f04c3b56601>", line 17, in &...
10
votes
1answer
4k views

Drivers of Fiona

What drivers does the python package fiona have? When I check the manual it says [...] and the possible formats are enumerated in the fiona.drivers list. However, when I type in python from fiona ...
1
vote
1answer
191 views

How to find the area with most intersection for buffer regions?

Find the area with the most intersection This question relates to previous question asked - How to find the intersection areas of overlapping buffer zones in single shapefile?. I tried to find ...
3
votes
1answer
7k views

How to find the intersection areas of overlapping buffer zones in single shapefile?

Find the intersections of the buffer zones I found an example where they tried finding the intersection of two different shapefiles -Intersect Shapefiles using Shapely. I've tried to adapt my code to ...
2
votes
1answer
641 views

Fiona and Pyproj incorrect transformation (feet to meter)

I am trying to reproject a shapefile from EPSG:2229 (NAD83 / California zone 5 (ftUS)) to EPSG:2163 (US National Atlas Equal Area (meters)). Below is the code that does this transformation for a ...
3
votes
1answer
352 views

Remove features inside a feature in shapefile using python (UNION, CONTAINS methods)

I have created a shapefile from raster. The shapefile was generated using contours detection. I am in the process of automating feature detection using Python and open source libraries such as shapely,...
3
votes
1answer
2k views

Select by attribute using fiona

with fiona.open(constants.file_combined, 'r') as source: filtered = filter(lambda f: f['properties']['NAME'] == name_dm1, source) # **source.meta is a shortcut to get the crs, driver, ...
3
votes
1answer
548 views

Available Python client libraries for WFS transactions?

I am looking for a Python module to allow me to use WFS-T. Everything I found so far only supports getting data out via WFS, I need to INSERT and UPDATE. owslib does not support WFS transactions (yet?...
2
votes
3answers
308 views

I have an existing attribute table that I'd like to add values to the fields within it while preserving the geometry, how can I do this?

I've tried to use fiona and shapely and ogr, but the tutorials seem to be insufficient to describe how to do such a seemingly simple task. In arcpy this could be done simply with an update cursor. I'...
0
votes
2answers
451 views

importing fiona before shapely raising geos-related OSError

I ran into an issue where the order of imports for fiona and shapely caused the following geos error below which happens when i import fiona before shapely. If I do the reverse all is fine. Must be ...
0
votes
1answer
601 views

Cut a linear feature according to the directions or azimuths

I have a shapefile linear that contains a single items as in the image and I want to divide it into several section respecting the azimuth and the line direction. i have this code : import os ...
7
votes
2answers
9k views

Intersecting two shapefiles from Python or command line?

I'm new to working with geo data and trying to address a similar question to the one posted as How to calculate the size of a particular area below a buffer in QGIS Using command line and/or shapely/...
2
votes
0answers
481 views

How do I create a raster file from a geopandas dataframe storing lats, longs, values, and geometries

From a text file with time, lat, long, and cf values, I create a pandas dataframe (cf_df). Then I use the lat, long values to create a geoseries and create a geopandas dataframe from the original ...
1
vote
1answer
734 views

fiona ValueError: invalid literal for int() with base 10: 'str'

Why below code does not work- import fiona from fiona.crs import from_epsg my_schema = {'geometry': 'Point', 'properties': {'mean_in': 'str', 'total_h1': 'str', 'total_h2': 'str', 'LOS': 'str', 'id':...
3
votes
1answer
2k views

Calculating distances with lat/long in decimals and WGS 84

I need to calculate the distance between points of two different datasets, once with locations of towns, the other with locations of dams. Both are located in different countries in Africa. The more ...
1
vote
0answers
459 views

Creating spatial layer from MS SQL Server table?

I have a table in MSSQL that I am trying to use to create a spatial layer from using the QgsVectorLayer function to load the table as a layer, and then using Fiona to create a shapefile but I am ...
0
votes
1answer
1k views

fiona writing geometry into shapefile problem [closed]

Context: I use lxml library that generates some dictionary (infact it is xml attribute dictionary) from xml and i am trying to write these into a shapefile-i.e. get one element-attribute from xml and ...
4
votes
1answer
2k views

What is a convenient way to write OSM data to a .shp file in python

I wish grab OSM data that is within a specified bounding box and matches specific key/value combinations. I then want to write this to a .shp file for further processing using, probably, the QGIS api. ...
-1
votes
2answers
1k views

Python buffer points and clip with line-segment (OS Open Roads in BNG) [duplicate]

I have an array of points (in latitude, longitude coordinates) which I would like to buffer and dissolve (into a polygon) and then intersect the Ordnance Survey Open Roads (projected in BNG) with that ...
2
votes
1answer
569 views

Arc-node topology data structures in Python GIS packages

I am looking at using the traditional arc-node topological data structure to make some spatial data analysis more efficient. I would like to avoid reinventing the wheel. Is there an implementation in ...
0
votes
0answers
437 views

Find pairs of near features with geopandas, fiona, GDAL etc

I have a feature class of points, a few thousands I have now, but I expect to deal with hundreds of thousands of points. I would like find pair of points that is within a specific distance. The ...
2
votes
0answers
2k views

GeoPandas save to shapefile issue: Unable to open EPSG support file

When I try to use to_file() to write a GeoPandas GeoDataFrame to a shapefile I get the following error. df3.to_file('~/Desktop/testout.shp', driver = 'ESRI Shapefile'); ERROR:Fiona:OGR Error 4: ...
2
votes
2answers
506 views

How to successfully do “nested” looping over a Fiona collection

I wrote some code that basically loops over all features in a shapefile with Fiona in Python, doing some things, calculating some things, etc. I found that it would exit the for loop prematurely, ...
0
votes
1answer
354 views

Very Large Coordinates when Reading Shapefile using Python

When using Python anad fiona package to read a shapefile of Boston, I am getting very large values in the tens of thousands. Why is this? # Import Boston shapefile shapefilename = 'ZIPCODES_NT_POLY' ...
8
votes
1answer
8k views

Rasterize a shapefile with Geopandas or fiona - python

I need to rasterize a really simple shapefile a bit like this http://tinyurl.com/odfbanu. Which is just a shapefile coutaining counties in the US.I have seen this previous answer : GDAL RasterizeLayer ...
2
votes
2answers
315 views

CRS problem between QGIS and fiona / OGR

I have a really annoying problem working with QGIS for visualization and python (fiona / OGR) for the actual operations. I am, by example, doing a simple dissolving operation with fiona. The input is ...
14
votes
3answers
10k views

Dissolving polygons based on attributes with Python (shapely, fiona)?

I have been trying to create a function that does basically the same thing that the QGIS "dissolve" function. I thought it would be super easy but well apparently not. So from what I have gathered ...
0
votes
1answer
635 views

How to update an existing GeoJSON with Fiona

With the code below I can create a new GeoJSON and add data to it: data =[(LINESTRING (-98.98234 19.38234, -98.990341 19.342345, -98.992449 19.378621, -98.991299 19.378233, -98.992349999 19.377381), ...
2
votes
1answer
5k views

Plot points on map using Fiona and/or Shapely

I have written a parser in Python that extracts the coordinates out of a GPX file and I would like to view those points on a map. I have done a little research and it seems like either Fiona or ...