[mapserver-users] Problem loading geotifs
ecodavid at rci.rutgers.edu
ecodavid at rci.rutgers.edu
Sat Oct 23 17:54:24 PDT 2010
Jukka,
When I open the image in an image viewer, there is twice as much spatial
coverage as is being rendered by Mapserver. So something is definately
wrong.
The output from mapserver (i.e. rendering only the northern half of the
image) is the same whether or not I use tileindex. If I don't use OFFSITE
then the area around the image is colored black. This black region covers
the areas that are out of range of the satellite granule as well as the
parts of the image that are not being rendered properly by Mapserver.
These are monochrome images. I'll try using just 0 for offsite and see
what happens.
David
> Hi,
>
> Looks quite normal to me, odd. Two things to test, though
> - Is the output OK if you use one single image as an input instead of
> tileindex?
> - What does the output look like without OFFSITE? Your images have just
> one band, I do not know if OFFSITE should be given just as "0" in that
> case.
>
> I have used successfully Landsat imagegy covering whole Finland (close to
> 200 images in 7-band JPEG2000 or GeoTIFF format) through tileindex so I
> know it is possible but it was a few years ago. Perhaps I can find my old
> mapfile next week.
>
> -Jukka-
>
>
> -----Alkuperäinen viesti-----
> Lähettäjä: David Hill [mailto:ecodavid at rci.rutgers.edu]
> Lähetetty: la 23.10.2010 23:51
> Vastaanottaja: Rahkonen Jukka; mapserver-users at lists.osgeo.org
> Aihe: Re: [mapserver-users] Problem loading geotifs
>
> I am already using offsite to remove black (0,0,0) from the image.
> But I don't think the problem is not caused by overlaps in the tiles
> because it happens if I only use one tile.
>
> The gdalinfo is:
> Driver: GTiff/GeoTIFF
> Files: p013r032_7p20001020_z18_nn80.tif
> Size is 17480, 15488
> Coordinate System is:
> PROJCS["WGS 84 / UTM zone 18N",
> GEOGCS["WGS 84",
> DATUM["WGS_1984",
> SPHEROID["WGS 84",6378137,298.257223563,
> AUTHORITY["EPSG","7030"]],
> AUTHORITY["EPSG","6326"]],
> PRIMEM["Greenwich",0],
> UNIT["degree",0.0174532925199433],
> AUTHORITY["EPSG","4326"]],
> PROJECTION["Transverse_Mercator"],
> PARAMETER["latitude_of_origin",0],
> PARAMETER["central_meridian",-75],
> PARAMETER["scale_factor",0.9996],
> PARAMETER["false_easting",500000],
> PARAMETER["false_northing",0],
> UNIT["metre",1,
> AUTHORITY["EPSG","9001"]],
> AUTHORITY["EPSG","32618"]]
> Origin = (514189.875000000000000,4576366.125000000000000)
> Pixel Size = (14.250000000000000,-14.250000000000000)
> Metadata:
> TIFFTAG_XRESOLUTION=72
> TIFFTAG_YRESOLUTION=72
> TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
> AREA_OR_POINT=Point
> Image Structure Metadata:
> INTERLEAVE=BAND
> Corner Coordinates:
> Upper Left ( 514189.875, 4576366.125)
> Lower Left ( 514189.875, 4355662.125)
> Upper Right ( 763279.875, 4576366.125)
> Lower Right ( 763279.875, 4355662.125)
> Center ( 638734.875, 4466014.125)
> Band 1 Block=17480x1 Type=Byte, ColorInterp=Gray
>
> I am tiling by using
> gdaltindex to create a shapefile of the tiles using a command similar to
> gdaltindex tile.shp *.tif
>
> The layer definition is
> LAYER
> NAME "landsat"
> METADATA
> "wcs_label" "Landsat 7"
> "wcs_rangeset_name" "Range 1"
> "wcs_rangeset_label" "My Label"
> END
> STATUS OFF
> TYPE RASTER
> TILEINDEX "data/Landsat/ETM/band8/subtiles/tindex.shp"
> TILEITEM "LOCATION"
> OFFSITE 0 0 0
>
> PROJECTION
> # UTM zone 18
> "init=epsg:26918"
> END
>
> DUMP TRUE
> END
>
> I thought the problem might be caused by the size of the tif files, so I
> used gdal_translate to subset the tif files. I tried it for one landsat
> image. The result was the same. The top half of the image renders and
> the bottom half of the image does not. I tried multiple subset sizes
> ranging from 15x15 which reduces the file size to less than 1% to 1x1
> which is the original size. The result is that the bottom half of the
> image won't render in Mapserver.
>
> I attached two images of the problem to this email.
> error_originalresolution.png This file shows a single landsat7 geotif
> as downloaded from the USGS archive. The pixels it is easy to see that
> there is a horizontal line running across the pixel which is not in the
> same coordinate plane as the image. Offsite is turned on, so the bottom
> half of the pixel renders as transparent.
>
> error_with_subtiles.png this files shows data from the same landsat7
> image as the prior image. However, these data were rendered in
> Mapserver by first dividing the original pixel into 15x15 subtiles and
> plotting them. Only half of each subtile renders. This leads to a
> banded appearance.
>
> I've also noticed that each time I render the data using Mapserver, the
> affected region is slightly different.
>
> Thanks for the Help!
>
>
> On 10/23/2010 3:38 PM, Rahkonen Jukka wrote:
>> Hi,
>>
>> My guess is that the data area of your Landsat images are not
>> North-South oriented and they have triangular no-data areas in the
>> corners. Adjacent images are overlapping when you view them together
>> and no-data area from one image is covering the real data of the image
>> underneath. The cure is to use OFFSITE in the mapfile to tell what pixel
>> value should be made transparent. No-data value is often stored in the
>> geotiff metadata and you can check it with gdalinfo. Perhaps most often
>> it is all black (0 0 0). But this is just a guess and if I did not hit,
>> please
>> - send a gdalinfo report of one image
>> - send the command you used for tiling
>> - send the LAYER definition you have used in the mapfile
>>
>> -Jukka Rahkonen-
>>
>>
>> -----Alkuperäinen viesti-----
>> Lähettäjä: mapserver-users-bounces at lists.osgeo.org puolesta:
>> ecodavid at rci.rutgers.edu
>> Lähetetty: la 23.10.2010 21:04
>> Vastaanottaja: mapserver-users at lists.osgeo.org
>> Aihe: [mapserver-users] Problem loading geotifs
>>
>> I am trying to add Landsat7 images to my mapserver project. I have
>> downloaded the images in geotif format from the USGS. These images
>> correspond to a rectangular snapshot over the region. Since multiple
>> geotiffs are needed to cover my region, I am tiling the images using
>> gdal.
>>
>> Here is the problem I am having: The geotiffs render only partially.
>> For
>> example, the top half of the image will render, and the bottom half will
>> not. I have opened the geotiff files in several image editors and can
>> view the entire region, so I am assuming that the problem is somewhere
>> in
>> the Mapserver rendering. Also, I have tried inserting the image
>> directly
>> (i.e. not using tiling) and get the same result.
>>
>> Can anyone help me out?
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>
>
More information about the MapServer-users
mailing list