Results 1 to 7 of 7
  1. #1
    Ecologist_Guy is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    5

    Best Way to Handle Different Latitude and Longitude Formats

    Hi everybody,



    I am trying to create a database that can work with different formats of latitude and longitude. Specifically, I want users to be able to enter one of these three formats on a form and for the database automatically convert among the three formats:

    Degrees-Minutes-Seconds: DDD o MM' SS.S"
    Degrees-Decimal Minutes: DDD o MM.MMMM'
    Decimal Degrees: DDD.DDDDD o

    I am fairly new to Access so I am curious how others would handle this situation. I was thinking of having each format listed in my table and the associated form. Users would only enter coordinates in one format and Access would automatically calculate the other formats and auto-fill them. Is this possible? What is the best approach to doing something like this? The mathematical conversions are not hard but I'm not sure of the best approach to take when coding this. Perhaps there is a better way to approach this.

    In case anybody is curious, the reason we don’t use one standard format is because this is a citizen science project marking sea turtle nest sites. Volunteers in the community collect data and they could be using smart phone apps or GPS units to mark their location. Some of the participants can’t change their units or don’t know how. Last year we realized that many made conversion errors while submitting their data. From my perspective, it seems like it would be easier to let them use the format they are familiar with and let access handle the conversions. The easier we make the process for them the more participation we get and the more thorough our survey is.

    Thanks for your help.

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Interesting question! The safest way I would guess is to store them in three separate fields - D/M/S, each being Integer with no decimals. Another way I have seen it done is with one field (double) with degrees as the whole number and minutes/seconds as the decimals. Conversion would be a simple math formula in any situation.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    i would just have a text field, just store the coords in it , As Is.
    just like google, any app should be able to read the text in ANY format,
    deg-min-sec
    decimals,
    etc.

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,478
    and for the database automatically convert among the three formats:
    Can you explain that part? So they enter the data in one of those 3 formats and you want the program to format the other 2? Can you give a sample of what data they would enter and what the formats would look like?

  5. #5
    Ecologist_Guy is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    5
    Quote Originally Posted by Bulzie View Post
    Can you explain that part? So they enter the data in one of those 3 formats and you want the program to format the other 2? Can you give a sample of what data they would enter and what the formats would look like?
    I'll try to explain it a little better. Surveyors collect data for each nest. In reality they collect quite a bit of information but for the sake of this post I left a lot of the fields out. A critical piece of information is the exact location of the nest. Which is typically collected in three formats. All of these examples below represent the same location but are expressed in the different formats. I'll just use a latitude to illustrate the point. Normally, one would also have a longitude but I'm just using latitude as an example. Longitude will almost be identical so I'll deal with that after I figure the latitude out.
    1. Degrees, Minutes, Seconds = 29o 35' 14.73"
    2. Degrees, Decimal, Minutes = 29o 35.2455
    3. Decimal Degrees = 29.587425

    Following aytee111's advice I separated the coordinates into their parts in my table (see below). I think this will make it easier to code. The math is straightforward and I explained it below in case it will help somebody help me, but perhaps my question wasn't clear. I am wondering how to use code to program Access to recognize that one of the formats has been entered in it's own field and then convert the it to the other formats and fill in the rest of the fields.


    There are 60 seconds in a minute and 60 minutes in a degree. So to convert from degrees, minutes, seconds to degrees decimal, minutes you convert the seconds into a decimal and add it to the minutes, E.g. 14.73"/60 = .2455 thus
    29o 35' 14.73" = 29o 35' + 14.73"/60' = 29o 35.2455'

    Similarly, one can convert the Degrees Decimal minutes to decimal degrees by converting the minutes to a degree. E.g.
    35.2455/60 = .587425, thus 29o 35.2455 = 29+ .587425 =29.587425.

    I hope the math lesson isn't too much but it might help explain what I am trying to do.

    Because volunteers are collecting the data in multiple formats I am hoping their is a way to use come VBA code so they can enter any one of the formats in a form. Then Access will recognize that a coordinate has been entered and convert it to the other formats and fill in the rest of the fields.

    For example, in the table below the latitude was entered in different formats. I am hoping I can use some code so access will autofill the fields in yellow.

    Click image for larger version. 

Name:	LatandLon.PNG 
Views:	17 
Size:	54.9 KB 
ID:	28156

    The tricky part is I don't know which format will be entered and which ones will be left blank. It will depend on the user.

    At the moment, I am thinking that it might be more trouble than it is worth. It may easier to train as many volunteers as I can to use the standard decimal degrees. I could manually convert any data that wasn't submitted in decimal degrees. On the other hand, figuring this out could be a good learning experience but I'm not even sure where to begin.

  6. #6
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Have separate fields on your form giving the user a choice of how to enter the information. Such as (1) three separate fields D/M/S (2) two fields D/M.dd and (3) one field for decimal D. Then you won't have to figure out which format has been used and can calculate the other fields easily. Your Lat_Dec_Deg value above looks incorrect, shouldn't it be 29.something?

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,738
    Don't confuse data entry with data storage.
    Hopefully you don't work directly with tables.

    I recommend you store the data in some consistent format.

    We need to know more about your data entry process. Perhaps you could lead us through the process with a couple of examples.
    You can have a routine to determine the incoming format and act accordingly (at least in theory) and store the info consistently.

    Here is a link to Chip Pearson's site re Lat/Long and Great Circle info.
    Last edited by orange; 04-07-2017 at 08:14 AM. Reason: spelling

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Latitude and Longitude alteration
    By tmcrouse in forum Access
    Replies: 3
    Last Post: 11-19-2015, 10:40 AM
  2. Replies: 2
    Last Post: 03-03-2015, 08:43 PM
  3. Copying formats
    By Lesky in forum Reports
    Replies: 1
    Last Post: 04-03-2014, 07:24 PM
  4. latitude and longitude w Google
    By wnicole in forum Access
    Replies: 2
    Last Post: 03-26-2014, 10:58 AM
  5. How can I get latitude and longitude
    By w0st in forum Access
    Replies: 1
    Last Post: 01-05-2014, 05:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums