[mapserver-users] Need Help with Custom (Raster) Data as Input

Muizudeen Kusimo devboyng at gmail.com
Tue Jan 20 03:42:33 PST 2009


Dear Rahkonen,

Thank you for your mail, it was very helpful.

I have done the following:

1) Converted my .jpeg files to .tif and run the gdaltindex program to
georeference them. It returned a .shp, .shx and .dbf files. But I don't have
any .tfw file yet. Please see output of GDALTINDEX below.

2) I tested my .map file with the shp2img utility and it generated a blank
(white) .png file for me. Expectedly, the same blank file displays as blank
in the browser (i.e. Ka-Map UI).

My new questions:

1) My maps were scanned from a paper map, does this affect my ability to
Georeference them?
2) How do I determine the Projection of the scanned map images?

Thanks.

GDALTINDEX OUTPUT (condensed):
==========================
C:\ms4w\Apache\cgi-bin>gdalinfo c:\ms4w\apps\test\tmp\pg19.tif
Driver: GTiff/GeoTIFF
Files: c:\ms4w\apps\test\tmp\pg19.tif
Size is 1098, 1696
Coordinate System is `'
Metadata:
  TIFFTAG_XRESOLUTION=200
  TIFFTAG_YRESOLUTION=200
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 1696.0)
Upper Right ( 1098.0,    0.0)
Lower Right ( 1098.0, 1696.0)
Center      (  549.0,  848.0)
Band 1 Block=1098x8 Type=Byte, ColorInterp=Palette
  Color Table (RGB with 256 entries)
    0: 0,0,0,255
    1: 165,171,167,255
    2: 255,197,98,255
    3: 239,168,102,255
    4: 206,150,75,255
     .
     . #removed to conserve space
     .
  255: 177,169,148,255

C:\ms4w\Apache\cgi-bin>

The test.map file I used:
=================
MAP
 NAME test
 STATUS ON
 SIZE 1280 1280
 EXTENT -2200000 -712631 3072800 3840000
 UNITS DD
 #IMAGECOLOR 255 255 255
 IMAGETYPE JPEG

 WEB
   IMAGEPATH "c:\ms4w\apps\test\tmp\"
   IMAGEURL "c:\ms4w\apps\test\"
 END

 LEGEND
   TRANSPARENT TRUE
 END

 SCALEBAR
   TRANSPARENT TRUE
 END

 LAYER
   NAME "My Sample Location"
   TYPE RASTER
   STATUS ON
   TILEINDEX "tmp\pg19.shp"
   TILEITEM "Location"
 END
END #MAP END


@Venkat

I hope my mail gives a clearer picture of my status for your further advice.

Thanks.

On Tue, Jan 20, 2009 at 1:04 AM, Rahkonen Jukka
<Jukka.Rahkonen at mmmtike.fi>wrote:

>  Hi,
>
> First of all your jpeg files need to be georeferenced.  Jpeg files are most
> often georeferenced with world files which are named as .jgw.  Sometimes
> they are named as .tfw, even that name is actually reserved for tiff files.
> And Mapserver understands also world files named as .wld.
> If your images are georeferenced you can continue to building one single
> layer from all of your images.  It is done with gdaltindex utility program.
> Gdaltindex is building a shapefile that records the extents of all the
> images to be indexed.
> Third step is to make a new raster layer that is using the shapefile index
> as a catalogue for finding the actual image files that needs to be opened
> when user is requesting a map from a certain area.
>
> This should be enough to show you images as a single layer.  It would be a
> benefit to know the projection where the images are because otherwise they
> cannot be reprojected.  And for optimising performance it may be good to
> convert jpeg images to tiffs, but you can just start from jpegs and see if
> you are happy with the speed.
> In conclusion:
> 1. Check georeferencing and projection, gdalinfo program is a good help in
> this.
> 2. Make tileindex with gdaltindex
> 3. Make a new raster layer in mapfile referring to just created tileindex
> file.
>
> -Jukka Rahkonen-
>
>
>  ------------------------------
> *Lähettäjä:* mapserver-users-bounces at lists.osgeo.org [mailto:
> mapserver-users-bounces at lists.osgeo.org] *Puolesta *Muizudeen Kusimo
> *Lähetetty:* 20. tammikuuta 2009 10:45
> *Vastaanottaja:* mapserver-users at lists.osgeo.org
> *Aihe:* [mapserver-users] Need Help with Custom (Raster) Data as Input
>
> Hello Everyone,
>
> I am new to MapServer, however I am working on an application that is
> similar to Google Maps albeit with my own custom maps.
>
> The problem is:
>
> 1) I have several maps mostly in .jpeg format and would like to use them as
> Data Inputs for this Web Application. I can't seem to get it done correctly.
> Must I convert these maps to a SHAPEFILE i.e. .shp or what? If so, how do I
> convert them?
>
> My development platform is:
>
> - Microsoft Windows XP
> - Ka-Map
> - MapServer (MS4W)
>
> Thanks.
>
> NB: I am re-reading the documentation for a solution.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090120/0344e76e/attachment.htm>


More information about the MapServer-users mailing list