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 (0xc0000005) 'Access violation'.

I am using:

fiona==1.4.8', 'gdal==1.11.1','pyproj==1.9.3','shapely==1.4.4', 'six==1.8.0'

I tried re-installing gdal but that didnt help.

here is the piece of code that I am using:

from pyproj import Proj, transform
import fiona
import fiona.crs
from fiona.crs import from_epsg
import copy

shape = fiona.open("Sample.shp")
original = Proj(shape.crs) # EPSG:4326 in your case
destination = Proj('+proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +no_defs')
with fiona.open('new.shp', 'w', crs=from_epsg(4269), driver = 'ESRI Shapefile', schema = shape.schema.copy()) as output:
for feat in shape: # feat = one polygon of the shapefile
    tempGeometry = feat['geometry']
    out_linearRing = [] 
    for point in feat['geometry']['coordinates'][0]: # LinearRing of the Polygon
         long,lat =  point  # one point of the LinearRing
         x,y = transform(original, destination,long,lat) # transform the point
         out_linearRing.append((x,y)) # add all the points to the new LinearRing
         # transform the resulting LinearRing to  a Polygon and write it
feat['geometry']['coordinates'] = [out_linearRing]
  • 1
    In the absence of any code, all I can say is "read the manual." If you want more help than that, you'll have to show your program's code. There's nothing to go on here. – sgillies Nov 11 '14 at 5:00
  • Not just the code, but the offending shapefile. – John Powell Nov 11 '14 at 6:11
  • @sgillies Here is the code. – statBeginner Nov 11 '14 at 7:26
  • @JohnBarça : How should i post the shp file? The destination(new file that I want to create) shp file's contents? – statBeginner Nov 11 '14 at 7:27
  • No, the input file. github, dropbox, etc. On what line does it crash? – John Powell Nov 11 '14 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.