SASGIS

Веб-картография и навигация

hi

программа для загрузки и просмотра спутниковых снимков Земли, Луны, Марса предоставленных сервисами Google Maps и Космоснимки. Возможность работы с GPS приёмником.

Модератор: Tolik

hi

Сообщение ahmadah » 10 ноя 2008, 17:38

hi
my english is too bad , and i don't know any thing about Rusian
i just can find here by google translator system




please help me, i want to convert longitude and latitude position to a PIXEL on one of these JPGs !

for example i need to convert :
longitude="51.240234" latitude="35.817813" NE
to a JPG name like :
..\SASPlanet2\cache\SAT\z18\74\x76092\47\y49110.jpg

i found :
result:=path+'\z'+zoom+'\'+(x div 1024)+'\x'+x+'\'+(y div 1024)+'\y'+y+ext;

in this forum. so if i can calcute X number and Y number of this position, then i can found exact file name of my file



after some sxam i can calculte X of my position :
for each ZOOM level,we have 2^(zoom level -1 ) images in row and colum
left corner is -180 and right corner is +180



so i can calculate my X for zoom level 14 like this :
((180+51.240234)/360)*8192

also i found up corner is +85.0511111111111111111 and down corner is +85.0511111111111111111
but i cant found any formula to calculte Y position




please help me, sorry again for my bad english.

let me repeat my question:
i need to conver position with longitude=..... and latitude=.... to JPG number X=.... and Y=....

thnak you
ahmadah
Новичок
 
Сообщения: 2
Зарегистрирован: 10 ноя 2008, 15:30
Благодарил (а): 0 раз.
Поблагодарили: 0 раз.

Re: hi

Сообщение svp » 10 ноя 2008, 18:52

NumTiles[Level] = 2 ^ (Level-1) {- Count of tiles along one of sides of bitmap}
NumTiles[1] = 1
NumTiles[2] = 2
NumTiles[3] = 4
NumTiles[4] = 8
NumTiles[5] = 16
NumTiles[6] = 32
NumTiles[7] = 64
NumTiles[8] = 128
NumTiles[9] = 256
NumTiles[10] = 512
NumTiles[11] = 1024
NumTiles[12] = 2048
NumTiles[13] = 4096
NumTiles[14] = 8192
NumTiles[15] = 16384
NumTiles[16] = 32768
NumTiles[17] = 65536
NumTiles[18] = 131072
NumTiles[19] = 262144
NumTiles[20] = 524288

BitmapSize[Level] = NumTiles[Level] * 256
BitmapOrigo[Level] = BitmapSize[Level] / 2 {- position (pixel) of center of tile.}

PixelsPerLonDegree[Level] = BitmapSize[Level] / 360
PixelsPerLonRadian[Level] = BitmapSize[Level] / (2*PI)

    X = floor(BitmapOrigo[Level] + Lon * PixelsPerLonDegree[Level]);
    Y = floor(BitmapOrigo[Level] - 0.5 * ln((1+z)/(1-z)) * PixelsPerLonRadian[Level]),
    where z = sin(Lat).
Аватара пользователя
svp
Советчик
 
Сообщения: 447
ICQ: 204094886
Зарегистрирован: 26 авг 2008, 11:14
Откуда: Белгород
Благодарил (а): 2 раз.
Поблагодарили: 4 раз.

Re: hi

Сообщение ahmadah » 10 ноя 2008, 21:40

ahmadah
Новичок
 
Сообщения: 2
Зарегистрирован: 10 ноя 2008, 15:30
Благодарил (а): 0 раз.
Поблагодарили: 0 раз.


Вернуться в SAS.Планета

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 2