[OSM-dev] [Talk-GB] Viability of huge shapefile of LandForm Panorama contours in Mapnik?
grahamjones139 at gmail.com
Sun Mar 6 11:47:14 GMT 2011
This has been on my list of things to do for a while too, but like many of
my project ideas, it didn't get that far!
I do not have any experience of the OS contour files - I coudn't work out
how to convert the dxf's into something more useable by mapnik (I quite
fancied getting them into postgresql like I did with srtm data). I think
the OS height data comes as a DEM as well as a DXF so it should be possible
to process it like SRTM?
I did have a similar issue with rendering the Vector Map District data
though, which comes as lots of shapefiles. I tried it two different ways:
1. Render each shapefile individually using mapnik, by writing a python
script to add a different mapnik layer for each shapefile - this worked fine
for a single grid square (e.g. NZ), but it keeled over when I tried to do it
for the whole UK - ran out of memory I think.
2. Pull the shapefiles into a postgresql database and render it just like
OSM data - lines and points worked fine, but I had trouble with polygons -
lots of errors about invalid geometry. This was a shame because the big
thing I like about VMD is the area data. It looked as though the problem
was areas intersecting themselves, but I never worked out how to fix it - I
suspect that it may be rounding errors and I should have used the shp2pgsql
option to just use integers, but I think I must have got bored before I
tried re-importing the entire database again.
I made some notes as I went along, which you should be able to see
The scripts I wrote and mapnik stylesheets are in a public archive, which
should be referenced in my notes.
I suspect that you will have a similar problem with the contour shapefiles
as I had with the VMD ones, so I would be inclined to go for the database
option, or at least treat that as a contingency plan.
I would like to see this idea working, so if you would like any help, please
let me know.
On 6 March 2011 09:11, Nick Whitelegg <Nick.Whitelegg at solent.ac.uk> wrote:
> Sometime, perhaps over Easter, I'd like to do something I've been meaning
> to do for a while, and that is create "pseudo-Landranger" maps by combining
> OS Vector Map District, contours from OS Landform Panorama, and OSM
> However, to do this I need to transform the contour data from DXF into
> something more usable, e.g. shapefile. Apparently gdal can now do this.
> What I'm a little concerned about, though, is the viability of creating one
> huge shapefile containing all the contours for the UK, which would be
> necessary to prevent the Mapnik XML file getting messy and having huge
> numbers of small shapefile layers. As an alternative I could create separate
> shapefiles for say, Wales, S England, N England and Scotland.
> Is this likely to be feasible.
> Talk-GB mailing list
> Talk-GB at openstreetmap.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the dev