[OSM-dev] osm2psql .style file parameters/values

Sven Geggus lists at fuchsschwanzdomain.de
Tue Jul 10 13:33:32 BST 2012

mick <bareman at tpg.com.au> wrote:

> osm2pgsql does a decent job as far as _I_ can use it, the style file looks
> to me like it should be able to refine things more with different data
> types, eg. boolean, short int, int, long int, float,...

No! In osm2pgsql tags are always assumed to be text which is of course what
they actually are. The "z_order int4" and and "way_area real" are calculated
during import so the do not count.

I did however add support for "real" columns in february in order to be able
to import width and ele tags as floating point values.

This currently involves a lot of hard coded heuristics!

Here is what it do:
* assume "," to be a decimal mark which need to be replaced by "."
* take the leading number if there is more than one or additional text
* average if it's a-b
* assume values to be in meters thus ignore any unit but feet
* convert feet to meters if "ft" is given as unit (1 foot = 0.3048 meters)
* reject anything else



"Remember, democracy never lasts long. It soon wastes itself,
exhausts and murders itself. There never was a democracy yet
that did not commit suicide." (John Quincy Adams)
/me is giggls at ircnet, http://sven.gegg.us/ on the Web

More information about the dev mailing list