Fiona is OGR's neat, nimble, no-nonsense API

learn more… | top users | synonyms

1
vote
0answers
35 views

I can't get fiona to write while copying shapefile

I am trying to debug a function and have narrowed down the issue to a problem with my attempt to use fiona write. After going through the many online resources, I can't seem to find my problem, ...
0
votes
0answers
47 views

Fiona write crashes

I am trying to write a new shapefile with fiona but after creating the features, i keep getting this output after the program crashes: The program '[6668] python.exe' has exited with code -1073741819 ...
0
votes
2answers
113 views

Convert shapely polygon coordinates

I am trying to work with a shapefile using shapely, fiona and python. The original coordinate system is in latitude and longitude that I am trying to convert to state plane system. So I want an ...
4
votes
1answer
160 views

Understanding the Use of Spatial Indexes

I'm having trouble understanding the use of spatial indexes with RTree. Example: I have 300 buffered points, and I need to know each buffer's intersection area with a polygon shapefile. The polygon ...
0
votes
2answers
29 views

Different output for Fiona Shapefile CRS

Loving fiona, but have a small coordinate system issue. I'm trying to read the crs property on a shapefile to validate projection. Below I contrast fiona documentation with what is output on my ...
1
vote
1answer
41 views

Iterate through a shapefile

How do i iterate through a shapefile using shapely. This is my code but it keeps outputting the same id. I think that it keeps looking at the same record. fc = fiona.open("file1.shp") print fc.schema ...
1
vote
0answers
139 views

py2exe ImportError: No module named _err

The .exe file generated with py2exe returns the following error: c:\Users\...\dist>ShapeFileConverter.exe Traceback (most recent call last): File "ShapeFileConverter.py", line 4, in ...
0
votes
1answer
46 views

Writing shapefile with projection defined crashes Fiona part two

I have the same problem as this post. Writing shapefile with projection defined crashes fiona It says that was an issue with GDAL. I cleaned my site-packages of anything GDAL, fiona, six related. ...
0
votes
2answers
67 views

Count the number of points in a (multi)polygon in shapely?

I'm using Python, Shapely and Fiona to process some shapefiles. Is there an easy way to count the number of points in a polygon/multipolygon in Shapely and Fiona?
1
vote
1answer
44 views

Properly writing floats to feature properties of a new shapefile in Fiona

The following piece of code returns a shp following the driver and crs of a model .shp. import numpy as np #just to test I correctly handle data types import fiona from shapely.geometry import ...
1
vote
1answer
44 views

Is it possible to read shapefile field aliases values using fiona?

I am using fiona to read a shapefile, but not sure about how to get field aliases. Is this possible using this great library?
1
vote
1answer
120 views

Fiona + Shapely: Loading a set of LineStrings and writing their centroids to a shapefile, including original properties

I am using Fiona to load a set of links. Then I put every record in the rows of a pandas.DataFrame. Then I get the centroid of each LineString using Shapely. Afterwards I copy the schema of the ...
3
votes
2answers
59 views

shapefile record has no attribute named bounds

This is the code that I am using to print the bounds of my shapefile. import fiona import shapely import shapely.geometry fc = fiona.open("filename.shp") shapefile_record = fc.next() shape = ...
3
votes
1answer
161 views

Shapely/ Python looping through a number of polygons

I am trying to loop through a set of polygons in shapely so using python) to determine whether they overlap or not. I do not want to do it manually as later i want to generalise the procedure and do ...
0
votes
0answers
34 views

Adding a Property (attribute) to a geometry in Shapely/Fiona

Once you have line and polygon geometries, intersection using Shapely is very straight forward. What I did after that is to integrate all the looped 'intersected' geometries into a MultiLineString. ...
2
votes
0answers
61 views

Where is my Polygon?

I created this script to merge all of the polygons in a shapefile into a single polygon. I am using Python 2.7.5, Shapely 1.3.0, and Fiona 1.1.5. def merge(path_in, path_out): #Import Libraries ...
2
votes
1answer
44 views

