Skip to content
This repository has been archived by the owner on Apr 27, 2024. It is now read-only.

Vtm- error plotting lines #149

Open
Bezzu opened this issue Apr 21, 2015 · 1 comment
Open

Vtm- error plotting lines #149

Bezzu opened this issue Apr 21, 2015 · 1 comment

Comments

@Bezzu
Copy link

Bezzu commented Apr 21, 2015

Hi,
my application must display some lines from a map file. I load the lines data using the MapDatabase class and add these lines to the map using a VectorTileLayer. The lines plotted are not precise, in fact two parallel lines are shown oblique.
This problem is caused when the application reads the line points from the map file and stores them in the GeometryBuffer. The line point coordinates (longitude and latitude) are stored in the map file in unsigned int that is the value in microdegrees. When the application collects these coordinates, it stores them in the GeometryBuffer points variable, that is a float array. Converting the unsigned Int coordinates collected to float some points lose significant digit, causing errors of about 40 cm in the points plotting.
This problem is not present in the mapsforge that stores the points in a double variable.
So I tried to solve this issue declaring the GeometryBuffer points variable as an array of double and adapting the code to this change. I have resolve this issue but the application reacts slower and has an other problem plotting dashed lines.
Has someone already encountered this problem?
Can someone help me?
Is there a smarter way to solve this issue?

Thanks in advance.

@cescorlo89
Copy link

Hi,
I have the same problem, the java Floating variable doesn't have enough digits to represent the mantissa. In fact, the casting of an unsigned int in a float causes the loss of the last significant digits. Has someone an idea to increase the mantissa of a java float?...Is there a smart solution to avoid this casting issue in the vtm?

Thanks in advance.

hjanetzek pushed a commit to hjanetzek/vtm that referenced this issue Nov 18, 2018
hjanetzek pushed a commit to hjanetzek/vtm that referenced this issue Nov 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants