[osmosis-dev] [RFE] Add bounding shape to OSM dumps

WanMil wmgcnfg at web.de
Thu Jan 21 18:17:37 GMT 2010


> Hi,
>
> Apollinaris Schoell wrote:
>> osmosis supports 2 options to keep ways and relations intact. but
>> geofabrik extracts don't use it as far as I know. completeWays
>> completeRelations
>
> That is correct: These options exist, and are not used, because if we'd
> use them, the nightly build would take something like three days instead
> of six hours. Osmosis works very well in streaming mode and these
> options make it impossible to stream - Osmosis needs to create a
> temporary copy of the full dataset and is rather inefficient at it.
>
> We typically do something like
>
> osmosis --rx file.osm --tee 20 --bp file=country1.poly --wx country1.osm
> --bp file=country2.poly --wx country2.osm...
>
> which would causes Osmosis to make 20 temporary full copies of the data
> and write them to disk in "completeWays" mode.
>
> We use "clipIncompleteEntities" which means that Osmosis removes
> references to those nodes outside the polygon from any ways or relations.
>
> It would be good if Osmosis could somehow flag the clipped entities so
> that processing software could at least know that there is something
> wrong, or incomplete, with them.
>
> Adding the actual polygon used for clipping could of course be done but
> it will not automatically enable proper filling. Assume this:
>
> |
> +-|----+-----+
> | | |
> | | |<--- filled area
> +-|----+-----+
> |
> |<-- clipping boundary
>
> After clipping with clipIncompleteEntities, this will lead to
>
> |
> | +-----+
> | | |
> | | |
> | +-----+
> |
> |
>
> Even if you know where the clipping boundary is, you cannot extend the
> object towards that boundary properly because you are missing the nodes
> beyond the boundary.
>
> Bye
> Frederik
>

Ok, we cannot reconstruct the 100% exact original shape if the first 
node outside the boundary is missing. But a reasonable workaround is to 
connect directly to the boundary in case there are nodes missing in a 
polygon and the last point is not too far away from the boundary. I 
think in most cases this will be ok.

This is not the 100% solution and it would be better if ways and 
relations are added completely or at least the first point beyond 
boundary should be clear. But as long as this is too time-consuming the 
proposed solution to add the boundary to the OSM dump is an easy to 
realize and very helpful improvement. Flagging of clipped ways is 
another good and helpful improvement.

WanMil






More information about the osmosis-dev mailing list