[R-sig-Geo] spsample Error
Agustin Lobo
alobolistas at gmail.com
Tue Jul 7 09:47:21 CEST 2009
I'm using spsample() with a second SpatialLinesDataFrame
but now I'm geting an error. This is what I do:
fl2300 <-
readOGR(dsn="/media/Transcend/MONTSENY2008/MONTSENY_UAV2/flMatagalls300",layer="flMatagalls300")
> wpMata300 <- spsample(fl2300[1,],33,offset=0.0,type="regular")
Error in proj4string(x) :
proj4string only works for class(es extending) Spatial
Nothing looks wrong with fl2300 (at least not different to other SPDFs for which
spsample() works fine):
> str(fl2)
Formal class 'SpatialLinesDataFrame' [package "sp"] with 4 slots
..@ data :'data.frame': 2 obs. of 2 variables:
.. ..$ Code : int [1:2] 1 2
.. ..$ Comment: Factor w/ 2 levels "CarrElBrull700",..: 2 1
..@ lines :List of 2
.. ..$ :Formal class 'Lines' [package "sp"] with 2 slots
.. .. .. ..@ Lines:List of 1
.. .. .. .. ..$ :Formal class 'Line' [package "sp"] with 1 slots
.. .. .. .. .. .. ..@ coords: num [1:3, 1:2] 445816 449071 449071 4628083
4629045 ...
.. .. .. ..@ ID : chr "0"
.. ..$ :Formal class 'Lines' [package "sp"] with 2 slots
.. .. .. ..@ Lines:List of 1
.. .. .. .. ..$ :Formal class 'Line' [package "sp"] with 1 slots
.. .. .. .. .. .. ..@ coords: num [1:3, 1:2] 445983 444326 444326 4628196
4630060 ...
.. .. .. ..@ ID : chr "1"
..@ bbox : num [1:2, 1:2] 444326 4628083 449071 4630060
.. ..- attr(*, "dimnames")=List of 2
.. .. ..$ : chr [1:2] "r1" "r2"
.. .. ..$ : chr [1:2] "min" "max"
..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slots
.. .. ..@ projargs: chr " +proj=utm +zone=31 +ellps=intl +units=m +no_defs"
Is this a bug? Do I have anything wrong in this object?
Thanks
Agus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alobolistas.vcf
Type: text/x-vcard
Size: 251 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20090707/fe072b37/attachment.vcf>
More information about the R-sig-Geo
mailing list