Good evening every ones.

I am trying to set a projection system for an ascii file in Rstudio.

I reached to import the .asc on R and to plot it. Now I need to set a 
projection.

In my matrix I have CRS : NA

I tried two ways :

First way:

crs(rasterClimat, asText=F)
crs(rasterClimat)<- "+proj=lcc +lat_1=48 +lat_2=33 +lon_0=-100 +datum=WSG84"

crs(rasterClimat)

w<- wkt(rasterClimat)

w

cat(w, "\n")

(taken from here :https://rdrr.io/cran/raster/man/projection.html)

Second way:

crs(rasterClimat)<-"proj=longlat +datum=WGS84 +no_defs +ellps=WGS84+towgs84= 
0,0,0"

(taken from here : https://www.youtube.com/watch?v=iqbVyt8mjIk, tutorial that I 
followed)

For the two methods, the error message is the same :

Error in sp::CRS(SRS_string = x) : NA

I followed the youtube tutorial, our two cases seem similar but she reached to 
project her map.

May someone gives me some clues about what I do not understand in this process 
and where I have to look for and/or what can I do to fix it?
I want to do it on R, I do not want to use a GISsoftware to set the coordinate 
system then import the file into R.

I put in attachment the code I used if you want to have a close look, and the 
.asc files.

Thank you very much for your time,
best regards,

Basile.

Sent with [ProtonMail](https://protonmail.com/) Secure Email.

Attachment: ascii to raster.R
Description: Binary data

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to