3

I have a number of (long, lat) points as plotted below:

ggplot(data=transect,aes(x=long,y=lat)) + 
  geom_point( )

enter image description here I have posted the raw data below. I would like to fit a smooth spatial line through these points, in r. I thought there would be a nice r function, but I cannot seem to find anything that plots a smooth curve.

Data below:

structure(list(lat = c(-1.384, -1.38, -1.38, -1.375, -1.375, 
-1.375, -1.384, -1.384, -1.384, -1.384, -1.382, -1.377, -1.376, 
-1.384, -1.384, -1.384, -1.384, -1.382, -1.382, -1.381, -1.384, 
-1.384, -1.381, -1.381, -1.381, -1.381, -1.38, -1.38, -1.379, 
-1.379, -1.378, -1.378, -1.375, -1.384, -1.384, -1.384, -1.384, 
-1.381, -1.379, -1.379, -1.378, -1.375, -1.376, -1.384, -1.384, 
-1.384, -1.384, -1.384, -1.384, -1.384, -1.384, -1.384, -1.383, 
-1.383, -1.382, -1.382, -1.381, -1.38, -1.379, -1.379, -1.378, 
-1.378, -1.377, -1.375, -1.384, -1.384, -1.384, -1.384, -1.377, 
-1.376, -1.376, -1.376, -1.375, -1.38, -1.38, -1.38, -1.38, -1.378, 
-1.378, -1.377, -1.383, -1.384, -1.385, -1.385, -1.386, -1.384, 
-1.384, -1.384, -1.384, -1.384, -1.383, -1.383, -1.384, -1.382, 
-1.382, -1.381, -1.381, -1.381, -1.381, -1.381, -1.379, -1.379, 
-1.378, -1.378, -1.378, -1.378, -1.377, -1.377, -1.377, -1.377, 
-1.376, -1.376, -1.375, -1.375, -1.375, -1.374, -1.375, -1.374, 
-1.374, -1.384, -1.384, -1.384, -1.384, -1.382, -1.382, -1.382, 
-1.381, -1.379, -1.378, -1.377, -1.377, -1.377, -1.375, -1.375, 
-1.384, -1.384, -1.384, -1.384, -1.383, -1.381, -1.382, -1.38, 
-1.379, -1.379, -1.377, -1.376, -1.375, -1.384, -1.384, -1.384, 
-1.384, -1.384, -1.384, -1.384, -1.384, -1.384, -1.384, -1.383, 
-1.383, -1.383, -1.383, -1.382, -1.377, -1.377, -1.377, -1.377, 
-1.377, -1.384, -1.384, -1.384, -1.384, -1.383, -1.382, -1.382, 
-1.382, -1.381, -1.381, -1.381, -1.38, -1.379, -1.377, -1.375, 
-1.38388, -1.38384, -1.38386, -1.38386, -1.38365, -1.38393, -1.38393, 
-1.38366, -1.38368, -1.38358, -1.38358, -1.38358, -1.38358, -1.38313, 
-1.38307, -1.38251, -1.38267, -1.3824, -1.38148, -1.38156, -1.37967, 
-1.37968, -1.37926, -1.37857, -1.37772, -1.37699, -1.37662, -1.37615, 
-1.37521, -1.37525, -1.38383, -1.38383, -1.38383, -1.38383, -1.38383, 
-1.38383, -1.38397, -1.38382, -1.38365, -1.38364, -1.38353, -1.38352, 
-1.38356, -1.38356, -1.38356, -1.3826, -1.38171, -1.38008, -1.3801, 
-1.3801, -1.38008, -1.3801, -1.37797, -1.37797, -1.37797, -1.37473, 
-1.37472, -1.38394, -1.38394, -1.38394, -1.38394, -1.38394, -1.38394, 
-1.38406, -1.38406, -1.38397, -1.38397, -1.38397, -1.38397, -1.3838, 
-1.3838, -1.3838, -1.3838, -1.3838, -1.38386, -1.38384, -1.38372, 
-1.38351, -1.38111, -1.38116, -1.37887, -1.37883, -1.37883, -1.37883, 
-1.37883, -1.37528, -1.37528, -1.37528, -1.37473, -1.384, -1.384, 
-1.384, -1.384, -1.384, -1.384, -1.384, -1.384, -1.384, -1.384, 
-1.383, -1.383, -1.381, -1.381, -1.381, -1.38, -1.38, -1.38, 
-1.378, -1.378, -1.378, -1.378, -1.378, -1.378, -1.376, -1.376, 
-1.376, -1.376, -1.375, -1.375, -1.38357, -1.38347, -1.38303, 
-1.38269, -1.38202, -1.38021, -1.3802, -1.37804, -1.37761, -1.37762, 
-1.37696, -1.37517, -1.37517, -1.37517, -1.384, -1.384, -1.384, 
-1.384, -1.383, -1.383, -1.384, -1.384, -1.383, -1.383, -1.383, 
-1.383, -1.382, -1.382, -1.382, -1.382, -1.38, -1.38, -1.38, 
-1.38, -1.38, -1.379, -1.379, -1.378, -1.378, -1.378, -1.378, 
-1.378, -1.377, -1.377, -1.377, -1.376, -1.376, -1.376, -1.375, 
-1.375, -1.375, -1.375, -1.375, -1.3838, -1.3838, -1.38396, -1.38396, 
-1.38396, -1.38396, -1.38393, -1.38378, -1.38378, -1.38348, -1.38349, 
-1.38346, -1.3835, -1.3835, -1.3835, -1.3838, -1.38377, -1.384, 
-1.384, -1.384, -1.384, -1.384, -1.384, -1.384, -1.383, -1.383, 
-1.383, -1.383, -1.383, -1.384, -1.383, -1.383, -1.383, -1.383, 
-1.382, -1.382, -1.382, -1.382, -1.382, -1.382, -1.381, -1.38, 
-1.38, -1.38, -1.38, -1.38, -1.38, -1.379, -1.379, -1.378, -1.377, 
-1.377, -1.377, -1.377, -1.375, -1.375, -1.375, -1.375, -1.384, 
-1.384, -1.384, -1.384, -1.384, -1.384, -1.383, -1.383, -1.381, 
-1.38, -1.378, -1.377, -1.377, -1.375, -1.375, -1.375, -1.384, 
-1.384, -1.384, -1.384, -1.384, -1.384, -1.383, -1.383, -1.383, 
-1.381, -1.381, -1.378, -1.378, -1.378, -1.375, -1.375, -1.375, 
-1.384, -1.384, -1.384, -1.384, -1.384, -1.384, -1.384, -1.384, 
-1.384, -1.384, -1.384, -1.384, -1.383, -1.383, -1.383, -1.383, 
-1.383, -1.382, -1.382, -1.382, -1.382, -1.381, -1.38, -1.38, 
-1.378, -1.378, -1.378, -1.378, -1.378, -1.378, -1.378, -1.378, 
-1.378, -1.377, -1.377, -1.377, -1.377, -1.375, -1.375, -1.375, 
-1.375, -1.375, -1.38385, -1.38381, -1.38167, -1.3816, -1.3814, 
-1.37957, -1.37777, -1.37522, -1.37523, -1.37523, -1.3747, -1.38398, 
-1.38378, -1.3836, -1.38361, -1.37953, -1.37716, -1.3771, -1.37477, 
-1.37473, -1.37476, -1.38647, -1.38402, -1.38395, -1.38381, -1.38358, 
-1.38358, -1.38358, -1.38357, -1.3834, -1.38333, -1.38296, -1.38295, 
-1.38296, -1.38296, -1.3817, -1.38171, -1.3817, -1.38168, -1.3817, 
-1.38063, -1.38064, -1.38065, -1.37999, -1.38, -1.38, -1.37999, 
-1.38001, -1.38, -1.37872, -1.37872, -1.37769, -1.37772, -1.37703, 
-1.37702, -1.37702, -1.37666, -1.37664, -1.37607, -1.37607, -1.37609, 
-1.37544, -1.37543, -1.37544, -1.37544, -1.37546, -1.37476, -1.37477, 
-1.38381, -1.38384, -1.38382, -1.38382, -1.38381, -1.38386, -1.38397, 
-1.38377, -1.3838, -1.38381, -1.38377, -1.38378, -1.38354, -1.38357, 
-1.38356, -1.38356, -1.38355, -1.38334, -1.38331, -1.38304, -1.38306, 
-1.38306, -1.38258, -1.38259, -1.38259, -1.38258, -1.38258, -1.3826, 
-1.38214, -1.38214, -1.38214, -1.38073, -1.38002, -1.38001, -1.38001, 
-1.38002, -1.37938, -1.37767, -1.37766, -1.37766, -1.37689, -1.37686, 
-1.37552, -1.37553, -1.38551, -1.38381, -1.38395, -1.38394, -1.38392, 
-1.38377, -1.38364, -1.38356, -1.38356, -1.38356, -1.38354, -1.38355, 
-1.38302, -1.38291, -1.3829, -1.38274, -1.38259, -1.38258, -1.38176, 
-1.38169, -1.38135, -1.3814, -1.38, -1.38, -1.37898, -1.37896, 
-1.37842, -1.37664, -1.37636, -1.37579, -1.37514, -1.37516, -1.37513, 
-1.3838, -1.38402, -1.384, -1.38395, -1.38397, -1.38396, -1.3838, 
-1.3838, -1.38378, -1.38354, -1.37868, -1.37875, -1.37872, -1.37874, 
-1.37666, -1.37668, -1.37532, -1.3753, -1.37531, -1.37535, -1.37454, 
-1.384, -1.384, -1.383, -1.38388, -1.38385, -1.38404, -1.38396, 
-1.38396, -1.38396, -1.38396, -1.38369, -1.38378, -1.38378, -1.38356, 
-1.38363, -1.38363, -1.38363, -1.38359, -1.38235, -1.38029, -1.37945, 
-1.37942, -1.37864, -1.37822, -1.37721, -1.37677, -1.37475, -1.37478, 
-1.37478, -1.38379, -1.38379, -1.3838, -1.38379, -1.38378, -1.38369, 
-1.38368, -1.38358, -1.38358, -1.38358, -1.38344, -1.38303, -1.38305, 
-1.38263, -1.38262, -1.38262, -1.38238, -1.38237, -1.38238, -1.38182, 
-1.38097, -1.38014, -1.38014, -1.38014, -1.37996, -1.37868, -1.3787, 
-1.37869, -1.37736, -1.37701, -1.38378, -1.3838, -1.38385, -1.38385, 
-1.38388, -1.37553, -1.37518, -1.3838, -1.38391, -1.3839, -1.38393, 
-1.38413, -1.38396, -1.38408, -1.38408, -1.38403, -1.38403, -1.38403, 
-1.38403, -1.38376, -1.38356, -1.38363, -1.38349, -1.38363, -1.38373, 
-1.38345, -1.38322, -1.38192, -1.38177, -1.38039, -1.37928, -1.37909, 
-1.3784, -1.37811, -1.37793, -1.37793, -1.37793, -1.37724, -1.37536, 
-1.37522, -1.37522, -1.38382, -1.38379, -1.38383, -1.38383, -1.38381, 
-1.38381, -1.38382, -1.38383, -1.38381, -1.38381, -1.38382, -1.3838, 
-1.3838, -1.38381, -1.38379, -1.38381, -1.38379, -1.38379, -1.38379, 
-1.38379, -1.38378, -1.38354, -1.38355, -1.38356, -1.38358, -1.38356, 
-1.38308, -1.38306, -1.38312, -1.38252, -1.38248, -1.38248, -1.38249, 
-1.38251, -1.3825, -1.3825, -1.38052, -1.38054, -1.37957, -1.37957, 
-1.37856, -1.3785, -1.37854, -1.37857, -1.37856, -1.37818, -1.37816, 
-1.37816, -1.377, -1.37698, -1.377, -1.37695, -1.37701, -1.37697, 
-1.37698, -1.3752, -1.37524, -1.37522, -1.37522, -1.37522, -1.37521, 
-1.3752), long = c(35.387, 35.393, 35.393, 35.388, 35.388, 35.387, 
35.387, 35.387, 35.39, 35.391, 35.393, 35.39, 35.389, 35.387, 
35.39, 35.391, 35.391, 35.393, 35.393, 35.393, 35.387, 35.388, 
35.393, 35.393, 35.393, 35.393, 35.393, 35.393, 35.392, 35.392, 
35.392, 35.392, 35.389, 35.387, 35.387, 35.387, 35.387, 35.393, 
35.392, 35.392, 35.392, 35.387, 35.387, 35.387, 35.387, 35.387, 
35.387, 35.389, 35.389, 35.389, 35.389, 35.39, 35.391, 35.393, 
35.393, 35.393, 35.393, 35.393, 35.392, 35.392, 35.392, 35.392, 
35.391, 35.388, 35.387, 35.387, 35.388, 35.388, 35.39, 35.39, 
35.389, 35.389, 35.388, 35.393, 35.393, 35.393, 35.393, 35.392, 
35.392, 35.391, 35.39, 35.388, 35.387, 35.388, 35.388, 35.388, 
35.388, 35.388, 35.388, 35.389, 35.392, 35.392, 35.392, 35.393, 
35.393, 35.393, 35.393, 35.393, 35.393, 35.393, 35.392, 35.392, 
35.392, 35.392, 35.392, 35.392, 35.39, 35.39, 35.39, 35.39, 35.39, 
35.389, 35.389, 35.389, 35.389, 35.387, 35.388, 35.389, 35.388, 
35.387, 35.387, 35.389, 35.391, 35.393, 35.393, 35.393, 35.393, 
35.393, 35.392, 35.391, 35.39, 35.39, 35.389, 35.388, 35.387, 
35.387, 35.387, 35.39, 35.392, 35.393, 35.393, 35.393, 35.392, 
35.392, 35.391, 35.389, 35.387, 35.387, 35.388, 35.388, 35.388, 
35.388, 35.388, 35.39, 35.39, 35.39, 35.39, 35.392, 35.392, 35.393, 
35.393, 35.393, 35.391, 35.391, 35.39, 35.39, 35.39, 35.388, 
35.389, 35.388, 35.392, 35.393, 35.393, 35.393, 35.393, 35.393, 
35.393, 35.393, 35.393, 35.393, 35.39, 35.388, 35.38702, 35.38703, 
35.38688, 35.38688, 35.38903, 35.38926, 35.38956, 35.39033, 35.39031, 
35.39082, 35.39082, 35.39082, 35.39082, 35.39235, 35.39238, 35.39285, 
35.39295, 35.39298, 35.39317, 35.39319, 35.39289, 35.39289, 35.39275, 
35.39245, 35.39189, 35.39077, 35.39047, 35.38973, 35.38855, 35.38849, 
35.38687, 35.38687, 35.38687, 35.38687, 35.38687, 35.38687, 35.38835, 
35.38943, 35.39001, 35.39002, 35.39031, 35.39096, 35.39095, 35.39095, 
35.39095, 35.39284, 35.39316, 35.39305, 35.39306, 35.39303, 35.39303, 
35.39306, 35.39192, 35.39192, 35.39192, 35.38738, 35.38739, 35.38683, 
35.38683, 35.38683, 35.38683, 35.38683, 35.38683, 35.38817, 35.38817, 
35.3882, 35.3882, 35.3882, 35.3882, 35.3895, 35.3895, 35.3895, 
35.3895, 35.3895, 35.38968, 35.39004, 35.39086, 35.39101, 35.39317, 
35.39315, 35.39234, 35.39243, 35.39243, 35.39243, 35.39243, 35.38853, 
35.38853, 35.38853, 35.38735, 35.387, 35.387, 35.387, 35.387, 
35.388, 35.388, 35.388, 35.388, 35.389, 35.391, 35.392, 35.392, 
35.393, 35.393, 35.393, 35.393, 35.393, 35.393, 35.392, 35.392, 
35.392, 35.392, 35.392, 35.392, 35.39, 35.39, 35.389, 35.389, 
35.387, 35.387, 35.39012, 35.39166, 35.39237, 35.39279, 35.39318, 
35.39308, 35.39308, 35.39193, 35.39162, 35.39166, 35.39083, 35.38847, 
35.38847, 35.38847, 35.387, 35.387, 35.388, 35.388, 35.39, 35.39, 
35.392, 35.392, 35.393, 35.393, 35.393, 35.393, 35.393, 35.393, 
35.393, 35.393, 35.393, 35.393, 35.393, 35.393, 35.393, 35.393, 
35.393, 35.392, 35.392, 35.392, 35.392, 35.392, 35.391, 35.391, 
35.391, 35.39, 35.39, 35.389, 35.388, 35.388, 35.388, 35.388, 
35.387, 35.38687, 35.38687, 35.38755, 35.38755, 35.38755, 35.38755, 
35.38786, 35.38932, 35.38932, 35.39029, 35.3903, 35.3903, 35.39162, 
35.39162, 35.39162, 35.38687, 35.38874, 35.387, 35.387, 35.387, 
35.387, 35.388, 35.388, 35.388, 35.39, 35.39, 35.39, 35.39, 35.39, 
35.391, 35.392, 35.392, 35.392, 35.393, 35.393, 35.393, 35.393, 
35.393, 35.393, 35.393, 35.393, 35.393, 35.393, 35.393, 35.393, 
35.393, 35.393, 35.393, 35.393, 35.392, 35.391, 35.391, 35.39, 
35.39, 35.388, 35.387, 35.387, 35.387, 35.387, 35.388, 35.389, 
35.39, 35.39, 35.391, 35.393, 35.393, 35.393, 35.393, 35.392, 
35.391, 35.391, 35.389, 35.389, 35.389, 35.387, 35.387, 35.387, 
35.39, 35.39, 35.39, 35.392, 35.392, 35.392, 35.393, 35.393, 
35.392, 35.392, 35.392, 35.389, 35.389, 35.389, 35.387, 35.387, 
35.388, 35.389, 35.389, 35.389, 35.389, 35.39, 35.39, 35.39, 
35.391, 35.391, 35.392, 35.393, 35.393, 35.393, 35.393, 35.393, 
35.393, 35.393, 35.393, 35.393, 35.393, 35.393, 35.392, 35.392, 
35.392, 35.392, 35.392, 35.392, 35.392, 35.392, 35.392, 35.391, 
35.391, 35.391, 35.391, 35.389, 35.389, 35.388, 35.388, 35.388, 
35.38688, 35.3894, 35.39325, 35.3931, 35.3933, 35.39275, 35.39175, 
35.38843, 35.38848, 35.38848, 35.38802, 35.3876, 35.38947, 35.39013, 
35.39013, 35.39286, 35.39108, 35.391, 35.38808, 35.38736, 35.38738, 
35.38561, 35.38785, 35.38782, 35.38874, 35.39086, 35.39091, 35.39088, 
35.39088, 35.39188, 35.39199, 35.39254, 35.39255, 35.39254, 35.39259, 
35.39317, 35.39315, 35.39314, 35.39316, 35.39317, 35.39328, 35.3933, 
35.39328, 35.39304, 35.39304, 35.39304, 35.39303, 35.39304, 35.39304, 
35.39223, 35.39225, 35.39168, 35.39167, 35.3909, 35.39088, 35.39088, 
35.39029, 35.3903, 35.38946, 35.38946, 35.38947, 35.38862, 35.3886, 
35.38864, 35.3886, 35.38861, 35.38804, 35.38805, 35.38687, 35.3869, 
35.38689, 35.38688, 35.38688, 35.38716, 35.38781, 35.38934, 35.38934, 
35.38935, 35.38936, 35.38938, 35.39081, 35.3908, 35.39082, 35.39077, 
35.39078, 35.39197, 35.39198, 35.39238, 35.39235, 35.39236, 35.39288, 
35.39288, 35.39288, 35.39289, 35.39288, 35.39288, 35.39329, 35.3933, 
35.39333, 35.3933, 35.39306, 35.39307, 35.3931, 35.39307, 35.39275, 
35.3917, 35.39168, 35.39168, 35.39074, 35.39075, 35.38874, 35.38872, 
35.38597, 35.3869, 35.38783, 35.38788, 35.38783, 35.38947, 35.39002, 
35.3912, 35.39124, 35.39119, 35.39121, 35.39119, 35.39241, 35.39258, 
35.39257, 35.39274, 35.39286, 35.39282, 35.39321, 35.39321, 35.39318, 
35.39328, 35.39305, 35.39308, 35.39243, 35.39242, 35.39216, 35.39042, 
35.39, 35.38908, 35.38849, 35.38849, 35.38844, 35.38683, 35.38761, 
35.38758, 35.38798, 35.3879, 35.38793, 35.38904, 35.38908, 35.38904, 
35.39165, 35.39226, 35.39225, 35.39224, 35.39226, 35.39045, 35.39047, 
35.38857, 35.3886, 35.3886, 35.38856, 35.38776, 35.388, 35.388, 
35.392, 35.38678, 35.38669, 35.388, 35.3881, 35.3881, 35.3881, 
35.3881, 35.38988, 35.38984, 35.38984, 35.39002, 35.39127, 35.39127, 
35.39127, 35.39158, 35.39335, 35.3931, 35.39278, 35.39286, 35.39204, 
35.39213, 35.39117, 35.3905, 35.38751, 35.38734, 35.38734, 35.38876, 
35.38877, 35.38876, 35.38877, 35.38877, 35.38997, 35.38998, 35.3912, 
35.3912, 35.3912, 35.3918, 35.39242, 35.39244, 35.39287, 35.39286, 
35.39285, 35.39317, 35.39314, 35.39316, 35.39316, 35.3932, 35.39307, 
35.39309, 35.39308, 35.39305, 35.39225, 35.39226, 35.39228, 35.39134, 
35.39095, 35.38687, 35.38689, 35.38724, 35.38727, 35.3874, 35.38874, 
35.38847, 35.3869, 35.38737, 35.38736, 35.38737, 35.38739, 35.38755, 
35.38806, 35.38806, 35.38813, 35.38813, 35.38813, 35.38813, 35.38867, 
35.39024, 35.39093, 35.39094, 35.39077, 35.39078, 35.39183, 35.39206, 
35.39342, 35.39344, 35.39359, 35.39269, 35.39244, 35.39235, 35.39225, 
35.39191, 35.39191, 35.39191, 35.3912, 35.38856, 35.38866, 35.38866, 
35.3868, 35.38685, 35.38684, 35.38685, 35.38682, 35.38687, 35.38686, 
35.38685, 35.38686, 35.38684, 35.3868, 35.38873, 35.3887, 35.38868, 
35.38874, 35.38869, 35.38952, 35.38944, 35.38948, 35.38952, 35.38948, 
35.39118, 35.39114, 35.3912, 35.39116, 35.39118, 35.39228, 35.39234, 
35.39232, 35.39295, 35.39298, 35.393, 35.39298, 35.39297, 35.39296, 
35.39298, 35.39326, 35.39324, 35.39287, 35.39286, 35.3924, 35.3924, 
35.3924, 35.39239, 35.39238, 35.39218, 35.39216, 35.3922, 35.39088, 
35.39087, 35.3909, 35.39089, 35.39088, 35.39087, 35.39092, 35.3885, 
35.3885, 35.3885, 35.38852, 35.3885, 35.3885, 35.3885)), class = "data.frame", row.names = c(NA, 
-815L))
6

