Tileindex-raster opacity

Frank Warmerdam warmerdam at POBOX.COM
Wed Dec 14 09:36:57 EST 2005


On 12/14/05, Pēteris Brūns <peteris.bruns at gmail.com> wrote:
> Hi Everyone,
>
>  I have small proble with my tileindex raster files. Everything works fine
> but i have raster files with white borders. Raster pictures marching wery
> good but this white borders overlay alongside raster. How to remove or
> create transparent this borders?!

Pēteris,

Trying to mosaic overlapping maps with collars is a fairly
common issue.  There are a few techniques that can be
applied in this case.

1) If the collar is all one color, and the color is unique
    to the collar then you can just specify it in the OFFSITE
    parameter.  This may be the case with reprojected or
    rectified images that have some triangular regions around
    the edges with no data.  Beware though.  Often the collar is
    black, but black pixels also occur within the image.  This can
    result in odd holes in your image.

2) Tools exist for stripping off collar from particular map products.
    I'm not sure if these are open source though.  For instance,
    for stripping the collars off USGS DRG (right name?) quadrangle
    maps.

3) You may need to create a polygon that identifies the portion of
    the map that is valid, so that it can be blanked out or set to
    an opacity of zero.  If you are lucky the map borders fall on some
    nice border (ie. particular lat/long boundaries) and the mask
    polygons can be auto-generated.  Otherwise you may be reduced
    to digitizing boundaries for each map manually.

    These polygons would then be used to burn a unique offsite value
    usable via case (1), or you can turn your map into an RGBA image
    and set the alpha to zero for all areas outside the valid polygon.   In
    theory at least, there are GDAL tools you could use for this.

Generally speaking though, you are likely facing substantial
effort to use these maps and a nice mosaic.

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 mapserver-users mailing list