[OSM-dev] Additions to Osmosis

Karl Newman siliconfiend at gmail.com
Mon Nov 5 18:27:50 GMT 2007


Brett, Dev:

I'm considering a few additions to Osmosis but I wanted to propose
them here first before I started working on them in case anyone had
any objections and/or guidance.

1. Add support for propagating the "bounds" element through the
pipeline. Most tasks would ignore it and pass it on, but certain tasks
(area filter, merge, etc.) would modify it. Probably the only consumer
for it (at this point) would be the write-xml task. The "bounds"
element is a sibling of node, way and relation in the osm XML. The
easy way to do it would be to include it as another entity type and
expand the EntityContainer/EntityProcessor framework, but that's
probably not strictly correct because "bounds" is not really an
entity. Alternative suggestions welcome (or if there's a good reason
not to do this at all, I'd like to know, too).

2. Add support for area filters which cross the 180th meridian
(Opposite of prime meridian; is that the subprime meridian?) Bounding
box is easy--just see if left > right, create 2 boxes which join at
+/- 180 degrees, and test both for node inclusion. Polygon is
substantially more complex--could be any number of sub-polygons which
join at +/- 180, depending how complex and "snaky" the polygon is
(i.e., how many times it crosses the 180th). One implicit assumption
here is that OSM coordinates will be in unprojected decimal degrees
(presumably WGS84). I don't know if that's a problem, but it does
impose a restriction that wasn't (strictly) present before.

3. This is a big one: Add a filter to match against a rules file
similar to the Osmarender rules (with probably a slight extension to
the syntax). Entities which match are passed on, otherwise dropped. I
want to have something like this for developing my Garmin GPSr
auto-routing map creator, and I thought it would be generally useful
as a library. In theory, you could use the same file for Osmosis (to
create a trimmed data set) and then for Osmarender or other target
app. Osmosis would just match against the "rule" elements and ignore
the "actions" (line, area, text, etc.) which Osmarender uses. I'm not
aware of anything written in Java to do this, but if anyone knows of
anything, please let me know. This one will take me a while, and I'll
probably need help from some expert Java architects to get it right.

I welcome your comments.

Sincerely,

Karl Newman




More information about the dev mailing list