[R-sig-Geo] Shape file of USA land cover data

Michael Sumner mdsumner at gmail.com
Thu Dec 6 05:28:03 CET 2012


The error message already advises on what is required:  "you use rgdal
version: 0.7-19. You need version 0.7-22 or higher".

Is that not clear somehow? It's important to read the messages and
work on understanding them.

Please upgrade to latest rgdal and raster, it only creates extra work
trying to chase issues with outdated versions. If you have trouble
upgrading then that's another topic, for another list.  The "R
Installation and Administration" manual is the first port of call for
maintaining your R installation, but how to do it exactly will depend
on your set up, operating system, whether your R is current, and other
things that we do not know.

Cheers, Mike.


On Thu, Dec 6, 2012 at 3:09 PM, Milan Sharma <milansharma2012 at yahoo.com> wrote:
> Hi Erin,
> I got the following error.. Can you advise me of the solution?
>> setwd("C://Users//milan//Desktop")
>> r <- raster("nlcd2006_landcover_4-20-11_se5.img")
> Error in .requireRgdal(FALSE) : you use rgdal version: 0.7-19
> You need version 0.7-22 or higher
> ________________________________
> From: "Hodgess, Erin" <HodgessE at uhd.edu>
> To: Michael Sumner <mdsumner at gmail.com>; Milan Sharma
> <milansharma2012 at yahoo.com>
> Cc: "r-sig-geo at r-project.org" <r-sig-geo at r-project.org>
> Sent: Wednesday, December 5, 2012 9:45 PM
> Subject: RE: [R-sig-Geo] Shape file of USA land cover data
>
> Hi
>
> I got the same data set that Milan did and used the raster:
>
> r <- raster("c://goodc//nlcd2006_landcover_4-20-11_se5.img")
>
> and it worked.  When I used gdal, it said that it was too big.
>
> Thanks,
> Erin
> PS the plot looks really nice too.
>
> ________________________________________
> From: r-sig-geo-bounces at r-project.org [r-sig-geo-bounces at r-project.org] on
> behalf of Michael Sumner [mdsumner at gmail.com]
> Sent: Wednesday, December 05, 2012 8:34 PM
> To: Milan Sharma
> Cc: r-sig-geo at r-project.org
> Subject: Re: [R-sig-Geo] Shape file of USA land cover data
>
> It's not a shapefile, and it's not a vector format. It's a gridded
> (raster) format. Specifically it's an Erdas Imaging (.img) format:
>
> http://www.gdal.org/frmt_hfa.html
>
> I tried the Hawaii one which is much smaller (2.4Mb) and so more
> reasonable to share.
>
> http://gisdata.usgs.gov/TDDS/DownloadFile.php?TYPE=nlcdhi&FNAME=HI_landcover_wimperv_9-30-08_se5.zip
>
> You seem to have found metadata files, but I haven't found what you
> presented to us.
>
> I get this:
>
> list.files()
> [1] "hi_landcover_wimperv_9-30-08_se5.img"
> [2] "hi_landcover_wimperv_9-30-08_se5.rrd"
> [3] "landcov_meta_web_final"
>
> library(raster)
> r <- raster("hi_landcover_wimperv_9-30-08_se5.img")
> r
> class      : RasterLayer
> dimensions  : 12618, 19439, 245281302  (nrow, ncol, ncell)
> resolution  : 30, 30  (x, y)
> extent      : -345945, 237225, 1753875, 2132415  (xmin, xmax, ymin, ymax)
> coord. ref. : +proj=aea +lat_1=8.000000000000002 +lat_2=18 +lat_0=3
> +lon_0=-157 +x_0=0 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m
> +no_defs
> data source :
> C:\Users\Michaels\Downloads\HI_landcover_wimperv_9-30-08_se5\hi_landcover_wimperv_9-30-08_se5.img
> names      : hi_landcover_wimperv_9.30.08_se5
> values      : 0, 95  (min, max)
> Raster Attribute Table
>     fields :  ID    COUNT  Red Green Blue Land.Cover.Class Opacity
>         min :  0        0 0.00  0.00 0.00                        0
>         max : 255 221606161 0.98  0.98 0.98  Woody Wetlands      1
>
>
> You'll have to work through the documentation for rasters to
> understand how to work with these data. The raster package requires
> rgdal to load this format, and you could do that more directly with
>
> require(rgdal)
> r <- readGDAL("hi_landcover_wimperv_9-30-08_se5.img")
>
> though arguably raster is probably a better place to start.
>
> Cheers, Mike.
>
> On Thu, Dec 6, 2012 at 1:10 PM, Milan Sharma <milansharma2012 at yahoo.com>
> wrote:
>> Hi List,
>> I  wanted to download national land cover data of USA, 2006 which I could
>> convert to shape file and do analysis. The website is
>> http://www.mrlc.gov/nlcd01_data.php.
>>  I got the following 6 files in it:
>> 1. appendix1_nlcd2006_scene_list_by_path_row_txt
>> 2. appendix1_nlcd2006_scene_list_by_path_zone_txt
>> 3. metadata_nlcd2006_lc_4-20-11-txt
>> 4. metadata_nlcd2006_lc_4-20-11-se5.ige
>> 5. metadata_nlcd2006_lc_4-20-11-se5.img
>> 6.metadata_nlcd2006_lc_4-20-11-se5.rrd
>>
>> I didn't see any shape file in here, or will I get the shape file from any
>> one  the above  file formats?
>> (Has anybody in the list downloaded such data?) (or can anybody instruct
>> me of how to get it done?
>> Thanks so much for your help,
>> Milan
>>        [[alternative HTML version deleted]]
>>
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>
>
> --
> Michael Sumner
> Hobart, Australia
> e-mail: mdsumner at gmail.com
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>



-- 
Michael Sumner
Hobart, Australia
e-mail: mdsumner at gmail.com



More information about the R-sig-Geo mailing list