Hi,
In my previous power BI project, I had a small R code that run run inside power query to convert UTM coordinates to Latitude and Longitude. Now for my new project in the Philippines are not UTM anymore rather the coordinates are PRS92 zone3 Philippines (EPSG 3123) therefore my code project them wrongly. As Rstudio beginner I was not able to modify my code. Maybe someone here can help me out? Below I pasted my code and coordinate samples that need to be converted to Lat, Long decimal degrees.
My code:
library(proj4)
library(tidyverse)
library(tseries)
library(leaflet)
mydata<-dataset
proj4string <- "+proj=PRS92 +zone=3 +north +ellps=EPSG3123 +datum=EPSG3123 +units=m +no_defs "
#xy <- data.frame(x=dataset$cutterPosE, y=dataset$cutterPosN)
pj <- project(data.frame(x=dataset$cutterPosE, y=dataset$cutterPosN), proj4string, inverse=TRUE)
mydata$latcutter<-pj$y
mydata$longcutter<-pj$x
Sample data:
cutterPosE [m] cutterPosN [m]
480848.47 1626260.92
480880.04 1626224.18
480888.28 1626211.29
480836.18 1626272.29
480796.59 1626288.83
480796.32 1626290.92
480833.81 1626276.47
480852.1 1626264.81
480852.48 1626264.42
480852.4 1626264.27
480852.52 1626264.39
480854.54 1626262.38
480877.56 1626234.8
480890.4 1626212.89
480881.72 1626232.5
480847.66 1626269.58
480805.09 1626290.04
480794.27 1626294.21
480826.56 1626284.35
480869.07 1626253.11
480890.82 1626220.83