[gdal-dev] Translating ArcInfo binary grid to USGS .dem in C#
via GDAL
Frank Warmerdam
warmerdam at pobox.com
Fri May 13 13:18:13 EDT 2011
On 11-05-13 01:13 PM, supercooper wrote:
> Dataset dsDem = demDriver.Create("C:\\Data\\65587895\\foo.dem", x, y, 1,
> DataType.GDT_Int16, opts);
>
> Gives the error:
>
> System.ApplicationException: GDALDriver::Create() ... no create method
> implemented for this format.
>
> I thought the USGSDEM format was read/write...am I wrong on that? The
> formats list (http://www.gdal.org/formats_list.html) says that creation of
> USGSDEM is supported, but a run of demDriver.GetMetadata(null) to get the
> metadata from the USGSDEM driver results in no return DCAP_CREATE=YES, only
> DCAP_CREATECOPY=YES, which makes me cringe, thinking that indeed the
> GDALDriver::Create() method is not implemented for the USGSDEM format.
Super Cooper,
Indeed, the USGSDEM driver only implements CreateCopy(), not Create().
ASCII formats like this one are not very easy to implement Create support
with as they aren't well suited to random update.
> I've also poked thought the source for the USGSDEM format, and don't see
> anything in there pertaining to creating a dem (although I could easily miss
> that, as I am by no means fluent in C++).
The CreateCopy implementation is in usgsdem_create.c in the same directory
as the read driver.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
More information about the gdal-dev
mailing list