[R-sig-Geo] Height transformation (ellipsoidal to EGM2008)
inti luna
|nt|@|un@@r@g|@ @end|ng |rom gm@||@com
Wed Jul 27 01:46:34 CEST 2022
Hi all,
I have a table with data points with CRS EPSG 4326 and ellipsoidal height
(m) and would like to transform it to another CRS. Target horizontal is
EPSG: 25831 and target height is based on EGM2008 (EPSG 3855).
I have carried the horizontal transformation with the sf package but I
don´t know how to perform the height transformation. Any guidance is
appreciated. I have been checking
https://keen-swartz-3146c4.netlify.app/sf.html#st_transform-sf_project but
still have not found information about height transformation
Repex
library(sf)
#create sample dataset
data1<-"Name,Longitude,Latitude,Ellipsoidal_height
gcp1,2.32152788,41.75758799,1235.577
gcp2,2.32129905,41.75757489,1234.38
gcp3,2.3212163,41.75760007,1233.49
gcp4,2.32165884,41.75765011,1235.785
gcp5,2.32163868,41.75764588,1235.741
gcp6,2.32167394,41.75793979,1236.763
gcp7,2.32118573,41.75769993,1232.364
gcp8,2.32115307,41.75770638,1231.897
gcp9,2.32097163,41.75779261,1228.454"
data1<-read.table(text = data1, header = T,sep = ",")
head(data1)
str(data1)
sf::sf_extSoftVersion()
crs_epsg25831 <- st_crs(25831)
crs_epsg25831
data.points <- st_as_sf(data1, coords = c("Longitude", "Latitude"))
st_crs(data.points) <- 4326
data.points
#transform from EPSG 4326 to EPSG 25831(ETRS89/UTM 31N)
data.points2<-st_transform(data.points,crs_epsg25831)
st_crs(data.points2)
data.points2
data.points2$geometry
write.csv(data.points2, "sample.points_epsg25831.csv")
# height transformation ?
Machine and software details:
OS: Windows
R: version 4.2.1 (2022-06-23 ucrt) -- "Funny-Looking Kid"
Rstudio: RStudio 2022.07.1+554 "Spotted Wakerobin" Release
(7872775ebddc40635780ca1ed238934c3345c5de, 2022-07-22) for Windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like
Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36
GEOS: 3.9.1
GDAL 3.4.3
PROJ 7.2.1
sf_use_s2: TRUE
Kind regards,
Inti Luna
--
+ 34 6042 19917
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list