Pyshp is a pure Python shapefile library which can be used to read, write and edit ESRI shapefiles.

learn more… | top users | synonyms

1
vote
1answer
32 views

Import shapefile is not working in pyshp?

I am just trying to use "pyshp" package to open shapefile in Python and use the Attribute data for further development. Firstly I have downloaded pyshp package for python 2.7 and installed it in my ...
0
votes
1answer
33 views

Dynamically cutting shapefiles based on an eliptical or polygonal form

I have been trying to cut a shapefile in small parts in order to reduce the processing of the graph created based on that map. I did find the ogr2ogr clipsrc option however, as far as i know, that one ...
1
vote
2answers
75 views

csv to shp python and formating a row

I´m doing a script to convert csv to shp, but I want to format one of the columns. It´s a string then I´d like to format like this a[8:10]+' / '+a[11:16]+' UTC' being a the value in the column. ...
1
vote
1answer
67 views

Using pyshp to merge two shapefiles

I am trying to find a fast way to merge two shapefiles and i ran over pyshp which apparently could do the job. However looks like this is not working for me because i receive the following error ...
0
votes
1answer
64 views

Howto create complex polygon with pyshp

using the pyshp library (https://code.google.com/p/pyshp/) I am trying to create a "complex" polgon with one hole inside the main-poly plus one island-poly. It should look like this: I used the ...
1
vote
1answer
65 views

pyshp problem with naturalearthdata-shapefile

trying to follow this example: https://code.google.com/p/pyshp/wiki/ShapeRecords entering the following code: import shapefile r = shapefile.Reader("ne_110m_admin_0_countries") sr = r.shapeRecords() ...
1
vote
3answers
508 views

Python: How to create a Polygon Shapefile from a list of X,Y coordinates?

I have a list of X,Y coordinates from a csv file, that represent a polygon. I´m trying to create a Polygon-Shapefile from this list. I´ve been trying around and found a possbility to write the list to ...
0
votes
1answer
74 views

Pyshp Editor error

Following my predecessors (here and here) I am trying to append new data to shapefile using Pyshp. The specifics of my problem is the need to save the file with the same name (without creating a new ...
1
vote
2answers
150 views

Extract a record by name in pyshp?

I would like to extract a named subset of the text records from a shapefile using Python/pyshp. Is there a clean/efficient way to do this? Ideally I'd like to use dictionary-like access such as: ...
1
vote
1answer
128 views

PyShp 1.2 creating Polyline from GML

I have a problem in creating some polylines in one Shapefile with PyShape. The plan is to read a GML file containing LineStrings and create a shapefile. The theory is clear, but the realworld is ...
0
votes
1answer
159 views

Appending using PyShp

I am looking to do a simple append using Pyshp and keep running into walls. The editor object could not read the dbf header for the input shapefile so I tried using reader and writer as suggested but ...
1
vote
0answers
209 views

Pyshp 1.2 example from documentation fails

I must be doing something really stupid because I am trying to run an example straight from the PyShp (shapefile.py) 1.2 documentation with the only change being the input shapefile and it is failing. ...
0
votes
0answers
66 views

Pyshp + Mapserver: How to add label at specified coordinate?

EDIT: solved, went for the solution as described below I have a set of polygons defined in a xml file. I create a shapefile with Pyshp. This works fine. But now i want to add labels to the ...
0
votes
3answers
2k views

Using the python shape library: pyshp - how to convert polygons in .csv file to .shp

I'm converting csv data to shapefiles using the pyshp python library. What I want to do is very similar to Using the python shape library: pyshp - how to convert .csv file to .shp, except that I ...
1
vote
1answer
162 views

How to get Quantum GIS display a line or polygon feature created by Python package pyshp

I am not sure if I have discovered a regression, or if I have not enough sleep. While I manage to create shapefiles with point geometries with pyshp, line and polygon features don't show up in QGIS. ...
1
vote
1answer
141 views

How to add attributes to shapefile with Python and pyshp?

I'm using pyshp for creating a shapefile. I need to populate tens of fields with values using the record() method of shapefile.Writer. I have those values as a list, but have no idea how to send it to ...
3
votes
3answers
732 views

Updating Attributes using Pyshp

Is it possible to update an attribute field in a shapefile using pyshp ? I went through their documentation and all they show is how to create new attribute rather than editing or updating an already ...
6
votes
2answers
818 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 ...
2
votes
2answers
499 views

Problems converting CSV to Shapefile using pyshp

I have a python script which converts csv data to shapefiles. It converts but won't get angle from csv. Can anyone help me? The CSV data looks like this: fid_nr;x;y;angle ...
5
votes
1answer
115 views

Where do I append point values with pyshp?

I would like to generate a .shp with five points using shapefile available through pyshp. However, when I loop through my list I get only the last value. This makes sense as I did not append any of ...
1
vote
1answer
155 views

How to construct a line from points in pyshp?

I am reading a shapefile for a pipeline and what I've noticed is that if I just draw a line from one point to the next (in the order I read them), there will be points where the line terminates, and ...
6
votes
1answer
3k views

Using the python shape library: pyshp - how to convert .csv file to .shp

I am trying to understand how I can use the csv module in python to open a csv file in the same folder as the python script, and then create a shapefile using the shapefile module pyshp. The csv file ...