[OSM-dev] DBF files (shapefile) and OSM tags
Kristian Thy
thy at 42.dk
Fri Dec 29 23:40:49 GMT 2006
On Fri, Dec 29, Nick Whitelegg wrote:
> Am now working on an OSM to shapefile converter. Using shapelib, shapefiles
> seem fairly straightforward but the accompanying .dbf file is a little more
> unclear. The general idea seems to be to describe attributes in a database
> table-like structure, with each column representing a different attribute.
Strictly speaking, a "shapefile" is a data entity consisting of three
separate files: A .shp, a .dbf and a .shx file.
> The only thing is, with the free-form nature of OSM attributes, the number of
> columns required in the .dbf table would quickly spiral considerably
> particularly for nodes (less for ways, as for ways there are only a number of
> common tags e.g. highway). So might it be better to concatenate the key/values
> as a comma separated list (e.g
> amenity=place_of_worship,denomination=anglican,name=St Pauls Church) and put
> that in one DBF column?
The columns in a shapefile's attributes have a fixed width, and that
width is reserved for each shape. So the space usage will be
approximately equal between using a single, concatenated column and
multiple columns.
What did you intend to gain by concatenating the columns?
\\kristian
--
Cthulhu.call();
More information about the dev
mailing list