Here is a quick confirmation that you can use Python to draw very detailed maps; using the previously specified method I was unable to get python to draw all UK OAs due to their great number (c.220,000) and high complexity (c.50,000,000) vertices. Additionally I was unable to use the generalised OA boundaries for the UK from UKBorders as they contain topological errors that the shapefile reader cannot deal with. ArcGIS is obviously a bit clever in how it handles bad topologies. So I extracted all the vertices and fed them into shapely polygons, and visualised them in the same way, but without reading shapefiles directly into python and was able to output this:
This method has had an impact on the speed of computation as it can take roughly 25 minutes to output this map. The map looks pretty good, aside from a slightly odd polygon in the Bristol channel. Nevertheless, coupled with the operations that shapely, and other geo-libraries, can do this si increasing indication of the maturity of GIS in a variety of platforms. Oh, and it’s all free!
June 3rd, 2010
by Sean Gillies
Dan, this is great stuff. I appreciate that you’re trying Shapely, but I think you can probably save time (extra data copying) by cutting it out of the process. Use GeoJSON-like dicts instead
{“type”: “Polygon”, “coordinates”: [[[0, 0], …]]}
In fact, descartes asks Shapely to render geometric objects into this form, so the actual Shapely instances are unnecessary unless you’re doing some other analysis.
I’ve heard a rumor that objects in the new ArcPy (10) provide the same interface and you’ll be able to pass them straight to descartes.
June 3rd, 2010
by Dan
The Author
Thanks for the advice Sean, I’ll have to look into GeoJSON, I’ve always associated it with webmapping applications, and as a result never really invested time in it. It’ll be interesting to see what ArcGIS 10 does, part of the reason I was looking into python was to output a lot of maps for a dataset for exploratory purposes, looking at different variables and classifications; this was something that didn’t seem possible in ArcGIS 9.x, so it will be interesting to see whether such functionality will turn up in ArcGIS 10. We’ve played with a beta of ArcGIS Desktop 9.4 (which became 10) at UCL, I can’t confirm the objects rumour though, if it is true it will make exploratory mapping of large datasets a snap!
June 3rd, 2010
by Dan
Just tried the GeoJSON method – cuts the computation time by a factor of 3, cheers!