Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 211706 Details for
Bug 290026
sci-geosciences/tangogps: improving application (add kilometer grid and WGS-84 Merkator projection)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
splitting previous patch
yandex.patch (text/plain), 4.98 KB, created by
Alexey Kharikovsky
on 2009-12-01 16:34:20 UTC
(
hide
)
Description:
splitting previous patch
Filename:
MIME Type:
Creator:
Alexey Kharikovsky
Created:
2009-12-01 16:34:20 UTC
Size:
4.98 KB
patch
obsolete
>diff -ru tangogps-0.9.6/src/globals.h tangogps-0.9.6_table/src/globals.h >--- tangogps-0.9.6/src/globals.h 2009-02-01 18:34:06.000000000 +0300 >+++ tangogps-0.9.6_table/src/globals.h 2009-09-07 14:16:52.000000000 +0400 >@@ -6,10 +6,20 @@ > #include <gtk/gtk.h> > #include <gconf/gconf-client.h> > >+ > #define GCONF "/apps/tangogps" > #define TILESIZE 256 > #define PNAME "tangogps" > >+#define YANDEX_Rn (6378137.0) >+#define YANDEX_E (0.0818191908426) >+#define YANDEX_A (20037508.342789) >+#define YANDEX_F (53.5865938) >+#define YANDEX_AB (0.00335655146887969400) >+#define YANDEX_BB (0.00000657187271079536) >+#define YANDEX_CB (0.00000001764564338702) >+#define YANDEX_DB (0.00000000005328478445) >+ > typedef struct { > float lat; > float lon; >diff -ru tangogps-0.9.6/src/init.c tangogps-0.9.6_table/src/init.c >--- tangogps-0.9.6/src/init.c 2009-02-05 02:54:26.000000000 +0300 >+++ tangogps-0.9.6_table/src/init.c 2009-09-11 13:49:27.000000000 +0400 >@@ -479,6 +479,9 @@ > repo_t *repo3 = g_new0(repo_t, 1); > repo_t *repo4 = g_new0(repo_t, 1); > repo_t *repo5 = g_new0(repo_t, 1); >+ repo_t *repo6 = g_new0(repo_t, 1); >+ repo_t *repo7 = g_new0(repo_t, 1); >+ repo_t *repo8 = g_new0(repo_t, 1); > > > printf("REPOLIST == NULL\n"); >@@ -511,6 +514,24 @@ > repo5->dir = g_strdup_printf("%s/Maps/googlesat",global_home_dir); > repo5->inverted_zoom = 1; > global_repo_list = g_slist_append(global_repo_list, repo5); >+ >+ repo6->name = g_strdup("Google Map"); >+ repo6->uri = g_strdup("http://mt1.google.com/vt/v=w2.101&hl=ru&x=%d&y=%d&z=%d"); >+ repo6->dir = g_strdup_printf("%s/Maps/googlemap",global_home_dir); >+ repo6->inverted_zoom = 1; >+ global_repo_list = g_slist_append(global_repo_list, repo6); >+ >+ repo7->name = g_strdup("Yandex Sat"); >+ repo7->uri = g_strdup("http://sat01.maps.yandex.ru/tiles?l=sat&v=1.10.0&x=%d&y=%d&z=%d"); >+ repo7->dir = g_strdup_printf("%s/Maps/yandexsat",global_home_dir); >+ repo7->inverted_zoom = 1; >+ global_repo_list = g_slist_append(global_repo_list, repo7); >+ >+ repo8->name = g_strdup("Yandex Map"); >+ repo8->uri = g_strdup("http://vec01.maps.yandex.ru/tiles?l=map&v=2.7.1&x=%d&y=%d&z=%d"); >+ repo8->dir = g_strdup_printf("%s/Maps/yandexmap",global_home_dir); >+ repo8->inverted_zoom = 1; >+ global_repo_list = g_slist_append(global_repo_list, repo8); > > } > >diff -ru tangogps-0.9.6/src/map_management.c tangogps-0.9.6_table/src/map_management.c >--- tangogps-0.9.6/src/map_management.c 2009-02-05 02:54:27.000000000 +0300 >+++ tangogps-0.9.6_table/src/map_management.c 2009-09-11 17:46:33.000000000 +0400 >@@ -144,6 +144,8 @@ > int offset_yn = 0; > int offset_x; > int offset_y; >+ int yandex_offset_y=0; >+ int yandex_offset_x=0; > gboolean success = FALSE; > GError **error = NULL; > repo_t *repo = g_new0(repo_t, 1); >@@ -155,10 +157,30 @@ > > repo = global_curr_repo->data; > printf("---repo dir: %s \n",g_strdup(repo->dir)); >- >- >- offset_x = - pixel_x % TILESIZE; >- offset_y = - pixel_y % TILESIZE; >+ >+//--------------Yandex repository offset ------------------------ >+ if (strstr(repo->name,"Yandex")!=NULL) >+ { >+ float lat=rad2deg(pixel2lat((float)zoom,pixel_y)); >+ float lon=rad2deg(pixel2lon((float)zoom,pixel_x)); >+//----Shmuma autor--- >+ float tmp = tan (M_PI_4 + deg2rad (lat) / 2.0); >+ float pow_tmp = pow (tan (M_PI_4 + asin (YANDEX_E * sin (deg2rad (lat))) / 2.0), YANDEX_E); >+ int unitx = (int)((YANDEX_Rn * deg2rad (lon) + YANDEX_A) * YANDEX_F)>>(23-zoom); >+ int unity = (int)((YANDEX_A - (YANDEX_Rn * log (tmp / pow_tmp))) * YANDEX_F)>>(23-zoom); >+ yandex_offset_y = unity-pixel_y; >+ yandex_offset_x = unitx-pixel_x; >+ printf("\n\nYANDEX_OFFSET_Y = %d, YANDEX_OFFSET_X = %d\n\n\n",yandex_offset_y,yandex_offset_x); >+ } >+ else >+ { >+ yandex_offset_y = 0; >+ yandex_offset_x = 0; >+ } >+//--------------Yandex repository offset ------------------------ >+ >+ offset_x = - (pixel_x + yandex_offset_x) % TILESIZE; >+ offset_y = - (pixel_y + yandex_offset_y) % TILESIZE; > if (offset_x > 0) offset_x -= 256; > if (offset_y > 0) offset_y -= 256; > >@@ -178,8 +200,8 @@ > > > >- tile_x0 = floor((float)pixel_x / (float)TILESIZE); >- tile_y0 = floor((float)pixel_y / (float)TILESIZE); >+ tile_x0 = floor((float)(pixel_x + yandex_offset_x) / (float)TILESIZE); >+ tile_y0 = floor((float)(pixel_y + yandex_offset_y) / (float)TILESIZE); > > > >@@ -210,16 +232,18 @@ > TILESIZE,TILESIZE); > > } >- else >- { >- load_tile( >+ else >+ { >+ load_tile( > repo->dir, > zoom, > i,j, > offset_xn,offset_yn); > } >- offset_yn += TILESIZE; >+ offset_yn += TILESIZE; >+ > } >+ > offset_xn += TILESIZE; > offset_yn = offset_y; > } >@@ -253,8 +277,9 @@ > > pixel_y = lat2pixel(zoom, lat); > >- printf("fill_tiles_latlon(): lat %f %i -- lon %f %i\n", >- lat,pixel_y,lon,pixel_x); >+ >+ printf("fill_tiles_latlon(): lat %f %i -- lon %f %i\n",lat,pixel_y,lon,pixel_x); >+ > > fill_tiles_pixel (pixel_x, pixel_y, zoom); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 290026
:
207837
|
211704
| 211706