Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Problem with omitmetadata=true in PBF Binary Task and ObjectStore #3510

Open
openstreetmap-trac opened this issue Jul 23, 2021 · 1 comment

Comments

@openstreetmap-trac
Copy link

Reporter: jbr
[Submitted to the original trac issue database at 5.12pm, Friday, 4th February 2011]

Application of the parameter omitmetadata=true in the write-pbf task sets the 'version' attribute of an processed entity to -1. When trying to write such an entity to an !ObjectStore (e.g. !SimpleObjectStore) the version attribute is casted from an integer type to a char in method org.openstreetmap.osmosis.core.util.!IntAsChar.intToChar(). A negative number obviously cannot be casted to a char and so an !OsmosisRuntimeException is thrown.

I could set the version attribute to a valid value prior to storing it in an !ObjectStore. However, that's only possible if the entity is not readonly. Otherwise I have to clone the entity, which is not very memory efficient in an Osmosis pipe with much parallelization (e.g. --tee 20).

The easiest and I guess most reasonable fix to this problem would be to write a '0' instead of '-1' to the version attribute in the --write-pbf task when omitmetadata is enabled.

@openstreetmap-trac
Copy link
Author

Author: brett[at]bretth.com
[Added to the original trac issue at 11.26am, Wednesday, 1st October 2014]

I don't believe the casting to char occurs any more. Most of these storage optimisations were removed due to the issues they caused. I can only find a single use of IntToChar and it's used when storing a tag count (entities shouldn't have more than 65536 tags ... surely).

Please confirm and close the ticket if you're happy with the resolution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant