Solved

Mapping

Posted on 2002-07-08
4
209 Views
Last Modified: 2011-10-03
I want to write a GIS application where I have to find a location corresponding a given latitude and longitude.
I have placed the map in a picture box. I know the latitude and longitude of the top/left and bottom/right corner of the map.
0
Comment
Question by:Gopakumar
4 Comments
 
LVL 6

Expert Comment

by:ebosscher
ID: 7137647
And you know the width and the height of the picture box?  Umm.. why not do some quick math on the numbers

I don't know what the lattitude and longitude numbers are, but if you can give me an example I can show you the math.  

basically width / (lower right longitude - upper left longitude)

width = 800
ul long = 100
lr long = 105

800/(105-100) = 160  so, you have 1 additional point of longitude for every 160 horizontal pixles

the same math would work for lattitude.

does that help?
0
 
LVL 27

Accepted Solution

by:
Ark earned 200 total points
ID: 7139421
Hi
First of all it depends on latitude range. On Mercator projection latitude scale isn't proportional. If range isn't large (up to 4 degrees), you may consider it is, so the easiest way is to set:

Picture1.ScaleMode = 0 'User
Picture1.ScaleLeft = LeftValue
Picture1.ScaleTop = TopValue
Picture1.ScaleWidth = RightValue - LeftValue
Picture1.ScaleHeight = BottomValue - TopValue

Now all your map is scaled according your coordinates and all mouse events (move, click, down/up) will return scaled values.
But if you need large range (more then 5 degrees) or very precissious coordinates, you have to use Mercator's projection formulaes.

Cheers
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7991189
Hi Gopakumar,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept Ark's comment(s) as an answer.

Gopakumar, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 8053151
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
message box in access 4 41
vb6 connector to mongodb 2 51
Add and format columns in vb6 7 47
VB 6 error 5 in windows 10 but not in XP 7 46
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now