6

I have no idea why I get the following error:

FAILURE: Unable to open datasource `Sydney2.shp' with the following drivers.

I have already checked successfully the shape with ogrinfo.

I am using the following command:

ogr2ogr -f "ESRI Shapefile" Sydney.shp Sydney2.shp -s_srs EPSG:32656 -t_srs EPSG:4326

Any ideas?

8

It looks like you're expecting to convert data in Sydney.shp to Sydney2.shp with a different SRS. However that isn't what you're doing.

   Usage: ogr2ogr [--help-general] [-skipfailures] [-append] [-update]
                  [-select field_list] [-where restricted_where]
                  [-progress] [-sql <sql statement>] [-dialect dialect]
                  [-preserve_fid] [-fid FID]
                  [-spat xmin ymin xmax ymax]
                  [-a_srs srs_def] [-t_srs srs_def] [-s_srs srs_def]
                  [-f format_name] [-overwrite] [[-dsco NAME=VALUE] ...]
                  dst_datasource_name src_datasource_name
                  [-lco NAME=VALUE] [-nln name] [-nlt type] [-dim 2|3] [layer [layer ...]]

Note that the destination comes first, so you're asking it to copy from Sydney2.shp to Sydney.shp. You probably wanted:

ogr2ogr -f "ESRI Shapefile" Sydney2.shp Sydney.shp -s_srs EPSG:32656 -t_srs EPSG:4326
  • Thanx, thats it. I have to change the position of the source and destination file. Quite easy, i better read the syntax more closely next time :-E – happymapper Nov 14 '14 at 11:07
  • 3
    You are not the only one. GDAL is using target-source order in most vector tools but source-target in raster tools. – user30184 Nov 14 '14 at 11:35
  • Indeed its a problem that some of us have seen before :-) – BradHards Nov 14 '14 at 22:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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