Community of VE/MapPoint Users and Developers
This is a discussion on Get new Lat & Lon from speed within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Well its more like a dummy simulator which keeps on updating new location of latitude & longitude from the previous ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Re: Get new Lat & Lon from speed
Well its more like a dummy simulator which keeps on updating new location of latitude & longitude from the previous inserted lat & lon by the user(as I already told you in this case i am not using any hardware or any txt file). Its just looking like data comes from original GPS and it act as dummy simulator.I tried for it but cant able to get how I can do it. |
| ||||
| Re: Get new Lat & Lon from speed
I think the easiest way to get started with MapPoint programming is automating it through Excel VBA... there are some tutorials here: Working With Excel and MapPoint - MP2K Magazine Eric
__________________ |
| |||
| Re: Get new Lat & Lon from speed
I am working on my project from the last month using C# and interfacing with mappoint. I know basics. Just want to know any idea as I don't know how to get new lat, lon from calculation by inserting lat,lon & speed. Please give me hint. |
| |||
| Re: Get new Lat & Lon from speed
Thank you very much Eric. Now i got how i can code by looping which keep on locating new position after 5 sec. Just one thing more about the direction how can I continuously update direction on map after some seconds, suppose input from user be Lat:N & Lon:S. Thanks once again. |
| |||
| Re: Get new Lat & Lon from speed
Hello, Any body help me to get out of this problem. I need to have an infinite loop that executes every X seconds and show me next position. In other words, a timed / delayed loop. When I use timer it keeps on showing me present position of Lat & Lon which I inserted, not showing me the calculated next values. I tired alot but my application got stuck when i use Code: for(;;) while(true) while(0==0) Code:
public double Speed()
{
if (speed.Text == null || speed.Text.Length <= 0)
return 0;
double knots = Convert.ToDouble(speed.Text);
//Return KMPH
return knots * 1.852;
}
public double Distance()
{
////speed=distance/time.....so distance=speed*time
double time = 0.001388; /////(5 sec time interval)5/3600=0.001388hr
double distance = time * Speed(); //////////////////km/hr
return distance;
}
public double DoLatitude()
{
////1 Degree of Latitude = 110.6Km,68.703miles
double onedegreelat = Distance() * 110.6;
return onedegreelat;
}
public double DoLongitude()
{
////1 Degree of Longitude = 111.3Km*cos(Latitude),69.172miles*cos(Latitude)
double onedegreelon = Distance() * 111.3 * Math.Cos(Convert.ToDouble(latitude.Text));
return onedegreelon;
}
public double Lat()
{
double remlat = 0;
remlat = remlat + DoLatitude();
//remlat = "";
return remlat;
}
public double Lon()
{
double remlon = 0;
remlon = remlon + DoLongitude();
return remlon;
}
while (0 == 0)
{
textbox1.text= Lat().ToString();
textbox2.text= Lon().ToString();
}
I want my fn of Lat() & Lon() should be act as new calculated values so that my pushpin will move continuously. Hope to hear from u guys. thanks in advance. |
| |||
| Re: Get new Lat & Lon from speed
Hi, you always return the same value. You have to place remLat and remLong as private members of the class instead of declaring them on the stack with always the same value (0).
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Get new Lat & Lon from speed
Hello Wilfried, thank you for yours reply. Actually I am designing dummy simulator which will get data from one application and send to another application. For application one I am giving lat & lon and want to get map in second application. For doing as you said it works fine. It is updating new position on application second but my first application still getting hang up. I don't know about it. I tried on Google for this problem and found treads can solve this problem as it works fine in GUI for unlimited looping. But I don't know how I can use it in my application. Code: private void timer1_Tick(object sender, EventArgs e)
{
double remlat = 0;
double remlon = 0;
while (true)
{
remlat = remlat + DoLatitude();
remlon = remlon + DoLongitude();
double retValLat = remlat + Convert.ToDouble(latitude.Text);
double retValLon = remlon + Convert.ToDouble(longitude.Text);
string NMEA = "$GPGGA" + "," + "UTCTime" + "," + (retValLat.ToString()) + "," + Pole1.Text + "," + (retValLon.ToString()) + "," + Pole2.Text;
byte[] nmea = System.Text.Encoding.ASCII.GetBytes(NMEA);
if (clientSocket != null)
{ clientSocket.Send(nmea); }
//timer1.Interval=(9000);
Thread.Sleep(10000);
//return remlat;
Console.WriteLine(nmea);
}
|
![]() |
| Tags |
| lat, lon, speed |
| ||||
| Posted By | For | Type | Date | |
| Formatting Coordinates with DmsFormat - MapPoint Articles - MP2K Magazine | This thread | Refback | 05-14-2008 09:29 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I speed up this code? | RichardD | MapPoint 2006/2009 Discussion | 5 | 11-18-2005 10:55 AM |
| Open Map Speed | Yazzy | MapPoint 2006/2009 Discussion | 1 | 06-27-2005 10:52 AM |
| Speed of the service | sbedin | MapPoint Web Service and Virtual Earth | 0 | 12-21-2004 10:13 AM |
| Excel VBA or VB6 For Speed | DavidP | MapPoint 2006/2009 Discussion | 3 | 08-14-2004 05:50 PM |
| Speed Print out | Anonymous | MapPoint 2006/2009 Discussion | 0 | 12-26-2003 04:54 AM |
Ski Holiday Packages
Choose from a selection of ski holiday packages from the top travel brands. Holiday Hypermarket makes it easy to search and browse great value ski holidays.
Flights to Spain
Find cheap flights to Spain on Travel Counsellors. A personal Travel Counsellor can help you plan flights and find accommodation in Spain.
Thailand Holiday
A Thailand Holiday has much to offer with historic culture, lively arts, beautiful beaches, a good nightlife, friendly and hospitable people and one of the best cuisines in the world.
Holidays to Barbados
Holidays to Barbados have so much to offer. Enjoy the beauty of this Caribbean island for less by booking your holiday through us.
Cheap Holidays
Hunting for cheap holidays? Well save time by booking online with ulookubook.com and you can even check out our top tips to help you hunt down a bargain holiday.
Air Travel
Interested in air travel? Search and compare millions of holidays, flights and hotels with our help at Travel.co.uk
Cheap Holidays in Florida
Legendary weather! Visit On The Beach for info on cheap holidays in Florida.