[Mapserver-users] Re: Tif-Shp : HOWTO (basic)
poff
poff at sixbit.org
Tue Jun 24 15:03:53 PDT 2003
Here is a basic "howto" for getting a TIF image to show as a layer:
-Convert to 8bit (looks a lot better)
-Create a .wld file
-Run gdaltindex creating the shapefile
-Add the following as a layer in your mapfile:
LAYER
NAME "countries"
STATUS DEFAULT
DATA test.tif
TYPE RASTER
END
Voila, I got that to work nicely thanks to help from people on the list,
without the shp files nothing shows at all (why?), don't know why 24bit
looks ugly.
Hope this helps someone out there!
P.
On Mon, Jun 23, 2003 at 07:55:11PM
+0200, poff wrote:
> Hello,
>
> I'm slightly new to this, but I tried following the instructions in the
> documentation, and I am getting a 236 byte shp file from a 20something mb
> tiff.
>
> I will post my steps so you can perhaps tell me where I'm going wrong?
>
> I'm using mapscript and apache on win2k.
>
> ################################
> Tif file converted to 8bit uncompressed, 8192x4096, 32mb.
>
> (if I view with ACDSee it states 256 colours, then in "properties" it
> states 24 bit - by eye you can see it's 256 colour)
>
> Wld file made:
>
> 0.0439453125
> 0
> 0
> -0.0439453125
> -180
> +90
>
> With the map file:
>
> NAME WORLD_MAP
> EXTENT -180 -90 180 90
> SIZE 600 300
> IMAGETYPE GIF
> IMAGECOLOR 0 0 128
> SHAPEPATH "data"
> #FONTSET "d:/www/htdocs/data/symbols/fontset.txt"
> #SYMBOLSET "data/symbols/examples.sym"
> UNITS DD
>
> WEB
> IMAGEPATH "d:/www/htdocs/imgtmp/"
> IMAGEURL "/imgtmp/"
> END
>
> LAYER # Countries
> NAME "countries"
> DATA "test"
> STATUS DEFAULT
> TYPE polygon
> CLASS
> COLOR 220 220 220
> END # end of class object
>
> END # end of layer object
>
> END # end of map file
>
> Ran:
>
> gdaltindex test.shp test.tif
>
> Generates a 236 byte shpfile, which gives a blank map (coloured) on output
> with:
>
> <?
>
> $oMap = ms_newMapObj("test.map", "d:/www/htdocs/");
> $oImage = $oMap->draw();
>
> $url = $oImage->saveWebImage(MS_GIF,0,0,0);
> printf("<IMG SRC=%s WIDTH=%d HEIGHT=%d>\n", $url, $oMap->width,
> $oMap->height);
>
> ?>
>
> Anyone got any ideas what's going wrong? I'm pretty sure something is wrong
> with gdaltindex, shouldn't the shp file be a lot bigger?
>
> I'd be very thankful for any light shed on this!
>
> --
> poff at sixbit.org
> SDF Public Access UNIX System - http://sdf.lonestar.org
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
--
poff at sixbit.org
SDF Public Access UNIX System - http://sdf.lonestar.org
More information about the MapServer-users
mailing list