GRASS seems to have some kind of Voronoi algorithm, but I find its interface 
very non-intuitive, so have not found it to try it out. This may be worth 
pursuing as an alternative route.

As an aside: I notice that virtually all postcode boundaries are obviously 
created in this way. For instance the Philips Street Atlas shows totally 
implausible boundaries along the River Trent in S. Notts. Given that postcode 
boundaries are ultimately determined by logistically sensible walks for 
postmen, in this case it's pretty safe to assume that the boundary is actually 
the river. What this means is that by applying a bit of local knowledge and the 
existing points it is possible to create better delineating zones in OSM than 
appear in current mapping. Whether this is a good thing to do, or not, I leave 
for others to decide.




________________________________
From: Kev js1982 <o...@kevswindells.eu>
To: OSM - Talk GB <talk-gb@openstreetmap.org>
Sent: Mon, 26 April, 2010 12:24:26
Subject: Re: [Talk-GB] Postcodes to Shapefile


On Mon, Apr 26, 2010 at 12:00 PM, Kev js1982 <o...@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
make
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
    voronoi(siteList,context)
  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 


      
_______________________________________________
Talk-GB mailing list
Talk-GB@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-gb

Reply via email to