Open a .osm.pbf file with fiona in python

I would like to open a .osm.pbf using fiona in Python. I can't find much documentation on this. How can I does one do this? I have done it using ogr2ogr.
0
votes
2answers
350 views

MultiLineString to separate individual lines using Python with GDAL/OGR, Fiona, Shapely

There are lots of MultiLineString features in a polyline shapefile. The problem is to split these lines into separate individual lines. There is a similar question with PostGIS, but I need to code in ...
1
vote
0answers
20 views

How can I filter a MultiPoint Z / xyz points against a 2d polygon [duplicate]

I would like to filter point data from LIDAR scans (3d) by parcel plot lines (2d). I began with loading the lidar data into microsoft sql and performing a STIntersects between the MultiPoint and the ...
0
votes
1answer
58 views

Change Attirbute Name (Fiona)

I have a shapefile that has 2 attributes named "X" and "Y". I want to change this to "Lon" and "Lat". My (limited) experience tells me that I should read in the original shapefile, preserve the ...
1
vote
1answer
204 views

Writing shapefile with projection defined crashes fiona

I've just started trying to use Fiona to write out shapefiles. I found the example code below, which seems to work fine from shapely.geometry import mapping, Polygon import fiona # Here's an example ...
0
votes
1answer
53 views

Add attributes to an output shapefile schema (via meta)

