[Gdal-dev] how to crop a dataset

Frank Warmerdam warmerdam at pobox.com
Thu Oct 18 15:01:04 EDT 2007


Michele Zanin wrote:
> Hi,
>   I'm a very unexperienced user of GDAL (since yesterday), so please
> excuse me if I say something obvious.
> 
> I followed the nice API tutorials and, thanks to the good
> documentation, I was able to implement exactly what I needed.
> 
> I'd like to share with you a task I found difficult to understand and
> implement: maybe you can find interesting looking at GDAL from the
> point of view of a complete novice.
> 
> I needed to obtain a dataset that was a portion of another one;
> something similar to cropping an image. I found difficult to
> understand how to do it.
> After few hours I discovered VRT datasets and I successfully used
> them. This part of GDAL is not fully documented and I feel like there
> should be a simpler solution...

Michele,

Subset VRTs and subsetting in general can also be done on the
commandline with gdal_translate.  Specific improvements to the
documentation is welcome, and I encourage users and developers to
work up new material in the Trac wiki.

I know that VRTs are somewhat underdocumented, and hard to use
for some things.

> I also had a problem: gdal_vrt.h was missing from my include
> directory. I modified the install part of GNUmakefile from
> 
> install:
> 	$(INSTALL_DATA) vrtdataset.h gdal_vrt.h $(DESTDIR)$(INST_INCLUDE)
> 
> to
> 
> install:
> 	$(INSTALL_DATA) vrtdataset.h gdal_vrt.h $(DESTDIR)$(INST_INCLUDE)
> 	$(INSTALL_DATA) gdal_vrt.h $(DESTDIR)$(INST_INCLUDE)


I have applied this change in trunk.

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    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list