This is quite easy with the base smooth.spline function or principal_curve in the princurve package. You may want to also explore the loess/lowess local polynomial regression functions. Here is an example with your data. Note that I reorder the columns to make the matrix coercion simpler. You can see that principal_curve shifts the curve a bit but finds the tails more effectively than smooth.spline. Exploring smoothing parameters may help you find an optimal solution.

x <- data.frame(long=x[,2],lat=x[,1])
  fit <- princurve::principal_curve(as.matrix(x))
  sfit <- smooth.spline(x[,1] ~ x[,2], spar=0.80)

plot(x[,1], x[,2], pch=19, main="Curve fit(s) of coordinates", 
     xlab="longitude", ylab="latitude", cex=0.50)
    lines(princurve::principal_curve(as.matrix(x)), lwd=1.25, col="red")
    lines(sfit$y, sfit$x, lwd=1.25, col="blue")
legend("bottomright", legend=c("spline","princurve"),
       lty=c(1,1), col=c("blue","red"))

enter image description here

1
  • 1
    Nice. I note its only 1 degree below the equator so the aspect ratio is pretty close to one - if this data was nearer the poles a reprojection to a cartesian system might be appropriate and change the result slightly. – Spacedman Aug 29 '19 at 17:28
0

ggplot2 has a geom for this called geom_smooth. The default curve is a loess line, which is similar to a moving average across the x-axis. This can be changed and fed formula as well.

library(tidyverse)



ggplot(data=transect,aes(x=long,y=lat)) + 
    geom_point( )+
    geom_smooth()

enter image description here

7
  • 1
    The problem here is that the data does not describe a functional relationship of the form y=f(x) and so most standard curve fitting or smoothing algorithms will blindly run down the middle of the presented data and not draw the obvious (to our eyes) curve. – Spacedman Aug 29 '19 at 9:41
  • Yes. There is no explicit formula as such - but it effective it is a parabola – Anthony W Aug 29 '19 at 9:55
  • 2
    Its a rotated parabola. If you want to fit a rotated parabola to your data then please edit your question to be explicit in that. – Spacedman Aug 29 '19 at 10:00
  • Given the imprecision of the OP's question, this answer is correct. Whoever down-voted should reconsider. – Tom Aug 29 '19 at 15:01
  • This does not look like "Fit a smooth spatial line through these points" given that it clearly isnt "through these points2. It looks like treating the latitude as a function of longitude and fitting a spline to that function. Happy to reconsider once the OP comments - but the other answers look more like I reckon is wanted. – Spacedman Aug 29 '19 at 17:25
0

I found this that seems to work very well...

https://stats.stackexchange.com/questions/271161/2d-curve-identification-and-smoothing?noredirect=1&lq=1

This was the outcome on the data:

enter image description here

2
  • 1
    This answer neither contains code nor addresses the question as asked. Please update your question to clarify your goal, and then provide your solution code in the answer. – Tom Aug 29 '19 at 15:03
  • Please avoid linked answers as sites tend to disappear with time. – Jeffrey Evans Aug 29 '19 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.