Re: [R] vector file

From: Barry Rowlingson <b.rowlingson_at_lancaster.ac.uk>
Date: Sun, 01 May 2011 08:50:05 +0100

On Sun, May 1, 2011 at 8:08 AM, azam jaafari <azamjaafari_at_yahoo.com> wrote:
> Dear All
>
> I want to import the vector file (   .shp) to R. I could import the file by rgdal package before, by following:
>
> geology<-readOGR('C:/geology//saga/geo.geom','finalgeology')
>
> but now there is an error:
>
> Error in ogrInfo(dsn = dsn, layer = layer, input_field_name_encoding = input_field_name_encoding) :
>
>         GDAL Error 4: .shx file is unreadable, or corrupt.
>
> Can you tell me where is the problem.

 I would say that the .shx file is unreadable, or corrupt.

Do you even have a .shx file? For every .shp file, there should be a .shx file, and a .dbf file. .shp files on their own are useless - you will need at least finalgeology.shp, finalgeology.shx and finalgeology.dbf. There may also be a finalgeology.prj with the projection info.

 We don't know what's changed between when you said it worked and now, so we can't really tell. The only clue is the error about the .shx file - so check you still have the .shx file and you didnt delete it.

Barry



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun 01 May 2011 - 07:58:39 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 01 May 2011 - 11:30:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive