You are here: > ESRI Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - Data Management (General) forum

Converting Degrees Minutes Seconds to Decim...   Ramin Zamanian Jun 14, 2006
Re: Converting Degrees Minutes Seconds to D...   Thomas Schmitt Jun 14, 2006
Re: Converting Degrees Minutes Seconds to D...   Dan Patterson Jun 14, 2006
Re: Converting Degrees Minutes Seconds to D...   Petr K. Jun 14, 2006
Re: Converting Degrees Minutes Seconds to D...   Ramin Zamanian Jun 14, 2006
Re: Converting Degrees Minutes Seconds to D...   Petr K. Jun 14, 2006
Re: Converting Degrees Minutes Seconds to D...   Tamsen Jennings Jul 20, 2007
Re: Converting Degrees Minutes Seconds to D...   Petr K. Jul 20, 2007
Re: Converting Degrees Minutes Seconds to D...   Katharina Werner May 15, 2008
Re: Converting Degrees Minutes Seconds to D...   Tim Varner May 15, 2008
Re: Converting Degrees Minutes Seconds to D...   Craig Crocker Jun 12, 2008
Re: Converting Degrees Minutes Seconds to D...   Ljuba Veselinova Jun 13, 2008
Re: Converting Degrees Minutes Seconds to D...   Katharina Werner Jun 13, 2008
Re: Converting Degrees Minutes Seconds to D...   Craig Crocker Jun 13, 2008
Re: Converting Degrees Minutes Seconds to D...   William Huber Jun 16, 2008
Re: Converting Degrees Minutes Seconds to D...   Johnny willy Jun 17, 2008
Re: Converting Degrees Minutes Seconds to D...   Charlotte Peters Jun 18, 2008
Re: Converting Degrees Minutes Seconds to D...   Jeff Christiansen Jun 18, 2008
Re: Converting Degrees Minutes Seconds to D...   Jeff Christiansen Jun 18, 2008
Re: Converting Degrees Minutes Seconds to D...   Johnny willy Jun 18, 2008
Re: Converting Degrees Minutes Seconds to D...   Jeff Christiansen Jun 18, 2008
Re: Converting Degrees Minutes Seconds to D...   Janey Smith Jun 03, 2009
Re: Converting Degrees Minutes Seconds to D...   Janey Smith Jun 04, 2009
Re: Converting Degrees Minutes Seconds to D...   J U Jun 04, 2009
Re: Converting Degrees Minutes Seconds to D...   Janey Smith Jun 05, 2009
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Ramin Zamanian 
Date Jun 14, 2006 
Message Hi,

I received a large quantity of data in DMS format, and I am having trouble converting it to decimal degrees. I am looking for a way to convert the data as quickly and efficiently as possible. Is there a way to convert this DMS data (either in Microsoft Excel or ArcGIS) without splitting the data into three separate columns first, and if I do need to split the data, is there a way to do so quickly, i.e. avoiding having to split the data one entry at a time? I appreciate any help on this matter.

Thanks,
-Ramin 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Thomas Schmitt 
Date Jun 14, 2006 
Message Ramin,
If you dont mind working in Excell, go to
http://support.microsoft.com/kb/213449/en-us
It is an article on converting DMS to or from decimal nagles in Excell 2000. I used it for converting some GPS points from our Transportation Dept. into State Plane Coordinates.
Hope it helps,
Tom Schmitt
Manatee County Govt.
ISD/GIS
Bradenton, FL 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Dan Patterson 
Date Jun 14, 2006 
Message if it is all in one string field, try
Easy Calculate at www.ian-ko.com
there is a field_DMS2DD.cal which can be used for the conversion 
  Geomatics, Carleton University, Ottawa, Canada 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Petr K. 
Date Jun 14, 2006 
Message Hi Ramin,

