Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Text from floating point data rounding error #998

Closed

Description

@kristfal

Hello,

we're seeing some issues with text rendering in the iOS client. See screenshot bellow of iOS:

ios simulator screen shot 13 mar 2015 09 24 16

the same place in the js-client:

screenshot 2015-03-13 09 29 22

The depth soundings are fetched from the tile data with "text-field": "{}". The data is initially is from a single precision float column in a postgis db. The data is rounded to one decimal in the database using round(field::numeric, 1). The JS client handles this as expected, but the native iOS client does not.

Also, the text has some overflow issues, where it bleeds as illustrated on the picture. This only happens when these floating point issues are onscreen.

Let me know if you need more info.

Activity

  1. changed the title [-]iOS text from floating point data rounding issue[/-] [+]iOS: Text from floating point data rounding error[/+] on Mar 13, 2015
  2. kristfal commented on Mar 13, 2015

    @kristfal
    Author

    Bit more info on the font bleed issue:

    Not only does the font "bleed" but characters may be randomly changed as well:

    ios_simulator_screen_shot_13_mar_2015_10 59 04

    The font rendering only overflows at high zoom levels, and the threshold corresponds to the zoom levels where the depth soundings (which has the rounding issues) are present. Zooming to lower levels alleviates the issue.

  3. kkaefer commented on Mar 13, 2015

    @kkaefer
    Member

    This looks like an issue of #957 for which we have a pull request open in #995

  4. kristfal commented on Mar 13, 2015

    @kristfal
    Author

    @kkaefer: Great, I'll let you know and close it if that solves this issue.

    But do you still think it will fix the rounding value issue, or is it separate?

  5. friedbunny commented on Mar 14, 2015

    @friedbunny
    Contributor

    Unrelated, but those dashed lines look distorted and too thick on iOS. The red ones particularly. Is that stock OSM, @kristfal? If you can share the location, I'd like to poke around a bit with those lines (and maybe see about the odd rounding).

  6. kristfal commented on Mar 14, 2015

    @kristfal
    Author

    @friedbunny It's not stock, all custom data. I can give you access and run you through our findings in detail if you'd like. Here is the overview:

    Dashed lines took a hit on both iOS and js when style spec 7 rolled out. It was much more consistent before that. Right now, we're seeing quite different things in Chrome, Safari and on iOS.

    Iirc, the best way of spotting this is to do line-cap round, line-width 5+, and a dash of 2,2 maybe 3,6 or thereabouts.

    In addition, there are pretty large rendering errors in Safari at high zoom with small dashed values.

    Didn't know how finished the cross-platform implementation was, and we worked around the issue by finding values that was ok across all clients, so haven't posted an issue on it. Let me know how you want it reported and I'll put something up on Monday when I have my work equipment at hand.

  7. friedbunny commented on Mar 14, 2015

    @friedbunny
    Contributor

    @kristfal I can't speak for the Mapbox folks (who are quite busy!), but personally it'd be worthwhile to see what's happening with the dashes. This may be related to #779 or #780, both of which came around the time of the v7 styles.

  8. ljbade commented on Mar 17, 2015

    @ljbade
    Contributor

    Hmm @ansis might be familiar with the line rendering changes in v7.

  9. incanus commented on Apr 25, 2015

    @incanus
    Contributor

    @kristfal How does your style fare in recent versions of master? Is this still an issue?

  10. kristfal commented on Apr 25, 2015

    @kristfal
    Author

    @incanus: with regards to rounding of float numbers or dashed lines (or both)?

  11. incanus commented on Apr 25, 2015

    @incanus
    Contributor

    Both, though if it still exists, we should separate the dashed lines issue into a separate ticket to track.

  12. kristfal commented on Apr 30, 2015

    @kristfal
    Author

    @incanus:

    Floating point rounding is still present in Master from yesterday. I can't find any issues with dashed lines any more – native and gl looks pretty similar, if not identical.

    EDIT: Our (temoprary) workaround for the floating point issue was to change PostGIS column type to string instead of float.

    -native floating point issue:

    ios simulator screen shot 30 apr 2015 11 59 40

    -js V0.7 on iPhone6:

    img_1107

    -native Master of yesterday on iPhone6:

    img_1108

  13. changed the title [-]iOS: Text from floating point data rounding error[/-] [+]Text from floating point data rounding error[/+] on Jan 15, 2016
  14. friedbunny commented on Jan 15, 2016

    @friedbunny
    Contributor

    Looks like I took this ticket off course ages ago, but the core floating point rounding error for labels still exists.

    I suspect the issue is coming from our use of boost::lexical_cast() in util::toString(), initiated here in SymbolBucket::parseFeatures().

    @ansis perhaps you have time to look at this? Let me know in chat and I can provide a style+dataset that reproduces the issue.

  15. self-assigned this
    on May 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions