Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

According to this answer I can read in a .lyr file via OGR as long as it was made with ArcGIS version 10.

I have such a file (from the ArcGIS Maps & Data page) but I can't quite make R's readOGR function work with it.

Directory contents after decompressing the .lpk file:

[1] "ESRI_Zip_Codes_Dec2011.lpk" "iteminfo.xml" "item.pkinfo" "thumbnail.png" [5] "USA_Zip_Codes.lyr" "zip_poly.prj" "zip_poly.sdc" "zip_poly.sdc.prj" [9] "zip_poly.sdc.xml" "zip_poly.sdi"

And then trying to open the various components:

ogrInfo( dsn=mypath, layer="zip_poly" )

Error in ogrInfo(dsn = file.path(shapedir, "zipcodes", "ESRI_Zipcodes"), : Cannot open file

ogrInfo( dsn=mypath, layer="USA_Zip_Codes" )

Error in ogrInfo(dsn = file.path(shapedir, "zipcodes", "ESRI_Zipcodes"), : Cannot open file

How do I open these things? I would normally take the easy way out and convert to Shapefile it via ArcGIS, but my annual license expired and my new one hasn't arrived yet.

share|improve this question
up vote 2 down vote accepted

Just an update on this question using the new GDAL OpenFileGDB Driver this is possible. As mentioned in this answer you'll first have to unzip the .lpk file which is actually a 7zip archive. With Homebrew

$ brew install p7zip

And to unzip

$ 7z x yourLayerPackage.lpk

Now that you have the uncompressed .gdb file you can use install GDAL/OGR to convert the desired feature class to a shapefile. With Homebrew install GDAL using the enable-unsupported option

$ brew install gdal --enable-unsupported

And to convert to shapefile

$ ogr2ogr -f "ESRI Shapefile" yourShapefileName yourFileGeodatabase.gdb yourFeatureClassName
share|improve this answer

Unfortunately there is no way to convert an LPK file (packaged with a file geodatabase inside) to a shapefile or file geodatabase using open source software. If you rename the LPK to ZIP, you can open the zip archive and see a large SDC file. This is basically the file geodatabase in ESRI's proprietary 'Spatial Data Compression' format.

OGR can work with a file geodatabase but is unable to work with an LPK or an SDC file.

Perhaps you could get to the data if the LPK file was created from one or more shapefiles.

share|improve this answer
Ok, I guess I'll have to trek over to the GIS lab and do it on one of their copies of Arc then. Thanks for the clarification. – Ari B. Friedman Sep 27 '12 at 12:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.