Convert Arcminute / Second to decimal (irregular format)

تعرفه تبلیغات در سایت
عنوان عکس عنوان عکس عنوان عکس عنوان عکس
عنوان عکس عنوان عکس عنوان عکس عنوان عکس
عنوان عکس عنوان عکس عنوان عکس عنوان عکس
عنوان عکس عنوان عکس عنوان عکس عنوان عکس
عنوان عکس عنوان عکس عنوان عکس عنوان عکس

آرشیو مطالب

جستجوگر

یافته ها در جستجو

    امکانات وب

    برچسب ها

    Vote count: 0

    I'm dealing with some irregular and poorly thought through data with GPS coordinates and I need to make them more useable and pipeable.

    I've been basing my work on the angle2dec function that I found on here:

    angle2dec <- function(angle) {
      angle <- as.character(angle)
      x <- do.call(rbind, strsplit(angle, split=' '))
    
      #decimal points where they should and should not be here
      #causes my issue as i can't use a consistent string split
      #character.  splitting the first 3 '.' occurrences might work
    
      x <- apply(x, 1L, function(y) {
        y <- as.numeric(y)
        y[1] + y[2]/60 + y[3]/3600
      })
      return(x)
    }
    

    However my data is not nicely formatted. A coordinate looks like this:

    '53.17.35.852'
    

    The ang2dec function works for coordinates that follow this format:

    ang2dec('53 17 35.852') = 53.29329
    

    (This is the correct result)

    Clearly the problem is the poor choice of formatting of the coordinate. Can anyone suggest a way that I can convert the first format of coordinate into the second or propose changes to the ang2dec function that would include the functionality that I am looking for?

    asked 11 secs ago

  • مطالب مرتبط
  • libx264 encoded video lags by few seconds in comparison to audio
  • How can i add 1 second delay for JavaScript loop?
  • Error:(31, 40) error: incompatible types: android.support.v4.app.Fragment cannot be converted to android.app.Fragment
  • CameraView black on when being used for second time
  • Converting a sentence into an array and editing the first letter of each value within the array
  • Need to convert SQL output into Line Protocol using python
  • نویسنده : استخدام کار بازدید : 52 تاريخ : چهارشنبه 27 ارديبهشت 1396 ساعت: 21:57
    برچسب‌ها :