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

2009-01-26 Thread Muizudeen Kusimo
Dear All,

I appreciate the responses I have received so far but I am new to GIS so
please do not take offense at my (trivial) questions.

I want to:
a) Build a web application like Google Maps.

I have:
b) Little map data that needs to be re-drawn due to it's poor quality, lack
of geo-reference info and lack of coordinate grid.
c) Adjusted my map extents as advised by Rahkonen for display in Ka-Maps
without luck.
d) Being reading the manuals for MapServer, Ka-Map, OpenLayers and QGIS. I
hope to adopt either OpenLayers or Ka-Map as my UI + MapServer as my
backend.

I would like this list to:
e) Guide me on how to achieve my aim in (a) above using my choice of
technology in (d) below. Specifically, how do I prepare my poor maps (that
better be re-drawn) for the tools I am studying.
f) Offer any other useful advice.

Lastly, if my questions are too elementary for this list. Can someone please
point me to an appropriate list/website/irc channel.

Thanks in advance.

- Muizz
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


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

2009-01-20 Thread Rahkonen Jukka
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-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] Puolesta Muizudeen Kusimo
Lähetetty: 20. tammikuuta 2009 10:45
Vastaanottaja: mapserver-users@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.


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


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

2009-01-20 Thread Venkat Rao Tammineni
Hi,

 

  You can use raster data .but here I have some questions 

 

1)  The is georefrenced ? 

2)  Is data is projected ?

 

 

If it is you can use raster data into mapserver..

 

If you have done all above things , refer below url

 

  

 http://mapserver.org/input/raster.html#how-are-rasters-added-to-a-map-file

 

I hope this will help you.

 

Thanks,

Venkat

 

From: mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Muizudeen
Kusimo
Sent: Tuesday, January 20, 2009 2:15 PM
To: mapserver-users@lists.osgeo.org
Subject: [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.

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


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

2009-01-20 Thread Muizudeen Kusimo
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-bingdalinfo 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 -220 -712631 3072800 384
 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.rahko...@mmmtike.fiwrote:

  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-boun...@lists.osgeo.org [mailto:
 mapserver-users-boun...@lists.osgeo.org] *Puolesta *Muizudeen Kusimo
 *Lähetetty:* 20. tammikuuta 2009 10:45
 *Vastaanottaja:* mapserver-users@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.


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


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

2009-01-20 Thread Siki Zoltan

Dear Muizudeen,

On Tue, 20 Jan 2009, Muizudeen Kusimo wrote:


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.


gdaltindex doesn't create a georeference to your raster, it is usefull if 
you have many tiled georeferenced rasters.
You should get information about the coordinates of the corner of the 
scanned map or coordinates for any visible point on your scanned map.
Than you may create the tfw file by hand (if the sides of the scanned map 
are parelel to the coordinate axices it is simple). Or you can use GRASS 
or gdal utilities to calculate the transformation between your image 
coordinatesystem to the map coordinate system (e.g. UTM).




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).


AFAIK if you have a raster without georeference then Mapserver will use 
the pixel row and column number as coordinates. So now the extent sould be

0 0 1098 1696

or if the given extent in your map file are the corners of your map then
create the following georeference file (tfw)
- start of twf file
4802.18579
0
0
-2684.334316
-220
384
-- end of tfw file

But I am not sure the resolution of your raster is so different in 
northing and easting direction.




My new questions:

1) My maps were scanned from a paper map, does this affect my ability to
Georeference them?


No. But you need reference points on the map where the coordinates are 
known.



2) How do I determine the Projection of the scanned map images?


Usually it is written on. The projection is not so important if all of 
your maps use the same projection (coordinate system).


Best regards
Zoltan


Thanks.

GDALTINDEX OUTPUT (condensed):
==
C:\ms4w\Apache\cgi-bingdalinfo 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 -220 -712631 3072800 384
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.rahko...@mmmtike.fiwrote:


 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-boun...@lists.osgeo.org [mailto:
mapserver-users-boun...@lists.osgeo.org] *Puolesta *Muizudeen Kusimo
*Lähetetty:* 20. tammikuuta 2009 10:45
*Vastaanottaja:* mapserver-users@lists.osgeo.org
*Aihe:* [mapserver-users] Need Help with Custom (Raster) Data as Input

Hello Everyone,

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

2009-01-20 Thread Rahkonen Jukka
Hi,
 
You have decided to take the most rocky road that exists. Georeferencing 
scanned paper maps is not extra easy and I have not seen many good, easy to use 
free utilities for doing that. If you just want to learn Mapserver I would 
recommend you to acquire some ready, georeferenced images to start with.  But 
if you are not afraid then just go ahead.
 
First, your Mapserver map will remain empty because your output extents are 
EXTENT -220 -712631 3072800 384
 UNITS DD
while all your scanned maps have their upper left corner at point zero, zero
Upper Left  (0.0,0.0)
 
By the way, unit DD in the mapfile means decimal degrees but judged by number 
values in extent line I guess that they mean meters.
 
What you should do is to georeference your scanned images. It means that in 
some way you must tell Mapserver what place on Earth the images are presenting. 
 In most simple case giving coordinates of one corner and pixel sizes in 
east-west and south-north direction is enough. That is the information that 
ESRI style world file is giving.  For scanned maps it may not give very good 
results because images are more or less rotated.  Therefore more ground control 
points (GCP) would be needed. If the original map has coordinate grid then 
finding good GPSs is easy.  
 
A rather simple to use georeferencing utility that I have tried is available as 
Quantum GIS plugin.  Unfortunately it did not do very good job for me but it 
may have been improved since then.  I have been mostly feeding coordinates 
manually for gdal_translate utility and warped images then to target projection 
with gdalwarp but I wouldn't say that its a great pleasure to work like that.  
Combining the user interface of QGis and gdal_translate-gdalwarp chain would 
give rather a nice tool for georeferencing.
Or maybe the same functionality could be added to OpenEV that comes with 
FWTools package.
 
By the way, most simple way to get your scanned image visible is to adjust 
mapfile extents to suit your imagery there around point 0,0.  No other data 
would suit with your image but at least you can see that the system works.
 
-Jukka Rahkonen-
 


Lähettäjä: Muizudeen Kusimo [mailto:devbo...@gmail.com] 
Lähetetty: 20. tammikuuta 2009 13:43
Vastaanottaja: Rahkonen Jukka; vtammin...@roulacglobal.com; 
mapserver-users@lists.osgeo.org
Aihe: Re: [mapserver-users] Need Help with Custom (Raster) Data as Input



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-bingdalinfo 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 -220 -712631 3072800 384
 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