[Mapserver-users] Rasterization help, TIF->SHP

Ed McNierney ed at topozone.com
Mon Jun 23 14:32:18 EDT 2003


I think you're mixing a few apples and oranges here.

"Rasterization" is the process of converting vector data to raster data, not the other way around.  MapServer and GDAL provide NO tools for converting raster images into vector data, as that is a complex and rather specialized topic.

GDALTINDEX is used to create a "tile index" file.  This is a vector (SHP) file that consists of rectangular polygons describing the outlines of each of a set of raster input images.  It is used to create an "index file" that allows multiple raster images to be combined into a single map layer for MapServer.

Since this SHP file is just a single rectangle defining the outline of your raster image, it's not surprising that your MapScript test creates a blank image.

What exactly are you trying to accomplish?

	- Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
ed at topozone.com
(978) 251-4242 

-----Original Message-----
From: poff [mailto:poff at sixbit.org]
Sent: Monday, June 23, 2003 1:55 PM
To: mapserver-users at lists.gis.umn.edu
Subject: [Mapserver-users] Rasterization help, TIF->SHP


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




More information about the mapserver-users mailing list