0

I have a dataset (OS CodePoint Open) which contains a latitude and longitude for every postcode in the UK, but no shapefile information on the postcode itself. (I know I can buy a the shapefiles from OS, but would prefer not to).

So essentially I have a point-cloud. Is there an alogorithm (or, ideally some Python code) which would allow me to generate polygons for each of the points? I'm sure there must be, but not knowing what search terms to use is leaving me a bit stumped. I know they wouldn't be as accurate as the real shapefile data from OS, but for the purposes of choropleths they would be fine.

asked Mar 5, 2017 at 20:10
2
  • 1
    What you have is not a 'point cloud' it's just a bunch of points. And you will not be able to reproduce postcode boundaries from points. Commented Mar 5, 2017 at 20:58
  • How are you going to reconstruct the boundaries from the point data? Are there attributes with the point data that contain polygon boundaries? Commented Mar 5, 2017 at 21:41

2 Answers 2

4

What I need are Voronoi diagrams, and there is a function in the scipy library to generate them.

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
answered Mar 5, 2017 at 20:21
2
  • 2
    Keep in mind that you have "arbitrary" polygons that do not resemble real "on the ground" postcode boundaries. Commented Mar 5, 2017 at 20:52
  • 1
    @til_b Thanks for the steer. But in this case I (suspect I) just need an approximation of the PostCode boundaries in order to produce cholopleth maps of various information which is keyed by postcode (in this case broadband availability). Commented Mar 6, 2017 at 7:33
2

If your point data is in a .csv file, you can simply import that into QGIS - using the delimited text wizard. From that layer you create the voronoi diagram from the Vector menu. But, as @til_b says, that will only generate random polygons, not polygons that represent the geography of the actual postcodes. I needed a set of postcode data for a project at work where, initially I used the geography of the postcode to create thematic maps. I discovered that I could make better maps with point data for each town. Perhaps you also don't need the polygons?

answered Mar 5, 2017 at 21:15
1
  • I'm intedinng (if possible) to produce a choropleth of the UK showing broadband coverage. The broadband data I have is on a postcode basis. So (AFAIK) the Polygons don't need to be exact. Commented Mar 6, 2017 at 7:31

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.