rishabht1 / gmapcatcher

Automatically exported from code.google.com/p/gmapcatcher
0 stars 0 forks source link

Need to Know indexing and conversion from lat lon to map tile and pixel size #310

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What new or enhanced feature are you proposing?
Hi, This is more of a request to know how the software functions rather than a 
request to enhance features:

I am using this tool to download a large area of map tiles and at varying zoom 
levels. I believe I have worked out the conversion to find the relevant image 
set for a given longitude, however, I can't use the same process to work out 
the image needed for a given latitude.

Could someone give me a breakdown of how the latitude conversion works?

Currently for Longitude I use: 
GLon = Lon+180;
Ratio = GLon/360;
Zoom = 7; %For example...
No_Tiles = 1024;
Folder_Number = No_Tiles*Ratio - 1;

Then if No_Tiles is larger than 1024 I use an index folder conversion.

If anyone could help with this it would be most appreciated.

JD

Original issue reported on code.google.com by atxjohn...@gmail.com on 21 Feb 2012 at 11:51

GoogleCodeExporter commented 9 years ago
Also: If anyone has the conversion from pixel to meters for the different zoom 
levels this would be appreciated.

Original comment by atxjohn...@gmail.com on 21 Feb 2012 at 11:52

GoogleCodeExporter commented 9 years ago
You do know that this an Open Source project, right?

http://code.google.com/p/gmapcatcher/source/browse/trunk/gmapcatcher/mapUtils.py
def coord_to_tile(coord):

http://code.google.com/p/gmapcatcher/source/browse/trunk/gmapcatcher/tilesRepo/t
ilesRepoFS.py
def coord_to_path(self, tile_coord, layer):

Original comment by heldersepu on 21 Feb 2012 at 1:28

GoogleCodeExporter commented 9 years ago
Thank you for these links.
I'm new to programming and google code, so I really appreciate these pointers. 
I have no idea how to find this stuff (been thrown in the deep end as a Ph.D. 
student in a different field from my main discipline).

Original comment by atxjohn...@gmail.com on 27 Feb 2012 at 3:12

GoogleCodeExporter commented 9 years ago
First thing you should do is get the source code, some instructions here:
http://code.google.com/p/gmapcatcher/source/checkout

You should use a good editor to read the python source code, if you are on 
Windows I will recommend you notepad++

If you need any more help shoot me an email heldersepu(at)gmail.com

Original comment by heldersepu on 27 Feb 2012 at 3:22

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I'm sorry for this inconvenience, but i don't understand why these 2 functions 
don't work with me. My values for lat, long, zoom parameters are 21.0688888889, 
105.8125, -2. So the coordinates after being processed by coord_to_tile 
function are 416413, 230744 and the path should be "sat_tiles\-2\406\399\344", 
but i don't find any folder named 399. is the formular should be added +100 or 
something like that. I hope you will reply soon. Thank you so much.

Original comment by Lethaili...@gmail.com on 13 Mar 2014 at 9:10

GoogleCodeExporter commented 9 years ago
@Lethailinh9999
That is not the values I get if run those coords through the functions:

coord =
[21.0688888889, 105.8125, -2]

map_coord =
((208122, 115372), (79, 46))

tile_coord =
[208122, 115372, -2]

path =
-2\203\250\112\684.png

See sample code here:
https://code.google.com/p/hs-scripts/source/browse/trunk/Python/coord.py

Original comment by heldersepu on 13 Mar 2014 at 1:44

GoogleCodeExporter commented 9 years ago
[deleted comment]