you can do that with an Excel equation by retrieving the appropriate characters from your DMS string, converting them to number and then computing the decimal degrees value. How do your DMS strings exactly look like?? Somehing like DM'S'' ? The exact format of the number is crucial for the conversion.

Cheers,
Petr Krebs 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Ramin Zamanian 
Date Jun 14, 2006 
Message Those all look like nice options, thanks, I'll be looking into them shortly.

My data arrived in this format (example): 12.34567
(DD.MMSSS). So getting multiple data strings into DDMM'SSS" format simultaneously would be ideal if I use the Excel option.

In Excel I changed the data columns to numeric. In ArcGIS the data plotted near their correct locations, but not exactly. A colleague usng Geomedia verified that the data is indeed in DMS format and that a conversion to decimal degrees is one way the data points plot onto the map correctly...however, I will be using ArcGIS.

Thanks again!
-Ramin 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Petr K. 
Date Jun 14, 2006 
Message Ramin,

if your data is in the DD.MMSSS format, that is 12.34567 ought to be 1234'567'' which is 12.724166, you can use the following Excel method:

1) convert the DD.MMSSS column to text; in the following steps I assume that the data is in A2 cell
2) in three adjacent columns, use these fomulas (each formula in one column):
=VALUE(LEFT(A2;SEARCH(".";A2)-1))
=SIGN(VALUE(LEFT(A2;SEARCH(".";A2) - 1)))*VALUE(MID(A2;SEARCH(".";A2)+1;2))/60
=SIGN(VALUE(LEFT(A2;SEARCH(".";A2) - 1)))*VALUE(RIGHT(A2;3))/3600
3) in another column, sum the values of the three previous columns -> this gives you the decimal degrees result
4) drag/copy (I bet you know what I mean) the four columns down to all your rows

You can of course alternatively replace steps 2 and 3 with a single formula instead. I chose this way just to make it clear and more readable as to see better what is going on. The sign part in second and third formula is required for correct handling of negative values.
Looks a bit clumsy, but it does the trick. Maybe a VBA script could be also be a choice in this situation.

Hope that helps,
Petr Krebs
 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Tamsen Jennings 
Date Jul 20, 2007 
Message Is there a way to do this within Arc Map as a vbscript so that you do not have to export it to excel? If so does anyone know how the script should look?

I am trying to automate this process.

Thank you,

 
  Tamsen M. Jennings
GIS Specialist
American Forest Management, Inc.
 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Petr K. 
Date Jul 20, 2007 
Message That would be a very simple script (Mid function and string to number conversion do the trick), but you can take a look at LatLon coclass found in esriSystem library. It might be of some use to you.

Cheers,
Petr Krebs
 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Katharina Werner 
Date May 15, 2008 
Message Hello,

I've the same problem like Ramin. But I have no excel-data. I've a simple txt-data. I tryed to import it to excel. But it is to large for excel (27 MB). So, has anybody an idea how to handle this? I would be very glad about some ideas! I thougt about an script in unix or something like that. But I'm not really familiar with this. That's why I'm looking for another solution. :-) If there would be no other way than a unix script, so how to do this?

Thanks a lot for help,
Katharina 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Tim Varner 
Date May 15, 2008 
Message A couple line unix utility should do the trick nicely. Download the utilities for windows at: http://sourceforge.net/projects/unxutils

I mean why write an arcobjects script when you don't have to?
 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Craig Crocker 
Date Jun 12, 2008 
Message I've run into a similar situation where the data within the spreadsheet is formatted as [hh]mm'ss\" so that the originator just had to enter the DMS in as 92:38:29.56 so it would display as DDMM'SS". How can I convert this to decimal degrees? 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Ljuba Veselinova 
Date Jun 13, 2008 
Message Look at Petr Krebs message in this thread. I am pasting it below. His instructions helped me, hope they work for you too.

Ljuba

Petr Krebs
Date Jun 14, 2006
Message Ramin,

if your data is in the DD.MMSSS format, that is 12.34567 ought to be 1234'567'' which is 12.724166, you can use the following Excel method:

1) convert the DD.MMSSS column to text; in the following steps I assume that the data is in A2 cell
2) in three adjacent columns, use these fomulas (each formula in one column):
=VALUE(LEFT(A2;SEARCH(".";A2)-1))
=SIGN(VALUE(LEFT(A2;SEARCH(".";A2) - 1)))*VALUE(MID(A2;SEARCH(".";A2)+1;2))/60
=SIGN(VALUE(LEFT(A2;SEARCH(".";A2) - 1)))*VALUE(RIGHT(A2;3))/3600
3) in another column, sum the values of the three previous columns -> this gives you the decimal degrees result
4) drag/copy (I bet you know what I mean) the four columns down to all your rows

You can of course alternatively replace steps 2 and 3 with a single formula instead. I chose this way just to make it clear and more readable as to see better what is going on. The sign part in second and third formula is required for correct handling of negative values.
Looks a bit clumsy, but it does the trick. Maybe a VBA script could be also be a choice in this situation.

Hope that helps,
Petr Krebs

Geography/Cartography student and GIS enthusiast
Faculty of Science, Charles University in Prague
 
  Ljuba Veselinova
Dept of Linguistics
Stockholm University
10691 Stockholm
Sweden
 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Katharina Werner 
Date Jun 13, 2008 
Message Hello @ all,

I had already tried the solution of Petr and it didn't worked. But I had found a more easier solution and I hope it is correct.

The conversion formular for DMS to DD is:

decimaldegrees = (sec/60 + min)/60 + degrees

Example:
1324'56.789'' is in cell A1

in Excel:

for the degrees:
=mid(A1;1;2)
==> mid(cell;1st sign;numbor of signs)
==> result: 13

for the minutes:
=mid(A1;4;2)
==> result:24

and so on...

And then you can calculate the decimal degrees with the above called formular. I think it's the easiest way. If you have so much data, that you can't put it in a Excel-sheet (my excel release has only 65536 rows) you can do the left-action also in ArcMap but it is not the same function like mid().

If it is not a right solution, please correct me! I hope, I could help somebody with this post.

Thank you & kind regards,
Katharina Werner



 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Craig Crocker 
