Presumably there was valid coordinate system metadata for the first "corr", but not the second.
See proj4string(corr) If the data is longlat on WGS84 you can override the missing (NA) coordinate system with something like this before using spTransform: proj4string(corr) <- CRS("+proj=longlat +ellps=WGS84") but you should check carefully with the source of the data to ensure that PROJ.4 string is appropriate - using the same as that reported by the first data set may be right. Cheers, Mike. On Fri, Oct 22, 2010 at 6:45 AM, Manuel SpÃnola <mspinol...@gmail.com>wrote: > Dear list members, > > I am trying to project some shapefiles with function spTransform but I got > an error. > > My first shapefile was ok > > > corr = readOGR(dsn="C:/ProyectoRespacial/EvalHab_reporte", > layer="corredor05unico") # en coordenadas geográficas > > corr.transf = spTransform(corr, CRS("+proj=tmerc +lon_0=-84 +lat_0=0 > +k=0.9999 +datum=WGS84")) # para CRTM05 > > writeOGR(corr.transf, > dsn="C:/ProyectoRespacial/CBSS/Shapefiles_proyectados", > layer="corredorCRTM05", driver="ESRI Shapefile") # para escribir el shape > > corr = readOGR(dsn="C:/ProyectoRespacial/CBSS/Shapefiles_proyectados", > layer="corredorCRTM05") > OGR data source with driver: ESRI Shapefile > Source: "C:/ProyectoRespacial/CBSS/Shapefiles_proyectados", layer: > "corredorCRTM05" > with 1 features and 4 fields > Feature type: wkbPolygon with 2 dimensions > > plot(corr, axes=TRUE) > > but my second gave me an error. > > > cob = readOGR(dsn="C:/ProyectoRespacial/CBSS/LAINcambios", > layer="coberturascsls2006_cr05") # en coordenadas geográficas > OGR data source with driver: ESRI Shapefile > Source: "C:/ProyectoRespacial/CBSS/LAINcambios", layer: > "coberturascsls2006_cr05" > with 6016 features and 3 fields > Feature type: wkbPolygon with 2 dimensions > > cob.transf = spTransform(cob, CRS("+proj=tmerc +lon_0=-84 +lat_0=0 > +k=0.9999 +datum=WGS84")) # para CRTM05 > Error en spTransform(xSP, CRSobj) : > No transformation possible from NA reference system > > Best, > > Manuel > > [[alternative HTML version deleted]] > > > _______________________________________________ > R-sig-Geo mailing list > R-sig-Geo@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > > -- Michael Sumner Institute for Marine and Antarctic Studies, University of Tasmania Hobart, Australia e-mail: mdsum...@gmail.com [[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo