Re: Percision of champlain_view_get_coords_at



On Tue, Nov 30, 2010 at 18:28, Quikee <quikee gmail com> wrote:
> On Thu, Nov 25, 2010 at 7:06 PM, Quikee <quikee gmail com> wrote:
>> Hi,
>>
>> I want to put a marker at a position on the map where user clicks for
>> which I use champlain_view_get_coords_at to translate between screen
>> coordinates and lat, lon of a marker. When doing this i noticed that
>> the marker is placed correctly at the center of a map but when you
>> click on either side of the map the marker is misplaced by a margin
>> depending how far you are from the center. I think that there is a
>> rounding error in the calculation somewhere.
>>
>> Another observation I have made is that champlain_view_get_coords_at
>> has x and y parameters as uint. Maybe this should be changed to float
>> - the same as in Clutter. Inside the method the x,y coordinates are
>> then converted to float anyway. The same should apply to
>> champlain_map_source_get_latitude and
>> champlain_map_source_get_longitude and maybe some other functions that
>> use "screen" x and y coordinates. I will try to sweep through the code
>> and search for other such cases and provide patches for this if this
>> changes make sense.
>>
>> regards, Tomaž
>>
>
> Hi,
>
> I investigated more about this and found that get_coords_at is working
> as expected. The problem is elsewhere - probably in marker placement
> code or something like this. I don't know why but setting a marker (in
> my scenario) at a specific coordinate is only accurate at the current
> center of the map.
>
> Regards, Tomaž

Hi Tomaž,

I'm wondering: do you experience this bug at all zoom levels? There
used to be a bug in libchamplain causing gaps between tiles because at
the highest zoom levels the mantissa of float, which is used by
clutter, was not enough to capture the tile position with sufficient
precision. Might be something like that in this case as well.

Would you provide some sample code so it is easier for me to debug
this issue? Creating a bug report and attaching the sample (or link to
a git branch) would be great. I should have more time for libchamplain
now.

Cheers,

Jiri


> _______________________________________________
> libchamplain-list mailing list
> libchamplain-list gnome org
> http://mail.gnome.org/mailman/listinfo/libchamplain-list
>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]