I am trying to copy the schema of an existing shapefile and add to it in an output shapefile. Somehow I am not getting anywhere with this...though the docs seem very clear (and the download page : ...
0
votes
1answer
251 views

Using Fiona to write a new shapefile from scratch

I am new to Fiona, and trying to wrap my head around reading a csv file and writing out an ESRI shapefile. I have most of it down, but am missing two things; (1) defining the projection/spatial ...
0
votes
1answer
37 views

Fiona error on installation

Receiving the following error when installing Fiona.Does anyone can guide ? error: Unable to find vcvarsall.bat
0
votes
1answer
133 views

Select by attributes within the fiona Python module

Is it possible to select polygons from a shapefile based upon their attributes using the Fiona Python module? I can't seem to find anything in the docs, but it seems like a strange thing not to be ...
2
votes
2answers
239 views

Fiona: get each feature extent (bounds)

I was looking in Fiona to get for each feature its extent but I didn't find how. I have try to far to do something like below import fiona with fiona.open('countries/ne_10m_admin_0_countries.shp', ...
0
votes
1answer
230 views

geopandas error when writing to_file() “ValueError: 'long' is not in list”

I'm having a problem getting the "to_file()" function to work with geopandas import geopandas as gpd f = gpd.read_file('fin.shp') f.to_file('fout.shp') Error Output: ...
0
votes
2answers
158 views

Add joined data in fiona with new schema

Looked more closely at problem on how to add data to a shapefile using fiona. Docs for fiona very unclear on how to do this. I know how to add a schema after that looks very unwieldy and can not ...
0
votes
0answers
13 views

How to create a shapely multipolygon from GADM shapelife? [duplicate]

I am using GADM (http://gadm.org/country) to get shapefiles from administrative areas anywhere in the world (trying with the US at the moment). To read the shapefile I am using Fiona in python. This ...
1
vote
2answers
74 views

Old Windows Installers for python library fiona

Due the the recent bug as presented here for fiona 1.1, i am obliged to use a version of fiona in 1.0.x on windows 8.1. however, i can't find older versions of the installer at here. Are there any ...
2
votes
3answers
195 views

How to get a bbox selection of huge shapefile as GeoJSON?

I have a 4.29 GB Shapefile from which I want to extract features as GeoJSON, defined by a bounding box. This should be as fast as possible, because I want to use it in a web application. My first ...
2
votes
0answers
243 views

Folium GeoJSON Overlay Not Appearing

I am in the midst of a task which involves the clustering of assessment neighborhoods into larger neighborhoods (data link). The goal is build these neighborhoods in a manner consistent with major ...
1
vote
3answers
641 views

How to install Fiona to read Shapefile attributes with OSGeo4W?

I´m developing a plugin in Python and I need to read the shapefile attributes, so I found the Fiona API and dbfpy also but I don't understand how to install these packages because I install the QGIS ...
7
votes
1answer
957 views

Find Nearest Line Segments to Point

Background From a known Point, I require to establish the nearest surrounding "visible perimeter" against a table of MultiLineStrings, as shown on the diagram. I've searched this site with a number ...
0
votes
1answer
301 views

Finding differences between two shapefiles in Python

I'm trying to find out whether there were any border changes between two yearly shapefiles. I've heard a lot of praise for Python's open source GIS tools like Shapely/Fiona, and thought I would try ...
-1
votes
1answer
289 views

Calculating intersection between points and polygon in shapefile

I want accomplish the following using command line python tools only (shapely + fiona) I was wondering if there was a straightforward way for me to do the following: Read in a shapefile (all ...
1
vote
1answer
124 views

Fiona: won't install in Debian7.x-64bits/Python2.7

I need to install Fiona in my Debian7.x-64bits/Python2.7 machine. I already installed GDAL/OGR, pip, virtualenv, and six. I am using Python 2.7 so argparse is also installed. The installation protocol ...
3
votes
1answer
375 views

Fiona - Preffered method for defining a schema

I'm fairly new to the world of python and GIS - so this is definitely a beginner question. I am following Tom Macwrights small guide to Shapely and Fiona, and I noticed that even when opening the ...
0
votes
2answers
411 views

problems with py2exe, shapely and fiona

I have a short python script, called test: import fiona with fiona.open("C:\\Essai_compil", 'r') as l_Obs_shp: for shp in l_Obs_shp: print shp['geometry'] I want to compile with ...
3
votes
2answers
1k views

Creating Shapely MultiPolygons from shape file MultiPolygons

I'm reading a shapefile using Fiona: with fiona.open('data/boroughs/boroughs_n.shp') as source: mpolys = [p for p in source] candidate = polys[0]['geometry'] this gives me a dict containing a ...
2
votes
2answers
562 views

Fiona ImportError: DLL load failed

I've been using the great Shapely/Fiona combo successfully on Linux, but now i need to create a kind of production environment on windows and theres only one problem. When i try to import fiona, i get ...
3
votes
1answer
260 views

Is there an online reference available for the Fiona and Shapely libraries?

Is there an online reference available for the Fiona and Shapely libraries? I'm thinking a real reference, beside the tutorial-style documentation: http://toblerity.github.io/shapely/manual.html ...
1
vote
1answer
2k views

Find and replace unicode character in a shapefile

I've found several example of script and blog posts on working with unicode characters, but I haven't been able to make anything works so far... It's a little frustrating I have a shapefile encoded ...
4
votes
1answer
1k views

better way to duplicate a layer using ogr in python?

I'm splitting a large shapefile into many smaller ones using ogr. I'd like to just copy all of the field and layer config information from the original. Here's how I'm doing it now: src = ...
6
votes
2answers
908 views

Error getting text attributes from shapefile with python / pyshp

I have a shapefile, containing only points in XY-coordinates and a string attribute for each point. I would like to read the coordinates and the attribute for postprocessing in python, but can't get ...
7
votes
2answers
3k views

Generating GeoJSON with Python

Hi I want to programatically create a GeoJSON file using polygons from a shapefile but adding attributes from my own application. This is easily done for a shapefile: def ...
23
votes
9answers
2k views

How to easily shift all features in a vector dataset?

Let's say that I put together a Shapefile and all the features have their vertices shifted by a constant amount. What's the easiest way of shifting all the features (hence the (x,y) position of their ...
5
votes
2answers
925 views

Python: How to export Shapely objects to DXF file

Using shapely package for Python how to export the resulting shapely objects such as buffer to a DXF file?
8
votes
4answers
1k views

Is there a mapping between OGR and python data types?

I'm writing a shapefile using OGR in python, creating fields on-the-fly from a python data source. Creation of a new field requires an OGR data type, is there a mapping between OGR and python data ...