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 5 of 5

Geodesy: MapStuff Release version 0.9

This is a discussion on Geodesy: MapStuff Release version 0.9 within the MP2K Magazine Articles forums, part of the Map Forums category; Windsway Company is releasing some Geodesy oriented software as open souce code. This is not a complete application but rather ...

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

    Geodesy: MapStuff Release version 0.9

    Windsway Company is releasing some Geodesy oriented software as open souce code. This is not a complete application but rather a set of routines that you can use to build your own applications.

    Read the full article: http://www.mp2kmag.com/articles.asp?ArticleID=73

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

    vDirect rounding problems I think.

    Great set of routines. VERY usefull, Thanks for posting them.

    I have a rounding problem I think.

    I have a recorded GPS file. For each waypoint in the file the distance between 2 points could be 0 to 50m depending how fast you are driving as the GPS samples every 2 seconds.

    I need a new datafile that calculates lon/lat for every 1m interval.

    Using vInverse and vDirect I am able to do this but compairing the sum of the distance to next point for each of my datasets I get conflicting data.

    When I calc vDirect passing lat1/lon1, azmuth12, and a distance of 1 I get lat2/lon2 in return.

    But when I use vInverse to determine distance between the 2 points I get a distance between .92 - .98 not a distance of 1.

    With my 1st dataset the sum of distances is correct so vInvers is working properly.

    I think the problem may be with my following routines to converting lat lon formats back and forth.

    Any suggestions????? THX


    'convert to oGS format

    Public Function ConvertNMEA(sNMEA As String) As Double
    'input N47.36981 from GPS sentence
    'output N47.61635 mappoint format

    Dim sTmp As String
    Dim dRetVal As Double

    sTmp = Left(sNMEA, 1)

    sNMEA = Mid(sNMEA, 2)

    If Not IsNumeric(sNMEA) Then
    Exit Function
    End If

    dRetVal = Int(sNMEA / 100) + (sNMEA - Int(sNMEA / 100) * 100) / 60

    Select Case sTmp
    Case "N"
    'dRetVal = dRetVal
    Case "S"
    dRetVal = "-" & dRetVal
    Case "E"
    'dRetVal = dRetVal
    Case "W"
    dRetVal = "-" & dRetVal
    End Select

    ConvertNMEA = dRetVal

    End Function

    'convert back to NMEA format
    'Thanks Evert

    Function FormatCoordinate(coordinate, LonOrLat) As String
    Dim minus As Boolean, before As Integer, after As Integer
    Dim Zeros As Integer, c As String

    'this function needs a nddd,mm.mmmm input (integer) WGS 84 coordinate
    'and returns a NMEA complaint string

    'NMEA requires a special format
    'latitude = ddmm.mmmm (d=degrees, m=minutes)
    'longitude = dddmm.mmmm (d=degrees, m=minutes)
    'note the difference; longitude needs 3 d's
    'we need to give north/south and east/west too with cardinals

    If LonOrLat <> "lon" And LonOrLat <> "lat" Then
    FormatCoordinate = "LonOrLat must be 'lon' or 'lat'"
    Exit Function
    End If

    c = CStr(coordinate)

    'negative? remember that!
    If Left(c, 1) = "-" Then
    minus = True
    c = Right(c, Len(c) - 1)
    Else
    minus = False
    End If

    'convert degrees.minutes to babylonian (60 degrees based)
    c = Babylonian(c)

    'country settings: decimal seperator can be "." or ","
    c = Replace(c, ",", ".")

    'add leading zero's if needed
    If LonOrLat = "lat" Then
    Zeros = 4
    ElseIf LonOrLat = "lon" Then
    Zeros = 5
    Else
    FormatCoordinate = "error in FormatCoordinate"
    Exit Function
    End If
    Do
    before = Len(Left(c, InStr(c, ".") - 1))
    If before < Zeros Then c = "0" & c
    Loop Until before >= Zeros

    'add tail zero's if needed
    Zeros = 4
    Do
    after = Len(Right(c, Len(c) - InStr(c, ".")))
    If after < Zeros Then c = c & "0"
    Loop Until after >= Zeros

    'if to many digits, then reduce
    after = Len(Right(c, Len(c) - InStr(c, ".")))
    If after > Zeros Then c = Left(c, Len(c) - (after - Zeros))

    'add cardinals
    If LonOrLat = "lat" Then
    If minus = False Then
    c = "N" & c
    Else
    c = "S" & c
    End If
    ElseIf LonOrLat = "lon" Then
    If minus = False Then
    c = "E" & c
    Else
    c = "W" & c
    End If
    Else
    FormatCoordinate = "error in FormatCoordinate"
    Exit Function
    End If

    FormatCoordinate = c
    End Function

    Function Babylonian(c) As String
    Dim minutes As Variant
    Dim degrees As Variant
    'country settings: decimal seperator can be "." or ","
    c = Replace(c, ",", ".")

    degrees = Left(c, InStr(c, ".") - 1)
    minutes = Right(c, Len(c) - InStr(c, "."))
    minutes = minutes / 10 ^ Len(Right(c, Len(c) - InStr(c, ".")))
    'convert minutes to babylonian (60 degrees based)
    minutes = minutes * 60

    If minutes < 10 Then minutes = "0" & minutes

    'country settings: decimal seperator can be "." or ","
    minutes = Replace(minutes, ",", ".")

    If InStr(minutes, ".") = 0 Then
    minutes = minutes & ".0"
    End If

    Babylonian = degrees & minutes
    End Function

  3. #3
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    Geodesy version 0.93 release

    Vic recently (9/7) sent out the latest update.. to get on his mailing list, write him at: vfraenc1@nycap.rr.com?subject=Geodesy

    Geodesy version 0.93 release

    This is the distribution of the latest version of the Geodesy code
    set. It contains version 0.93 of the module Mapstuff.bas and version
    0.91 of the class module Geodesy.cls. Also included is the new module
    WICUtilities (version 0.90). Unzip the distribution (Geodesy.zip) into
    the same folder where the previous version resides. The appropriate files
    will be overwritten.

    It is strongly suggested that you read the revision notes in the file
    Revision093.txt and the general discussion in Geodesy.txt before using
    this distribution.

    You are receiving this distribution because you received the previous
    distribuition and your e-mail address is in my distribution list. If
    you do not want further revisions to be sent to you, please send me
    an e-mail and ask to be removed from the list. Put the word GEODESY in
    the subject line of your request.

    I would like to hear from any of you that are using GEODESY code. I want
    to know how you are using the code, how I can make the code better and,
    most importantly, have you found any bugs. Please thouroughly document
    bugs so I can try and reproduce them try to fix them.

    Download:
    http://www.mp2kmag.com/downloads/Geodesy-0.93.zip
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

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

    thanks

    Thats what I needed.

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

    correct format

    hi, i have one Garmin Emap and returns latitude/longitude in this format

    latitude 4138.1904
    longitude 00444.6535

    well, i put in a form the following code:


    Option Explicit


    Private Sub Command1_Click()

    Dim utm As UTMStruct

    utm.Latitude = Val(Text1.Text) (i put 4138.1904)
    utm.Longitude = Val(Text2.Text)(i put 00444.6535)
    utm.geoid = 22

    Call LL2UTM(utm)


    Label3.Caption = Label3.Caption & " " & utm.North
    Label4.Caption = Label4.Caption & " " & utm.East
    Label5.Caption = Label5.Caption & " " & utm.geoid
    Label6.Caption = Label6.Caption & " " & utm.ZoneNumber
    Label7.Caption = Label7.Caption & " " & utm.ZoneLetter
    Label8.Caption = Label8.Caption & " " & utm.CentralLongitude
    Label9.Caption = Label9.Caption & " " & utm.GridSF


    End Sub


    ...and returns me negative coordinates and the zonenumber and letter are unsuitables, which is the correct format i`ve to pass to utm.Latitude and utm.longitude? and...geoid= 22 (wgs84) is correct? i'm from spain(30)

    Thank you so much

    Diego García Álvarez

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. MapPoint MatchMaker release 1.0 is now available
    By Anonymous in forum News and Announcements
    Replies: 1
    Last Post: 08-19-2004, 08:00 PM
  2. Map-In-A-Box 2.0 Press Release
    By Anonymous in forum News and Announcements
    Replies: 0
    Last Post: 03-16-2004, 11:59 AM
  3. GPSTrackP Software Release
    By dzhong in forum News and Announcements
    Replies: 7
    Last Post: 02-04-2004, 10:44 AM
  4. GPS NavStar Version 3.0.0 Release
    By dzhong in forum News and Announcements
    Replies: 3
    Last Post: 12-05-2003, 11:09 PM
  5. Information on my GEODESY code posted on mp2kmag
    By victorf in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 07-31-2002, 11:05 PM

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 26 27