Reprojecting a layer using gdaltindex

Frank Warmerdam warmerdam at POBOX.COM
Tue Sep 26 09:52:39 EDT 2006


Frederico Lucca wrote:
> Hello list,
> 
> Can I reproject a image that is inside a layer using tileindex?

Frederico,

Yes.

> My problem is that I need to show a ECW that is in Corrego Alegre Datum. 
> First of all I tried to use
> PROJECTION
>    "init=epsg:4225"
> END
> without success.

To be clear, are the bounds stored in the tile index in degrees?
(as opposed to projected meters, feet, etc)

> Than I tried to use gdalwarp to convert it to WGS84 that is my map 
> Datum, but I can't write ECW format, why not?

The gdalwarp program processes the image in chunks, but the ECW
writer (and also many other compressed GDAL drivers) only support
line by line copying, so gdalwarp has to output to a "working file",
which can then be converted to ecw using gdal_translate.  I often
use GeoTIFF or Imagine (HFA) formats for working files.

> So, the only solution I found is convert using gdalwarp exporting as 
> GTiff, but the image size is very large.
> 
> I have many photos and want to use only a layer if is possible.
> There is a solution?

Generally speaking, if all your photos are in EPSG:4225 you should be
able to just label the layer that way, and your map as EPSG:4326, and
mapserver will take care of reprojecting the images as needed.

However, you cannot have a mix of coordinate systems in your tile index.
So this only works if all the images in your tile index are in the same
coordinate system.

There is a performance cost to reprojecting rasters on the fly.  You
may still find you are better pre-reprojecting them using gdalwarp,
and then recompressing to ECW with gdal_translate.

Good luck,
-- 
---------------------------------------+--------------------------------------
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 mapserver-users mailing list