MapScaleTransform error

Topics: Bugs
Feb 17, 2012 at 12:21 PM

Change Set: greatmaps_f93232fdfe6f, Files: GMap.NET.WindowsPresentation\GMap.NET.WindowsPresentation\GMapControl.cs, Line: 169

Was:

double scaleValue = remainder + 1;

The relationship between zoom and resolution is not linear. Each time zoom is incremented by 1, resolution (m/pix) is halved.

Should be:

double scaleValue = Math.Pow(2d, remainder);

 Agree?

 Great project. Thanks.

 

Coordinator
Feb 17, 2012 at 1:58 PM

I don't see the big difference? ;/

scaleValue1: 1,0298584966896
scaleValue: 1,02091198707321

scaleValue1: 1,0597169933792
scaleValue: 1,04226128534976

scaleValue1: 1,0895754900688
scaleValue: 1,0640570398759

scaleValue1: 1,11943398675841
scaleValue: 1,08630858693894

scaleValue1: 1,14929248344801
scaleValue: 1,10902545806652

scaleValue1: 1,17915098013761
scaleValue: 1,13221738410946

scaleValue1: 1,20900947682721
scaleValue: 1,15589429941002

scaleValue1: 1,23886797351681
scaleValue: 1,18006634605727

scaleValue1: 1,26872647020641
scaleValue: 1,20474387823155

scaleValue1: 1,29858496689602
scaleValue: 1,22993746663965

scaleValue1: 1,29858496689601
scaleValue: 1,22993746663965

scaleValue1: 1,29858496689601
scaleValue: 1,22993746663965

scaleValue1: 1,32844346358561
scaleValue: 1,25565790304287

scaleValue1: 1,35830196027522
scaleValue: 1,28191620487967

scaleValue1: 1,38816045696482
scaleValue: 1,30872361998505

scaleValue1: 1,41801895365442
scaleValue: 1,33609163140858

scaleValue1: 1,44787745034402
scaleValue: 1,36403196233321

scaleValue1: 1,47773594703362
scaleValue: 1,39255658109696

scaleValue1: 1,50759444372322
scaleValue: 1,42167770631957

scaleValue1: 1,53745294041283
scaleValue: 1,45140781213639

scaleValue1: 1,56731143710243
scaleValue: 1,48175963354174

scaleValue1: 1,59716993379203
scaleValue: 1,51274617184396

scaleValue1: 1,62702843048163
scaleValue: 1,5443807002346

scaleValue1: 1,65688692717123
scaleValue: 1,57667676947402

scaleValue1: 1,68674542386083
scaleValue: 1,60964821369588

scaleValue1: 1,71660392055044
scaleValue: 1,6433091563331

scaleValue1: 1,74646241724004
scaleValue: 1,67767401616762

scaleValue1: 1,77632091392964
scaleValue: 1,71275751350677

scaleValue1: 1,80617941061924
scaleValue: 1,74857467648876

scaleValue1: 1,83603790730884
scaleValue: 1,78514084752003

scaleValue1: 1,86589640399844
scaleValue: 1,82247168984722

scaleValue1: 1,89575490068805
scaleValue: 1,86058319426659

scaleValue1: 1,92561339737765
scaleValue: 1,89949168597372

scaleValue1: 1,95547189406725
scaleValue: 1,93921383155646

scaleValue1: 1,95547189406724
scaleValue: 1,93921383155646

scaleValue1: 1,98533039075684
scaleValue: 1,97976664613415

scaleValue1: 1,01518888744645
scaleValue: 1,01058375032304

scaleValue1: 1,04504738413605
scaleValue: 1,03171706464618

scaleValue1: 1,07490588082565
scaleValue: 1,05329231856527

Coordinator
Feb 17, 2012 at 2:13 PM

to be exact, what difference does it really make?

Feb 18, 2012 at 1:51 AM
Edited Feb 18, 2012 at 8:48 AM

Are You calling me pedantic (-:

I am using GMap as a base map module in a GIS app. That means that additional layers and overlays are not rendered by GMap. The GMap layer was off by a noticeable amount, making the module unusable.

Using your data above

scaleValue1: 1,50759444372322
scaleValue: 1,42167770631957

At the corner of my screen running in full HD this amounts to an error of 93 pixels

(1,50759444372322 - 1,42167770631957)*sqrt((1920/2)^2+(1080/2)^2)=93.87

I have the source, so I can fix it (thanks again for that). It took me a while to figure out what the problem was. Just thought it would be nice to save the next bloke the hassle.

There is a few other things I need to fix to make GMap suitable as a layer, but they are more feature requests not actually bugs. More on that later.

Coordinator
Feb 18, 2012 at 10:30 AM

i see, will be fixed