[Talk-GB] Postcodes to Shapefile

Kev js1982 osm at kevswindells.eu
Mon Apr 26 13:24:26 BST 2010

On Mon, Apr 26, 2010 at 12:00 PM, Kev js1982 <osm at kevswindells.eu> wrote:

> I am currently trying to create a series of shapefiles from postcodes
> (using OS Open Geo Data) using the code from "Random Junk" (
> http://random.dev.openstreetmap.org/postcodes/#) running on Ubuntu 9.10
> but I can't get it working.
> lots of blah blah about what I did...

Think i've sussed most of it...

I zapped my pyshapelib folder and downloaded both it and shapelib again

With the shapelib and pyshapelib tar gzs inside my osm folder I then issued
the following commands

tar -xvzf shapelib-1.2.10.tar.gz
mv shapelib-1.2.10 shapelib
tar -xvzf pyshapelib-0.3.tar.gz
mv pyshapelib-0.3 shapelib/pyshapelib/
cd shapelib
cd pyshapelib
python setup.py build
sudo python setup.py install
cd ../../
# The next line is really important if you want python to think this folder
has python scripts
touch shapelib/__init__.py
cp shapelib/pyshapelib/* shapelib/

This seamed to get over the original problem

Then you need to ensure you input file has no trailing lines

And now to work out why I'm getting

Traceback (most recent call last):
  File "makeShapeColoured.py", line 349, in <module>
    result = voronoi.computeVoronoiDiagram(pts)
  File "/home/kev/osm/voronoi.py", line 746, in computeVoronoiDiagram
  File "/home/kev/osm/voronoi.py", line 206, in voronoi
    edge = Edge.bisect(bot,newsite)
  File "/home/kev/osm/voronoi.py", line 404, in bisect
    newedge.a = dx/dy
ZeroDivisionError: float division
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk-gb/attachments/20100426/3e1d6ded/attachment-0001.html>

More information about the Talk-GB mailing list