Code Monkey home page Code Monkey logo

Comments (4)

16EAGLE avatar 16EAGLE commented on August 24, 2024

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.

from movevis.

StephPeriquet avatar StephPeriquet commented on August 24, 2024

from movevis.

MatteoSebastianelli avatar MatteoSebastianelli commented on August 24, 2024

Hi all,
I'm also working with my own dataset (in LongLat format) and I'm getting a similar error message when trying to align my movement data with align_move(). My code is as following:

R.move<-move(as.numeric(R.ready$Longitude.decimal),as.numeric(R.ready$Latitude.decimal),
time = R.ready$Timestamp.1,
proj="+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0")
unique(timestamps(R.move))
timeLag(R.move,unit="mins")
m<-align_move(R.move, res = 1200, unit = "mins")

When I run this i get the following Error message:

Error in .pointsToMatrix(p1) : latitude > 90
In addition: Warning message:
In .pointsToMatrix(p1) : longitude > 180

Cannot figure out what is wrong here. Hope you can help me. See the data attached.
Many thanks in advance!
Matteo

Move_sample.txt

from movevis.

16EAGLE avatar 16EAGLE commented on August 24, 2024

please see #69

from movevis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.