Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 4 of 4

mappoint lat/lon

This is a discussion on mappoint lat/lon within the MapPoint Desktop Discussion forums, part of the Map Forums category; I log some co÷rdinates from GPS.. $GPGGA,062417,5111.8695,N,00425.7264,E,1,03,3.4,4. 8,M,47.1,M,,*4C I extract the lat = 00425.7264 and lon = 5111.8695 I put ...

  1. #1
    Jade is offline Junior Member Yellow Belt
    Join Date
    Mar 2003
    Posts
    18

    mappoint lat/lon

    I log some co÷rdinates from GPS..

    $GPGGA,062417,5111.8695,N,00425.7264,E,1,03,3.4,4. 8,M,47.1,M,,*4C

    I extract the lat = 00425.7264
    and lon = 5111.8695

    I put in code :
    Set wwLoc = mainMap.GetLocation(lat,lon)

    And what do I get: Run-time error '-2147.......(8007....) : The parameter is incorrect..

    What is it that I do wrong?

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    mappoint lat/lon

    I don't know about your code, but I think you will need to convert to decimal format for MapPoint, that's what I use.

    i.e. 5111.8695 N = 51.19783 N = latitude

    You are in Antwerp, yes?

    BTW u hav your lat and long reversed.

  3. #3
    Jade is offline Junior Member Yellow Belt
    Join Date
    Mar 2003
    Posts
    18

    Re: mappoint lat/lon

    Quote Originally Posted by Chris_s
    I don't know about your code, but I think you will need to convert to decimal format for MapPoint, that's what I use.

    i.e. 5111.8695 N = 51.19783 N = latitude

    You are in Antwerp, yes?

    BTW u hav your lat and long reversed.
    Oh yeah.. but it's correct in my code, sorry.

    Indeed, I am in Antwerp..

    So I have to convert to the decimal format... any idea how to do that in VB 6? cause I am very new to VB...

    Many Tnx

  4. #4
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    mappoint lat/long

    Here's a function I wrote to do just that, you pass the value in GPS NMEA format and the function returns the decimal format.

    Use like this assuming you have the NMEA value for lat in a string:-

    lngDecimalLatitude = gpsConvert(strNMEAlatitude)

    Use again for Long

    Copy and paste into VB6 and it should look better when the colours are correct.



    Private Function gpsConvert(ByVal sngTemp As Single) As Single ' converts GPS format to Infomap format
    Dim intDegrees As Integer
    intDegrees = Int(sngTemp / 100)
    gpsConvert = intDegrees + (sngTemp - (intDegrees * 100)) / 60 ' sngTemp - (intdegrees * 100) removes the whole degrees,
    'then devide by 60 to get decimals of a degree, then add the whole degrees back on to get degrees and decimals of a degree
    End Function



    Chris

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25