Message-ID: <522664f81003222355n2402acddk80d55103941e48fc@mail.gmail.com>
Date: 2010-03-23T06:55:32Z
From: Michael Sumner
Subject: rgdal: problem with grid data
In-Reply-To: <522664f81003222349g39cc0c4ya756547d80c1d2f6@mail.gmail.com>
As a follow up, arguably writeOGR should either complain that it got a
raster, or perform the conversion to points automatically. I'm not
sure why writeOGR writes an empty shapefile in that case, but some
software cannot read them - so a warning at least would be helpful I
think. Roger?
Cheers, Mike.
On Tue, Mar 23, 2010 at 5:49 PM, Michael Sumner <mdsumner at gmail.com> wrote:
> What are you expecting to get - a point for every raster cell? ?If so,
> use gridded(isrlc) <- FALSE to convert to a SPDF first - then the
> write will work.
>
> More complicated conversions are possible, such as with
> as.SpatialPolygons.GridTopology.
>
> Cheers, Mike.
>
>
>
>
>
> On Tue, Mar 23, 2010 at 5:32 PM, Agustin Lobo <alobolistas at gmail.com> wrote:
>> Hi!
>>
>> ?I read a grid file into R with
>> isrlc <-
>> readGDAL("/media/Transcend/MASTER_ICTA2007_2008/GEODATA_miniprojs/Kefah/ISR_cov/isr_cov.gri")
>>
>> While isrlc seems correct, ?I'm getting an empty shapefile when I attempt to
>> write:
>>
>> writeOGR(isrlc,dsn="/media/Transcend/MASTER_ICTA2007_2008/GEODATA_miniprojs/Kefah",
>> layer="ISR_cov2",driver="ESRI Shapefile")
>>
>> Data from
>> http://www.diva-gis.org/data/cov/ISR_cov.zip
>>
>> Thanks
>>
>> Agus
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>