Date Jun 13, 2008 
Message Unfortunately the =mid function won't work for me as the cells are not formatted as text but are actually formatted as a modified version of time - [hh]mm'ss\". This displays data as 3326'39" when input as 33:26:39.23 but if you select the cell it reads as 1/1/1900 9:26:39 AM in the field to the right of the funtion picker button (don't know what the field is called). 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author William Huber 
Date Jun 16, 2008 
Message Craig,

That's too clever by half. Fortunately, nothing was lost. You can recover your data by observing Excel has interpreted the input as time--degrees as hours, minutes as minutes, and seconds as seconds--and converted that to fractional days.

Converting back is a matter of re-expressing the days as seconds and then breaking this down into hours, minutes, and seconds. Thus, placing the original value in cell A2, you could use these formulae to view the original value as a number and compute it as decimal degrees:

B2/Days: =A2 {format this as a number}
C2/Total seconds: =B2*(60*60*24)
D2/Total minutes: = INT(C2/60)
E2/Hours or degrees: =INT(D2/60)
F2/Minutes: =MOD(D2,60)
G2/Seconds: =MOD(C2,60)
H2/DD: =(G2/60 + F2)/60 + E2 
  --Bill Huber
Quantitative Decisions (http://www.quantdec.com )
More GIS Q&A at http://gis.stackexchange.com/q/3083/664 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Johnny willy 
Date Jun 17, 2008 
Message I receive this data from a client and I do not know what it is or how I can convert so that I can use it in ArcView 9.2 thru the Tools>Add XY data.

A1= GPS S GPS E
A2= 09.14.443 125.26.059

I think its DMS. There's alot of it, I was hoping someone here can provide a formula in excel to where I can convert all of this. I am not an expert on anything....just basic of both platform.

Please help me. 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Charlotte Peters 
Date Jun 18, 2008 
Message I haven't seen coordinates displayed in that format before. If you have a general idea of where the point is supposed to be, you might want to treat it as DMS (09d 14m 443s)and convert it to DD. If the DD result doesn't work in ArcView, then treat the coordinate as DM (09d 14.443m) convert it to DD and see if it works. It's definately trial & error, but at least you only need to work through three different formats (DMS, DM, DD). Once you know the format, then you can convert the rest of the coordinates.

This is a great link for excel conversions if the format was xx:xx:xx. http://www.cpearson.com/excel/latlong.htm 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Jeff Christiansen 
Date Jun 18, 2008 
Message You should still be able to figure out what format the data is in if you look through the numbers.

You wouldn't have 443 seconds, but it might be 44.3 seconds. Are there any seconds values that are over 600? If so, you are likely looking at decimal minutes instead (i.e., 14.443 minutes), since you would not have over 60 seconds.

The excel splitting examples above should still work for you anyway. 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Jeff Christiansen 
Date Jun 18, 2008 
Message If it is DM, I have attached an image that will give you the formulae for Excel. I broke it down a few different ways so you can see what is happening. If you determine that the data is DMS, you should be able to figure out how to modify the formulae to account for the seconds as well. 
  DM_to_DD.JPG (opens in new window)
 
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Johnny willy 
Date Jun 18, 2008 
Message Hi...

I've tried the formula as suggested. Some point would show up in the ocean somewhere. The points are supposed to be in the country of East Timor(also known as Timor-Leste), province of Bobonaro.

I've attacehed the coordinates.

Please assist. Thanks everyone in advance. 
  coordinate.xls (opens in new window)
 
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Jeff Christiansen 
Date Jun 18, 2008 
Message Looking at your data, I'm quite sure they represent DM and not DMS. Note that cell E15, however, has an extra space in front of the text, causing the wrong coordinate to be calculated.

If I remember correctly, you will also need to convert the South coordinates to a negative number (otherwise the system won't be able to tell north from south). The East coordinate should be positive (if you were working with West coordinates, they would have to be converted to negative values as well).

If you have a map project already with Timor-Leste data, you should be able to check the coordinates of your display (assuming the display is also in DM) and see whether the display units are showing up as positive or negative for the South and East coordinates. 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Janey Smith 
Date Jun 03, 2009 
Message I need either ArcObjects code, VBA code, or VB.net code that will convert from decimal degrees 1983 UTM to State Plane. Any suggestions??? 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Janey Smith 
Date Jun 04, 2009 
Message Is there a coding equivalent to the following code for State Plane TN? Or can I inherit the coordinate system of the map???

Set pGeographicCoordSys = pSpatialRefFactory.CreateGeographicCoordinateSystem(esriSRGeoCS_NAD1983)
Set pSpatialRef = pGeographicCoordSys
pSpatialRef.SetFalseOriginAndUnits -180, -90, 1000000


Thanks!!!! 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author J U 
Date Jun 04, 2009 
Message Try looking at the code in the link (and below). It shows the createProjectedCoordinateSystem() method in it. This would be what you'd want to use for state plane. It is written in C# but the objects are the same you'd use in Java or .NET.

http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriGeometry/CreateProjectedCoordinateSystem_Example.htm 
 
private void CreateProjectedCoordinateSystem()
{
  ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass(); 

  //Create a projected coordinate system using the available projected coordinate systems 
  IProjectedCoordinateSystem projectedCoordinateSystem1 = spatialReferenceFactory.CreateProjectedCoordinateSystem((int)esriSRProjCSType.esriSRProjCS_World_Mercator);
  //Here is an more detailed example for creating a pre-defined projected coordinate 
  //system for a new Shapefile using the 'ISpatialReferenceFactory::CreateProjectedCoordinateSystem method 

  //Create the pre-defined projected coordinate system object 
  IProjectedCoordinateSystem projectedCoordinateSystem2 = spatialReferenceFactory.CreateProjectedCoordinateSystem((int)esriSRProjCSType.esriSRProjCS_NAD1983SPCS_TXSouthCentFT); 
  ISpatialReference spatialReference = projectedCoordinateSystem2 as ISpatialReference;
  //Set the false origin and units for the spatial reference.
  //You can use either the Domain or the FalseOriginAndUnits methods.
  // spatialReference.SetFalseOriginAndUnits(0, 0, 0); 
  spatialReference.SetDomain(-1000000, 10000000, -1000000, 10000000);
  // spatialReference.SetMDomain(0, 1); 
  spatialReference.SetMFalseOriginAndUnits(1, 1);
  // spatialReference.SetZDomain(0, 1);
  spatialReference.SetZFalseOriginAndUnits(1, 1);
  // Create a new SDE workspace 
  IWorkspaceFactory sdeWorkspaceFactory = new SdeWorkspaceFactoryClass();
  IWorkspace workspace = sdeWorkspaceFactory.OpenFromFile("C:\\Documents and Settings\\bast5010\\Application Data\\ESRI\\ArcCatalog\\Connection to Vampire.sde", 0);
  IFeatureWorkspace sdeFeatureWorkspace = workspace as IFeatureWorkspace;
  //Create the fields for the feature dataset 
  IFields fields = new FieldsClass();
  IFieldsEdit fieldsEdit = fields as IFieldsEdit; 
  IField field = new FieldClass(); 
  IFieldEdit fieldEdit = field as IFieldEdit;
  fieldEdit.Type_2 = esriFieldType.esriFieldTypeOID; 
  fieldEdit.IsNullable_2 = false;
  fieldEdit.Name_2 = "OID"; 
  fieldsEdit.AddField(fieldEdit);
  IGeometryDefEdit geometryDefEdit = new GeometryDefClass();
  geometryDefEdit.GeometryType_2 = esriGeometryType.esriGeometryPolygon; 
  geometryDefEdit.GridCount_2 = 1; 
  geometryDefEdit.set_GridSize(0, 1000);
  geometryDefEdit.SpatialReference_2 = spatialReference; 
 
  fieldEdit = new FieldClass();
  fieldEdit.Name_2 = "Shape";
  fieldEdit.IsNullable_2 = true;
  fieldEdit.Type_2 = esriFieldType.esriFieldTypeGeometry;
  fieldEdit.GeometryDef_2 = geometryDefEdit; 
   
  fieldsEdit.AddField(fieldEdit);

  fieldEdit = new FieldClass();
   
  fieldEdit.Name_2 = "Test_Field";
  fieldEdit.IsNullable_2 = true;
  fieldEdit.Editable_2 = true;
  fieldEdit.Length_2 = 25;
  fieldEdit.Type_2 = esriFieldType.esriFieldTypeString;
   
  fieldsEdit.AddField(fieldEdit);
  //Create a UID for the CreateFeatureClass method 
  UID uid = new UIDClass();
  uid.Generate();
  //Create ExtCLSID as for CreateFeatureClass method 
  UID uidExt = new UIDClass();
  uidExt.Generate();
   
  //Create the feature class for the feature dataset
  IFeatureClass featureClass = sdeFeatureWorkspace.CreateFeatureClass("PreDef_StateNAD83", fields, null, null, esriFeatureType.esriFTSimple, "Shape", ""); 
  System.Windows.Forms.MessageBox.Show("Data Creation Complete", "Program Status");
}
 
  JU

 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Converting Degrees Minutes Seconds to Decimal Degrees (DMS to DD) 
Author Janey Smith 
Date Jun 05, 2009 
Message Thanks! I think that will work.