[Gdal-dev] harmonize ogrinfo extents reporting (gdal utilities)

Frank Warmerdam warmerdam at pobox.com
Tue Feb 7 15:22:52 EST 2006


On 2/7/06, Matt Wilkie <matt.wilkie at gov.yk.ca> wrote:
> Hi,
>
> I'm trying to use ogrinfo to get the extents of a shapefile and then
> clip a raster to match using gdal_translate. Both datasets are in the
> same projection. However the numbers returned by ogrinfo aren't in the
> same order as that exptected by gdal_translate's -projwin.
>
> I'm forever getting it wrong the first two or three times when I try and
> do the mental flipflops to get the numbers right for gdal_translate.
> Would it be possible to get ogr to return in the same order as gdal
> expects? Or can someone tell me what the ogr order is right now and I
> can do up a cheat sheet?

Matt,

I hesitate to change the ordering now, for fear of messing
people up who have come to expect the current order.

ogrinfo reports:
  xmin ymin xmax ymax

-projwin requires
  ulx uly lrx lry

xmin = ulx
ymin = lry
xmax = lrx
ymax = uly

If that helps

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