0

What is the correct format of ogr2ogr for converting the ADF grid to SHP file? I tried this, but it fails.

$ ogr2ogr -where "OGR_GEOMETRY='Point'" -f "ESRI Shapefile" SHP.shp ADF.adf
4
  • 1
    is there an error? or do you just get an empty file? please add the output of orginfo SHP.shp aswell
    – Ian Turton
    Jul 8, 2013 at 7:41
  • FAILURE: Unable to open datasource 'ADF.adf' with the following drivers. Jul 8, 2013 at 8:11
  • that's the problem then - OGR doesn't know how to open your ADF file or your ADF file is broken
    – Ian Turton
    Jul 8, 2013 at 8:18
  • do not specify ADF.adf, just ADF in the command line option.
    – klewis
    Jul 8, 2013 at 18:36

1 Answer 1

2

Your command will fail on a couple of counts. Firstly ogr2ogr is used to convert between vector formats and not to convert raster (hdr.adf) to vector (shp). Secondly, the 'where' clause is an SQL selection statement to select a subset of your input vector data and not used to define the output geometry.

Try looking at the GDAL utilities instead. Unfortunately there isn't a handy utility to convert directly from a raster to a point shapefile, however you could use GDAL_translate to convert from the ADF to and XYZ format and then treat the XYZ as a CSV and convert to a shapefile if required.

OTOH if you are trying to open an ESRI Arc/Info vector Coverage then you need to be aware that it is not just a single file but a whole directory of files many of which have the '.adf' extension. OGR will not just open one of them, which is why you get an error. Reference the coverage not a subset of it. The PAR.adf file is just the tolerances file for a double precision Coverage (the equivalent of TOL.adf for single precision).

2
  • This adf is not in raster format. It is in vector. It includes par.adf file. QGIS can read it and save it in shp. But I look for a batch conversion. Jul 8, 2013 at 8:08
  • See my edited answer. Jul 8, 2013 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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