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

Mapsforge maps v5: variable tag values #1006

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@Gustl22
Contributor

Gustl22 commented Oct 15, 2017

With this modification, all OSM-tag values (such as numerical and string values) can be saved in mapsforge .map format without specify a fixed value term in tag-mapping.xml.
For that the wildcards "%f" (float) for numerical and "%s" for string values can be used. Internally the values are cast to the smallest possible type (like Byte: %b, Short: %h, Int: %i). Using %s wildcard is not recommended, better use ready osm-tags. Colors can internally be converted to int values with %f wildcard.

The map-writer can be used for older versions too, if tag-values are disabled. If not, new specification doesn't allow older readers to read new one. New Readers won't have a problem to read them all. The tag-value bit in file header is not needed, but I set it, because I can't decide if assumes a role for later versions.

The writing performance keeps very similar. I inherited some S3DB-tags, (especially height tag) and the map file size only increases around 0,24% in my case.

Why is it useful?
Until now, no additional data could be stored (apart from concrete feature tags, like the house number).
Now heights, colors, angles and much more can be inherited, with marginal overhead.
This is not meant to include concrete style elements. E.g. colors and materials are only an assistance for later rendering.

Let me know what you think of ;D

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Oct 16, 2017

Collaborator

Thanks, will check it!

Apparently would need relevant changes in VTM reader too.

Collaborator

devemux86 commented Oct 16, 2017

Thanks, will check it!

Apparently would need relevant changes in VTM reader too.

@Gustl22

This comment has been minimized.

Show comment
Hide comment
@Gustl22

Gustl22 Oct 16, 2017

Contributor
  • ok. I'll try to fix it.
  • An implementation for VTM reader is already finished, if this is considered as good approach.
Contributor

Gustl22 commented Oct 16, 2017

  • ok. I'll try to fix it.
  • An implementation for VTM reader is already finished, if this is considered as good approach.

@Gustl22 Gustl22 closed this Oct 16, 2017

@Gustl22 Gustl22 reopened this Oct 16, 2017

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Oct 16, 2017

Collaborator

ok. I'll try to fix it.

Sorry for the confusion, had opened wrong map file, the sea is rendered fine. 🙂

An implementation for VTM reader is already finished, if this is considered as good approach.

If you have it ready, can post a PR in order to check them in parallel, as Mapsforge cannot render extrusions and would be interesting to see how VTM plays with v5 maps.

Collaborator

devemux86 commented Oct 16, 2017

ok. I'll try to fix it.

Sorry for the confusion, had opened wrong map file, the sea is rendered fine. 🙂

An implementation for VTM reader is already finished, if this is considered as good approach.

If you have it ready, can post a PR in order to check them in parallel, as Mapsforge cannot render extrusions and would be interesting to see how VTM plays with v5 maps.

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Oct 17, 2017

Collaborator

Thanks, as usual very nice & clean work! 👍

Merged via 7a9b1ca.

New tag-values map-writer option has sane default false to allow users explicitly activate v5 maps and not break compatibility with existing apps.

Collaborator

devemux86 commented Oct 17, 2017

Thanks, as usual very nice & clean work! 👍

Merged via 7a9b1ca.

New tag-values map-writer option has sane default false to allow users explicitly activate v5 maps and not break compatibility with existing apps.

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Oct 17, 2017

Collaborator

BTW I left out the tag values bit in file header, map version is written anyway for any needed checks.

Collaborator

devemux86 commented Oct 17, 2017

BTW I left out the tag values bit in file header, map version is written anyway for any needed checks.

@devemux86 devemux86 changed the title from Mapsforge-map: support alterable osm tag values to Mapsforge maps v5: variable tag values Oct 17, 2017

@Gustl22 Gustl22 deleted the Gustl22:mapsforge-map-writer-alternative branch Oct 17, 2017

devemux86 added a commit that referenced this pull request Mar 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment