-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in .pointsToMatrix(p1) : longitude > 360 after projecting data #42
Comments
Hi, the default interpolation method used by library(moveVis)
library(move)
df <- read.csv("dev/user_data/test_file.txt", sep = ";", stringsAsFactors = F)
df$Local <- as.POSIXct(df$Local)
move_data <- df2move(df, x = "long", y = "lat", proj = crs("+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"),
time = "Local", track_id= "name")
move_data <- align_move(move_data, res = 60, digit = "mean", unit = "mins")
move_data <- sp::spTransform(move_data, crs("+proj=utm +zone=33 +south +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0 ")) To stick to the order you applied, you need to switch library(moveVis)
library(move)
df <- read.csv("dev/user_data/test_file.txt", sep = ";", stringsAsFactors = F)
df$Local <- as.POSIXct(df$Local)
move_data <- df2move(df, x = "long", y = "lat", proj = crs("+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"),
time = "Local", track_id= "name")
move_data <- sp::spTransform(move_data, crs("+proj=utm +zone=33 +south +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0 "))
move_data <- align_move(move_data, res = 60, digit = "mean", unit = "mins",
spaceMethod = "euclidean") I hope this helps. I will replace the current error message with something pointing the user towards changing |
Hi there,
Ahaha thx that makes sense, haven't thought about that!
Thanks a lot for the speedy reply!
Best,
Stephanie
…On 12/03/2019 12:59, J. Schwalb-Willmann wrote:
Hi, the default interpolation method used by |align_move| is
|greatcircle| which cannot be used with tracks not projected as
lat/lon. Thus, if you want to use |greatcricle|, you could first align
your data and then reproject them:
library(moveVis)
library(move)
df <- read.csv("dev/user_data/test_file.txt",sep = ";",stringsAsFactors = F)
df$Local <- as.POSIXct(df$Local)
move_data <- df2move(df,x = "long",y = "lat",proj = crs("+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84
+towgs84=0,0,0"),
time = "Local",track_id= "name")
move_data <- align_move(move_data,res = 60,digit = "mean",unit = "mins")
move_data <- sp::spTransform(move_data, crs("+proj=utm +zone=33 +south +datum=WGS84 +units=m +no_defs +ellps=WGS84
+towgs84=0,0,0 "))
To stick to the order you applied, you need to switch |spaceMethod| to
|euclidean|:
library(moveVis)
library(move)
df <- read.csv("dev/user_data/test_file.txt",sep = ";",stringsAsFactors = F)
df$Local <- as.POSIXct(df$Local)
move_data <- df2move(df,x = "long",y = "lat",proj = crs("+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84
+towgs84=0,0,0"),
time = "Local",track_id= "name")
move_data <- sp::spTransform(move_data, crs("+proj=utm +zone=33 +south +datum=WGS84 +units=m +no_defs +ellps=WGS84
+towgs84=0,0,0 "))
move_data <- align_move(move_data,res = 60,digit = "mean",unit = "mins",
spaceMethod = "euclidean")
I hope this helps. I will replace the current error message with
something pointing the user towards changing |spaceMethod|.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#42 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AX-BebpyWXsNB3VzXYnlvfSw1PA8Lk7iks5vV4ikgaJpZM4bqZqD>.
|
Hi all, R.move<-move(as.numeric(R.ready$Longitude.decimal),as.numeric(R.ready$Latitude.decimal), When I run this i get the following Error message: Error in .pointsToMatrix(p1) : latitude > 90 Cannot figure out what is wrong here. Hope you can help me. See the data attached. |
please see #69 |
Hi there,
I am trying to work with my own dataset and I have issue with move_align() after projecting my data using spTransform. My initial data in LatLong format and I would like to plot it in UTM. Here is the code I used:
move_data <- df2move(d1, x="long",y="lat", proj="+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0", time = "Local", track_id="name")
move_data <- sp::spTransform(move_data, crs("+proj=utm +zone=33 +south +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0 "))
move_data1 <- align_move(move_data, res = 60, digit = "mean", unit = "mins")
Which result in the following error:
Error in .pointsToMatrix(p1) : longitude > 360
If I used the already projected data
move_data <- df2move(d1, x="x",y="y", proj="+proj=utm +zone=33 +south +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0 ", time = "Local", track_id="name")
move_data1 <- align_move(move_data, res = 60, digit = "mean", unit = "mins")
It results in the same error...
I did check and all the long, lat, x and y columns are numeric not factors.
What am I getting wrong?
Attached is a sample of my data.
Thanks in advance for the help!
Stephanie
test_file.txt
The text was updated successfully, but these errors were encountered: