1

I have a Point shapefile from arcGIS 10. I want to get it in r and also want to get it a specific predefined coordinate systen for my data. I can read the shapefile in R but summary in r Shows projectltion info like this `proj4string : [NA]' and if i want to transform the reference systen it Shows something like this:

Error in spTransform(xSP, CRSobj, ...) : No transformation possible from NA reference System What can I do to deal with this Problem. Thanks a lot:-)

  • I have already got the solution using rgdal package in r. the codes are as follows: "ogrInfo(".", "allpoints_ohnegs" and 2)then use the CRS´info to define projection as proj4string:-pointA.prj<-"+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +datum=potsdam +units=m +no_defs", step 3) define projection to shapefile:-pointa_proj<-SpatialPoints(pointA, proj4string=CRS(as.character(pointA.prj)), bbox = NULL) ---done)" – Shiuli Pervin Apr 15 '14 at 10:02
  • 1
    I think you should write this up as an Answer. – PolyGeo Apr 15 '14 at 12:22
2

Cant you just simply use text to fill your proj4string. So:

First read in your shapefile calling it: pointshapefile. And then run the following line.

pointshapefile@proj4string <- "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +datum=potsdam +units=m +no_defs"

Afterwards you can use spTransform. I think R gives you a warning that you have manually changed the projection but it should work this way.

0

Try this.. It worked for me..!

library(sp)

shp <- shapefile("Path_To_Shapefile.shp")

proj4string(shp) <- CRS("+proj=utm +zone=44 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.