Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm following along the D3 tutorial, and on this line:

ogr2ogr \
  -f GeoJSON \
  -where "adm0_a3 IN ('GBR', 'IRL')" \
  subunits.json \
  ne_10m_admin_0_map_subunits.shp

run into the following problem:

FAILURE:
Unable to open datasource 'ne_10m_admin_0_map_subunits.shp' with the following drivers.
  -> ESRI Shapefile
  -> MapInfo File
  -> UK .NTF
  -> SDTS
  -> TIGER
  -> S57
  -> DGN
  -> VRT
  -> REC
  -> Memory
  -> BNA
  -> CSV
  -> GML
  -> GPX
  -> KML
  -> GeoJSON
  -> GMT
  -> PCIDSK
  -> XPlane
  -> AVCBin
  -> AVCE00
  -> DXF
  -> Geoconcept
  -> GeoRSS
  -> GPSTrackMaker
  -> VFK
  -> PGDump
  -> GPSBabel
  -> SUA
  -> OpenAir
  -> PDS
  -> HTF
  -> AeronavFAA
  -> EDIGEO
  -> SVG
  -> Idrisi
  -> ARCGEN
  -> SEGUKOOA
  -> SEGY

I have the .shp, .shx, .dbf, and .prj files all in this directory. Why is ogr2ogr unable to read them with anything? (Shapelib is installed.)

I'm using Ubuntu 12.10 if that makes any difference, and had to compile GDAL from scratch, using version 1.9.0.

share|improve this question
    
I wonder if there is something missing or broken in your compilation because this works for me using pre-compiled binaries (admittedly for Windows). Have you tried using pre-compiled Binaries? I'm not so familiar with Ubuntu but perhaps this site might help: launchpad.net/~ubuntugis –  MappaGnosis Jan 8 '13 at 8:33
1  
what happens if you try ogrinfo ne_10m_admin_0_map_subunits.shp –  iant Jan 8 '13 at 8:41
    
Unclear what happened, but it seems to work now. I made no changes, just rebooted today and the command mysteriously worked. I'll take it. Thanks guys! –  Mittenchops Jan 8 '13 at 22:09
1  
@Sylvester, unfortunately, I was unable to use the pre-compiled binaries. I certainly would have preferred that method, but gdal kept failing to install, whether I used stable or unstable ubuntugis ppa---it had a cryptic "installation failed" message, and took some serious (and frustrating) sleuthing to learn I had to compile successfully from source (something I'd never done before). –  Mittenchops Jan 8 '13 at 22:26

2 Answers 2

I ran into this exact problem because I hadn't extracted the zip file into the working directory. I was rushing to get the files converted and when I checked to make sure they were there, the "preview" that I got when I double-clicked on the zipped file tricked me into thinking they were available for conversion. Even if this wasn't the solution to your problem, maybe someone else with the same error will benefit from my haste.

share|improve this answer
    
Thank you for posting this. I made the same hasty error. –  Marty Nov 18 at 16:55
up vote -3 down vote accepted

I don't know the formal answer to this question, and I'm unable to provide more details of what was going wrong, or what was done to fix it. However, strangely, it started working again.

In response to Dave X's comment above, I'm going to accept this as the correct answer---since I won't be able to provide additional information that will lead to adequately solving it.

If you're in the same position I was at the time of asking this, I can only advise you to keep re-installing all the stuff you've already installed several times, reboot occasionally and hope.

share|improve this answer

Your Answer

 
discard

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.