Menu

#338 Translation between the coordinates selected and the map created

Already_implemented
open
nobody
None
1
2020-03-29
2020-03-25
No

If I make a selection of 1 x 1tile: W = 16601, N = 11706, E = 16601, S = 11706, all is OK.
If I make a selection of 10 tiles x 10 tiles (adding 10 to E and S):
W = 16601, N = 11706, E = 16611, S = 11716.
I get a map 11 x 11 tiles (2816 x 2816 pixel) in place of 10 x 10 (2560 x 2560 pixel).
If I make a selection of 40 x 40 tiles adding 40 to E and E:
W = 16601, N = 11706, E = 16641, S = 11746.
I get a map 41 x 40 tiles (10496 x 10240 pixel) !?

Other note : In the frame « Map source tile store coverage », the word « Layer » has to be replaced with « Map Source ».

Discussion

  • r_x

    r_x - 2020-03-26

    I used the word layer because it is referring to map sources that have multiple layers. If I would name it map source this may be a bit confusing as a map source would then be comprised of other map sources.

    Regarding the selection: Please make sure that the grid mode is disabled. I tried to reproduce your scenario with the +40 selection on zoom level 15, but I always get a map of size 10496x10496 (41x41).

     
  • Marc Delsupexhe

    Marc Delsupexhe - 2020-03-28

    I forgot to say that we are in zoom 15
    The first tile is
    North and South : 11706 / z15
    West and East : 16601

    For 1tile x 1tile:
    MinTile coordinate = TileNr x 256 ->
    W : 16601 x 256 = 4249856
    N : 11706 x 256 = 2996736
    MaxTile coordinate = (TileNr+ WidthInTiles) x 256 - 1
    E : (16601 + 1) x 256 - 1 = 4250111
    S : (11706 + 1) x 256 - 1 = 2996991
    And the result is OK in the item details of the selection.

    For 10tiles x 10tiles:
    I change the values : E = 11601+10= 11611 and S = 11706+10 = 11716
    Validating coordinates hilight the area on the map.
    Min coordinates are the same.
    MaxTile coordinate = (TileNr+ WidthInTiles) x 256 - 1
    E : (16601 + 10) x 256 - 1 = 4252415 (result = 4252671)
    S : (11706 + 10) x 256 - 1 = 2999295 (result = 2999551)
    The above formula not applied and gives a square 11tilesx11tiles (in place of 10x10).
    Display selected area of the map in the atlas to show the difference.

    For 40tiles x 40tiles
    I change the values : E = 11601+40= 11641 and S = 11706+40 = 11746
    Validating coordinates hilight the area on the map.
    Min coordinates are the same.
    MaxTile coordinate = (TileNr+ WidthInTiles) x 256 - 1
    E : (16601 + 40) x 256 - 1 = 4260095 (result = 4260351)
    S : (11706 + 40) x 256 - 1 = 3006975 (result is correct)
    The above formula no longer applies for East and the details of the selection gives a rectangle 41tiles x 40tiles (in place of 40x40).
    Display selected area of the map in the atlas to show the difference.

     
    • r_x

      r_x - 2020-03-29

      In the 1x1 case 1x1 tile is selected. f you extend it horizontally and vertically by 10 why do you expect to get a selection of 10x10? Because if the same rules apply in the first case a 0x0 region would have to be selected.
      Hnece I find it logically that a region of 1x1 extende dby 10 in each dimenstion ends up in a region of 11x11.

       
      • Marc Delsupexhe

        Marc Delsupexhe - 2020-03-29

        Hi,

        You ‘re right, I didn’t explain correctly and I’ll explain the problem by another way.

        Select this tile :

        Nothing is selected on the map !

        Add the selection and click on “Zoom to map bounding box” to highlight the tile.

        Try now to enter this selection :

        Select now a 3 tiles x 3 tiles square with this same tile on the upperleft corner with the mouse to obtain

        Add the selection. The map size is 768 x 768. All is OK.

        Click now on the button « Select entered coordinates » and you’ll see that the selection is reduced to a 2 tiles x 2 tiles square and add the selection.

        The map size is 768 x 768 whicch is the initial size.

        Try now to enter this selection :

        Select now a 3 tiles x 3 tiles square with this same tile on the upperleft corner with the mouse to obtain

        Add the selection. The map size is 768 x 768. All is OK.

        Click now on the button « Select entered coordinates » and you’ll see that the selection is reduced to a 2 tiles x 2 tiles square and add the selection.

        The map size is 768 x 512 !

        I think that the problem comes only when entering coordinates.

        If I want 1x1 tile map, Maxvalues = Minvalue and I get the correct map.

        If you add 1 to East and South, then validate the coordinates, you get the same selection area.

        Select now a 3 tiles x 3 tiles square and you get

        Click now on « Select entered coordinates » and you get a 2 tiles x 2tiles square … ?!

        If I want 10x10 tiles map, i have to add 9 to Maxvalues East = 16610 and South = 11715

        After clicking on “Select entered coordinates”, the area highlighted in pink color is 9x9 tiles however if I enable “Display selected area”, the area highlighted in yellow color is 10x10 tiles.

        But if I select a 10x10 tile square directly on the map, I get the same values in the frame « Selection Coordinates » !

        Now to get a 40x40 tiles map, I have to add 39 to Maxvalues East = 16640 and South = 11745

        After clicking on “Select entered coordinates”, the area highlighted in pink color is 39x39 tiles however and with “Display selected area” selected, the area highlighted in yellow color is 40x39 tiles.

        Except for the first case, the map obtained never corresponds exactly to the selection made.

        If a 1x1 tile card, MaxTile = MinTile, for the cards with more tiles the the last tile has to be MinTile + Nb_Of_Tiles – 1.

        For my samples, this formula gives :

        1 tile : East = West_tile_value + 1 – 1 = 16601 + 1 – 1 = 16601 and South = North_tile_value + 1 – 1 = 11706 + 1 – 1 = 11706

        10 tiles : East = West_tile_value + 10 – 1 = 16601 + 10 – 1 = 16610 and South = North_tile_value + 10 – 1 = 11706 + 10 – 1 = 11715

        40 tiles : East = West_tile_value + 40 – 1 = 16601 + 40 – 1 = 16640 and South = North_tile_value + 40 – 1 = 11706 + 40 – 1 = 11745

        The selections in pink color are correct.

        Coordinates values (in atlases):

        Minimum Values: Min_tile_value x 256

        West = West_tile_value x 256 = 4249856

        North = North_tile_value x 256 = 2996736

        Maximum Values: the formula is (Min_tile_value + Nb_Of_Tile) x 256 – 1

        1 tile : East = (West_tile_value + Nb_Of_Tile) x 256 – 1 = (16601 + 1) x 256 = 4250111 and South = (North_tile_value + Nb_Of_Tile) x 256 – 1 = (11706 + 1) x256 = 2996991

        10 tiles : East = (West_tile_value + Nb_Of_Tile) x 256 – 1 = (16601 + 10) x 256 = 4252415 and South = (North_tile_value + Nb_Of_Tile) x 256 – 1 = (11706 + 10) x256 = 2999295

        40 tiles : East = (West_tile_value + Nb_Of_Tile) x 256 – 1 = (16601 + 40) x 256 = 4260095 and South = (North_tile_value + Nb_Of_Tile) x 256 – 1 = (11706 + 10) x256 = 3006975

        I hope this will help.

        Marc.

        De : r_x <r_x@users.sourceforge.net r_x@users.sourceforge.net >
        Envoyé : dimanche 29 mars 2020 15:57
        À : [mobac:bugs] <338@bugs.mobac.p.re.sourceforge.net 338@bugs.mobac.p.re.sourceforge.net >
        Objet : [mobac:bugs] Re: #338 Translation between the coordinates selected and the map created

        In the 1x1 case 1x1 tile is selected. f you extend it horizontally and vertically by 10 why do you expect to get a selection of 10x10? Because if the same rules apply in the first case a 0x0 region would have to be selected.
        Hnece I find it logically that a region of 1x1 extende dby 10 in each dimenstion ends up in a region of 11x11.


        [bugs:#338] Translation between the coordinates selected and the map created

        Status: open
        Group: Already_implemented
        Created: Wed Mar 25, 2020 03:43 PM UTC by Marc Delsupexhe
        Last Updated: Sat Mar 28, 2020 01:00 PM UTC
        Owner: nobody

        If I make a selection of 1 x 1tile: W = 16601, N = 11706, E = 16601, S = 11706, all is OK.
        If I make a selection of 10 tiles x 10 tiles (adding 10 to E and S):
        W = 16601, N = 11706, E = 16611, S = 11716.
        I get a map 11 x 11 tiles (2816 x 2816 pixel) in place of 10 x 10 (2560 x 2560 pixel).
        If I make a selection of 40 x 40 tiles adding 40 to E and E:
        W = 16601, N = 11706, E = 16641, S = 11746.
        I get a map 41 x 40 tiles (10496 x 10240 pixel) !?

        Other note : In the frame « Map source tile store coverage », the word « Layer » has to be replaced with « Map Source ».


        Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/mobac/bugs/338/

        To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

         

Log in to post a comment.

MongoDB Logo MongoDB