[mapserver-users] Raster layer problem

Jean-François Gigand jean-francois at gigand.fr
Tue Jan 25 02:18:49 PST 2011


Hi,

>From your gdalinfo output:
Upper Left  (       0.000, 1300000.000)
Lower Left  (   0.0000000,   0.0000000)
Upper Right (  700000.000, 1300000.000)
Lower Right (  700000.000,       0.000)
Center      (  350000.000,  650000.000)

So the extent in the map file would be:
EXTENT 0 0 700000, 1300000

Then your TIFF should appear in the output of shp2img.
However, these do not seem to be geographical units. Anyway, it does
match the extent of your layers seen in your first message.
I think your .tab file is not taken into account.

Try with a world file (.tfw) which is more "standard", or better, make
it a GeoTIFF (use GDAL tools for that).

Jeff

2011/1/24 Carl Burn <burnsy at northcountrywoods.co.uk>:
> Hi,
> thanks for the ideas. Have tried this and here is what I got back from
> gdalinfo (I couldnt seem to get ogrinfo to run on my tif files):
>
> D:\ms4w\tools\gdal-ogr>gdalinfo
> D:\opendata\minisc_gb\MiniScale\data\miniscaleno
> grid.tif
> Warning 1: TIFFFetchNormalTag:Incompatible type for "RichTIFFIPTC"; tag
> ignored
> Driver: GTiff/GeoTIFF
> Files: D:\opendata\minisc_gb\MiniScale\data\miniscalenogrid.tif
> Size is 7000, 13000
> Coordinate System is `'
> Origin = (0.000000000000000,1300000.000000000000000)
> Pixel Size = (100.000000000000000,-100.000000000000000)
> Metadata:
>   TIFFTAG_SOFTWARE=Adobe Photoshop CS4 Macintosh
>   TIFFTAG_DATETIME=2009:12:04 12:52:34
>   TIFFTAG_XRESOLUTION=254
>   TIFFTAG_YRESOLUTION=254
>   TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
> Image Structure Metadata:
>   COMPRESSION=LZW
>   INTERLEAVE=PIXEL
> Corner Coordinates:
> Upper Left  (       0.000, 1300000.000)
> Lower Left  (   0.0000000,   0.0000000)
> Upper Right (  700000.000, 1300000.000)
> Lower Right (  700000.000,       0.000)
> Center      (  350000.000,  650000.000)
> Band 1 Block=7000x12 Type=Byte, ColorInterp=Red
> Band 2 Block=7000x12 Type=Byte, ColorInterp=Green
> Band 3 Block=7000x12 Type=Byte, ColorInterp=Blue
> I took all of the stuff out of the map file with the exception of the extent
> and ran shp2img and it runs without any problem, generating a blank png
> image. I guess I need to add the correct extent information to get the image
> to display?
> Cheers
> Carl
> On Mon, Jan 24, 2011 at 2:29 PM, Jeff McKenna
> <jmckenna at gatewaygeomatics.com> wrote:
>>
>> Hello,
>>
>> Here are my quick thoughts:
>>
>> - remove all projection objects from your mapfile
>> - remove all layers from your mapfile except the one raster/tif layer
>> - use the ogrinfo utility, which is included in MS4W, to get the extents
>> of your tif file (http://www.gdal.org/ogrinfo.html)
>> - use those extents in your mapfile's EXTENT parameter
>> - test your mapfile with the shp2img utility, which is also included in
>> MS4W (http://www.mapserver.org/utilities/shp2img.html)
>> - note that MS4W is already configured for the following IMAGEPATH and
>> IMAGEURL parameters:
>>
>>    IMAGEPATH "/ms4w/tmp/ms_tmp/"
>>    IMAGEURL "/ms_tmp/"
>>
>> (the above imagepath value assumes that you have MS4W installed at a root
>> of a drive...if you used the setup.exe installer you might have installed it
>> elsewhere, so that imagepath value might be different)
>>
>> Hope those quick thoughts help.
>>
>> -jeff
>>
>>
>>
>> --
>> Jeff McKenna
>> MapServer Consulting and Training Services
>> http://www.gatewaygeomatics.com/
>>
>>
>>
>>
>> On 11-01-24 5:57 AM, Carl Burn wrote:
>>>
>>> Hello All,
>>>
>>> I am a newcomer to this list so forgive me if I make any blunders.
>>> I am trying to render a map image from mapserver using a tif file which
>>> has a georeferencing .tab file  in the same folder and I am getting
>>> nowhere with it. The tab file content is as follows:
>>>
>>> ======= TAB File ==================
>>> !table
>>> !version 300
>>> !charset WindowsLatin1
>>>
>>> Definition Table
>>>   File "MiniScalenogrid.tif"
>>>   Type "RASTER"
>>>   (0,0) (0,13000) Label "Pt 1",
>>>   (700000,0) (7000,13000) Label "Pt 2",
>>>   (700000,1300000) (7000,0) Label "Pt 3",
>>>   (0,1300000) (0,0) Label "Pt 4"
>>>   CoordSys Earth Projection 8, 79, "m", -2, 49, 0.9996012717, 400000,
>>> -100000
>>>   Units "m"
>>>   RasterStyle 7 0
>>>
>>> ========Tab File ends =======================
>>>
>>> The mapfile is below:
>>>
>>> ========== Map file =========================
>>>
>>> MAP
>>>   NAME "osminiscale"
>>>   # Map image size
>>>   SIZE 800 800
>>>   UNITS meters
>>>
>>>   EXTENT 41069.1 -1149.02 665378.01 1231178.57
>>>   FONTSET './etc/fonts.txt'
>>>   SYMBOLSET './etc/symbols.sym'
>>>   PROJECTION
>>> 'init=epsg:27700'
>>>   END
>>>
>>>   # Background color for the map canvas -- change as desired
>>>   IMAGECOLOR 255 255 255
>>>   IMAGEQUALITY 95
>>>   IMAGETYPE png
>>>
>>>   OUTPUTFORMAT
>>>     NAME png
>>>     DRIVER 'GD/PNG'
>>>     MIMETYPE 'image/png'
>>>     IMAGEMODE RGBA
>>>     EXTENSION 'png'
>>>   END
>>>   # Legend
>>>   LEGEND
>>>       IMAGECOLOR 255 255 255
>>>     STATUS OFF
>>>     KEYSIZE 18 12
>>>     LABEL
>>>       TYPE BITMAP
>>>       SIZE MEDIUM
>>>       COLOR 0 0 89
>>>     END
>>>   END
>>>
>>>   # Web interface definition. Only the template parameter
>>>   # is required to display a map. See MapServer documentation
>>>   WEB
>>>     # Set IMAGEPATH to the path where MapServer should
>>>     # write its output.
>>>     IMAGEPATH '/tmp/'
>>>
>>>     # Set IMAGEURL to the url that points to IMAGEPATH
>>>     # as defined in your web server configuration
>>>     IMAGEURL '/tmp/'
>>>
>>>     # WMS server settings
>>>     METADATA
>>> 'ows_title' 'miniscale'
>>> 'ows_onlineresource'
>>>
>>> 'http://www.foobar.com/cgi-bin/mapserv.exe?map=D:/ms4w/Apache/cgi-bin/osminiscale.map'
>>> 'ows_srs' 'EPSG:27700'
>>>     END
>>>
>>>     #Scale range at which web interface will operate
>>>     # Template and header/footer settings
>>>     # Only the template parameter is required to display a map. See
>>> MapServer documentation
>>>     TEMPLATE 'fooOnlyForWMSGetFeatureInfo'
>>>   END
>>>
>>>   LAYER
>>>     NAME 'MiniScalenogrid'
>>>     TYPE RASTER
>>>     DUMP true
>>>     TEMPLATE fooOnlyForWMSGetFeatureInfo
>>>   EXTENT 41069.1 -1149.02 665378.01 1231178.57
>>>     DATA 'D:/opendata/minisc_gb/MiniScale/data/MiniScalenogrid.tif'
>>>     METADATA
>>> 'ows_title' 'MiniScalenogrid'
>>> 'ows_srs' 'EPSG:27700'
>>>     END
>>>     STATUS OFF
>>>     TRANSPARENCY 100
>>>     PROJECTION
>>> 'init=epsg:27700'
>>>     END
>>>   END
>>>
>>>   LAYER
>>>     NAME 'MiniScalewithgrid'
>>>     TYPE RASTER
>>>     DUMP true
>>>     TEMPLATE fooOnlyForWMSGetFeatureInfo
>>>   EXTENT 41069.1 -1149.02 665378.01 1231178.57
>>>     DATA 'D:/opendata/minisc_gb/MiniScale/data/MiniScalewithgrid.tif'
>>>     METADATA
>>> 'ows_title' 'MiniScalewithgrid'
>>> 'ows_srs' 'EPSG:27700'
>>>     END
>>>     STATUS OFF
>>>     TRANSPARENCY 100
>>>     PROJECTION
>>> 'init=epsg:27700'
>>>     END
>>>   END
>>>
>>> END
>>>
>>>
>>> ============ Map File ends ==========================
>>>
>>> I am not getting an image from the map server and have run shp2img with
>>> the following results:
>>>
>>> msProcessProjection(): Projection library error. unknown elliptical
>>> parameter name
>>>
>>> Any clues or pointers would be great.
>>>
>>> Thanks
>>>
>>> Burnsy
>>>
>>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
> _______________________________________________
> 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