[Tilesathome] Osmosis Questions

Brett Henderson brett at bretth.com
Thu Nov 22 02:09:16 GMT 2007


Have to run to a meeting and will be out for the rest of the day but 
these are my initial thoughts.

Brent Easton wrote:
> Hi Brett,
>
> I started to write a new program to split up t at h .osm files. Fortunately, I checked out Osmosis before I got too far. It does most of what I want.
>
> The resource problem in t at h is being caused by the large size of the Z16 and Z17 svg files.  What I want to try is to use Osmosis with the bounding box option to cut the .osm file into strips and then create smaller svg files. For Z >12, the SVG files are processed strip by strip anyway. This should (theoretically) completely solve the current problems with unrenderable tiles.
>
> The only problem I can forsee is with ways that will cross one of the stripes without having a node within the stripe. I checked the source and AFAICS, Osmosis only include ways that have a node within the bounding box. It looks to me like it would be a pretty simple to change to AreaFilter and BoundingBoxFilter also include ways that cross the bounding box. Perhaps this feature should be turned on with an additional parameter?
>   
You're right, it only includes ways with nodes inside the box.

Changes are usually limited to AreaFilter.  BoundingBoxFilter and 
PolygonFilter (I think that's the name of the class) sub-class it purely 
to determine if a node is within the box.  This case might be different 
though requiring some further processing at the way level.

Could be wrong but I think the change will be more complicated.  Osmosis 
is "streamy" which means that by the time ways reach the AreaFilter task 
all node information has been lost (written to the destination or 
discarded), the only thing osmosis keeps in memory is the ids of the 
selected nodes.  Due to this, if a way segment crosses the box you'll 
have no way of checking because you'll have lost the node coordinates.

Given that t at h boxes aren't huge it might be feasible to store all data 
in memory which would allow you to do this kind of operation.  It is 
worth considering implementing this as a new task to avoid making the 
AreaFilter more complicated than it already is.

Happy to discuss further though.

Cheers,
Brett





More information about the Tilesathome mailing list