-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing value of the tag #4
Comments
Hi, no problem, creating an issue is fine for this purpose. The interfaces are designed for read access only and are not mutable. You can create a copy of the entity your dealing with and pass that on to the consumer of your data after changing whatever you need to change. You can look at https://github.com/topobyte/osm4j/blob/master/core/core/src/main/java/de/topobyte/osm4j/core/model/util/ImplUtil.java for some inspiration. Depending on what it is you're doing, you can potentially use one of the methods provided there and then work with the implementation-specific subclass of https://github.com/topobyte/osm4j/blob/master/core/core/src/main/java/de/topobyte/osm4j/core/model/impl/Entity.java which allows you to get the tags as a list. Then you should be able to remove or replace some of the tags. |
Thank you for your quick response - I managed to do tag manipulation :) May I suggest to make example how tag manipulation could be done for other potential users. |
yes, good idea. May I ask what your use case is? Maybe it can be inspiration for an example... |
Uh, it is very complicate to explain... ps. Is your library able to load the poly files and check if some point is in the polygon? |
I have the same task. Use case: augmenting pbf files with some custom extra tags before importing this pbf into graphhopper. |
Sorry, I understand that this is not an issue but I need some help.
Is it possible to change the value of the tag in the entity during iterating? I would like to redefine tag name but I couldn't find the way to do it. If it is not possible, is it possible to get the raw data for the entity?
The text was updated successfully, but these errors were encountered: