Entering coordinate systems into ADEHabitat

Hi everyone
I was hoping someone could help. I am working with some data from Taiwan. My colleague described the coordinate system as "TWD97 (Taiwan Datum 1997) with TM2 format." It's a UTM system. For some data from India it was NAD 83 UTM zone 43. I entered it as: CRS("+proj=utm +zone=43 +datum=NAD83 +ellps=WGS84"))

Can anyone help me with coding the Taiwan zone?

From ArcGIS I get this information:

Projected Coordinate System:TWD_1997_TM_Taiwan
Geographic Coordinate System: GCS_TWD_1997
Datum: D_TWD_1997

I am new to R and the phrase having something to do with "teaching old dogs new tricks" comes to mind. Any help would be appreciated.

I think we need some more information and perhaps some sample data

At the moment my guess is you are using some kind of geographical data but we probably need to know what packages you are using and what you have as code so far.

Have a look at

Version:1.0 StartHTML:0000000107 EndHTML:0000001627 StartFragment:0000000127 EndFragment:0000001609
#here is the portion I am trying to code: It is geographic data with an x and y coordinate for each observed animal. In a different project I am doing the same thing but with a different coordinate system. In that case the code is:

sp=SpatialPoints(mongoose2.dat[c("X", "Y")], CRS("+proj=utm +zone=43 +datum=NAD83 +ellps=WGS84"))

#the above code works fine. The below code is giving me an error about an unrecognized coordinate system.
sp=SpatialPoints(F_Badger.dat[c("X", "Y")], CRS("+proj=utm +datum=TWD_1997_TM_Taiwan"))

proj_create: Error -9: unknown elliptical parameter name proj_create: Error -9: unknown elliptical parameter name Error in CRS("+proj=utm +datum=TWD_1997_TM_Taiwan") : NA

#I don't know how to define the Taiwan coordinate system so R can recognize it. It worked for the NAD83 UTM Zone 43 for a different data set (and location) but the Taiwanese UTM zone format is unfamiliar to me.

Version:1.0 StartHTML:0000000107 EndHTML:0000103540 StartFragment:0000000127 EndFragment:0000103522

#here's some sample data.
Date ID X Y
12/23/2014 F12 - 238693 2688514
12/24/2014 F12 238538 2688467
1/6/2015 F12 238501 2688710
1/6/2015 F12 238507 2688718
1/6/2015 F12 238484 2688436
1/6/2015 F12 238447 2688421
1/7/2015 F12 238659 2688453
1/7/2015 F12 238507 2688702
1/7/2015 F12 238578 2688457
1/7/2015 F12 238430 2688452
1/7/2015 F12 238471 2688454
1/8/2015 F12 238534 2688440
1/8/2015 F12 238532 2688429
1/8/2015 F12 238521 2688698
1/8/2015 F12 238542 2688594
1/8/2015 F12 238580 2688621
1/22/2015 F12 238739 2688543
1/22/2015 F12 238639 2688507
1/22/2015 F12 238636 2688568
1/23/2015 F12 238759 2688497
Version:1.0 StartHTML:0000000107 EndHTML:0000105037 StartFragment:0000000127 EndFragment:0000105019

I'm not familiar with this coordinate system, but I've narrowed it down to a possibility based on the info you provided. I've outlined two approaches, based on using either the "sp" or "sf" packages.


# As spatialpointsDataFrame
dat <- structure(list(Date = structure(c(16427, 16428, 16441, 16441, 
16441, 16441, 16442, 16442, 16442, 16442, 16442, 16443, 16443, 
16443, 16443, 16443, 16457, 16457, 16457, 16458), class = "Date"), 
    ID = c("F12", "F12", "F12", "F12", "F12", "F12", "F12", "F12", 
    "F12", "F12", "F12", "F12", "F12", "F12", "F12", "F12", "F12", 
    "F12", "F12", "F12"), X = c(238693L, 238538L, 238501L, 238507L, 
    238484L, 238447L, 238659L, 238507L, 238578L, 238430L, 238471L, 
    238534L, 238532L, 238521L, 238542L, 238580L, 238739L, 238639L, 
    238636L, 238759L), Y = c(2688514L, 2688467L, 2688710L, 2688718L, 
    2688436L, 2688421L, 2688453L, 2688702L, 2688457L, 2688452L, 
    2688454L, 2688440L, 2688429L, 2688698L, 2688594L, 2688621L, 
    2688543L, 2688507L, 2688568L, 2688497L)), class = "data.frame",
  row.names = c(NA, -20L))

dat_sp <- dat
coordinates(dat_sp) <- ~X + Y
proj4string(dat_sp) <- CRS("EPSG:3826") # Details at https://epsg.io/3826

# As Simple Features object

dat_sf <- st_as_sf(dat, coords = c("X", "Y"), crs = 3826)

# To transform coordinate systems
dat_wgs84 <- st_transform(dat_sf, crs = 4326)

Coordinates plotted against an background map:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.