[Tilesathome] New preprocessor - area center

Jiri Klement jiri.klement at gmail.com
Sat Sep 6 19:16:09 BST 2008


Hi,

I've made a new preprocessor - area center calculator. It iterates
though all ways, find good position to place an icon or text and save
it to tags 'osmarender:areaCenterLat/Lon'.

Both osmarender and or/p will profit from it. Osmarender will be much
faster and or/p use only bbox center for placing icons, which has bad
results on some kinds of polygons.

The areaCenter prepocessor use different strategy for (almost) convex
polygons and for general polygons. Area center for (almost) convex
polygon is simply it's centroid, area center for general polygon is
calculated using bobcare's algorithm. Almost convex polygon means
polygon which area is at least 80% of it's convex envelope.

It's written in Java as osmosis plugin. I don't know how many people
have Java available, anyway osmarender and orp can calculate area
center by themself so people without Java can still use t at h.

You can see results for areaCenter preprocessor, osmarender area
center algorithm and orp area center algorithm here:
http://jttt.110mb.com/areacenter.svg
http://jttt.110mb.com/osmarender.svg
http://jttt.110mb.com/orp.svg
Image for osmarender is smaller because osmarender was taking too long
to render big image.

It's not in svn yet, you can download osmosis with areacenter plugin
included here:
http://jttt.110mb.com/areacenter.zip
Usage
./osmosis -p org.tah.areaCenter.AreaCenterPlugin  --read-xml input.osm
--area-center --write-xml output.osm

Do you think I should make area center preprocessor default (and force
people to install Java or disable it in their tilesAtHom.conf)?

--
Jiri




More information about the Tilesathome mailing list