Dear all,

I'm quite new to spatial data processing in R and I'm getting entangled in projection systems, I would appreciate your support to find a solution. I need to import my custom projection in R (my.proj), create projected spatial objects (I usedSpatialPointsDataFrame {sp}) and export them as
shapefiles (I usedwritePointsShape {maptools}). As I said, the first step is particularly tricky to me!

I tried to import the projection both asmy.proj.shp  andmy.proj.prj  usingreadOGR() {rgdal}  but the result was just the same: it didn't work!

As you see below I've been trying different solutions to make the function work but I still didn't understand what I'm supposed to assign to dsn and layer:

inputdir<-"C:/my working directory/"

library(rgdal)

  > Test<-readOGR(dsn=paste(inputdir),layer="my.proj")
Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv) :
    Cannot open file

  > Test<-readOGR(dsn=paste(inputdir,"my.proj",sep=""),layer="my.proj.shp")
Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv) :
    Cannot open file

  > Test<-readOGR(dsn="my.proj",layer="my.proj.shp")
Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv) :
    Cannot open file

also the attempts withogrInfo()haven't been successful.

So I have two questions on this matter. How should I handle the issue withreadOGR()? Is there any other way (possibly easy) to import a custom projection in R?

Note: I'm using R 2.15.2 and rgdal 0.8-10.

Thanks in advance

Ivan


	[[alternative HTML version deleted]]

