Image tilling

Brent Fraser bfraser at GEOANALYTIC.COM
Sun Jul 2 09:12:46 PDT 2006


Ryan,

  The most important thing for a project like this is (I think you want to
display the imagery, not just the index of the imagery) to pick a
coordinate system to display your data in.  Typically "unprojected"
(also known as Geographic) is used.  For performance reasons, it's best
to have your source data in the same coordinate system (so mapserver
does not have to re-project the data).

Once you've decided on the coordinate systems, set the EXTENT and
PROJECTION in the map file:

EXTENT -180 -90 180 90
UNITS 'dd'
PROJECTION
  "proj=latlong"
  "ellps=WGS84"
  "datum=WGS84"
END

And if the source data is in a different coordinate system you need to
specify it in the LAYER definition.



Brent Fraser



> What I am trying to do is to georeference aerial photos of a large area,
> eventually the entire earth.  So what I need is to be able to specify the
> lat/long of each photo (which I have) using only the lat/long coordinate
> system.  I would like the user to be able to specify a bounding box
> (lat/long)
> for a given area then have my mapserver return all the available images
> for
> that given area.  Currently I think that I can use:
>
> gdal_translate -a_ullr 180 0 210 -30  thm_dir_N-30_180.png
> thm_dir_N-30_180.tiff
>
> To georeference all of my photos, then:
>
> gdaltindex thm_dir.shp *.tif
>
> To create a shape file with an index of all the photos, then I can specify
> my
> layer in the mapfile as:
>
> LAYER
>   NAME "tileindex"
>   STATUS ON
>   TILEINDEX "thm_dir.shp"
>   TILEITEM "Location"
>   TYPE RASTER
> END
>
> But when I display this layer in MapServer I get a blank image,  and when
> I try
> to view the shape file in ArcMap I can see my tiles but they are just
> displayed
> as blank polygons with no images.  I think that my problem is incorrectly
> specifying the EXTENT in the map file, but i am not sure what i should put
> if i
> want my tiles to eventually cover then entire world.
>
> Thanks,
> -Ryan
>
> Here is my entire map file incase that helps any:
> NAME WMSDEMO
> STATUS ON
> SIZE 500 400
> #EXTENT 0 0 2800 2800
> #EXTENT -180 -90 180 90
> EXTENT -9200000 -912631 3072800 3840000
> #UNITS METERS
> SHAPEPATH "../data"
> IMAGECOLOR 255 255 255
>
> WEB
>   TEMPLATE test_template.html
>   IMAGEPATH "/tmp/ms_tmp/"
>   IMAGEURL "/ms_tmp/"
>   METADATA
>     WMS_TITLE   "WMS test mapserver"
>     WMS_ACCESSCONSTRAINTS "none"
>     #WMS_ONLINERESOURCE "http://neuron/cgi-bin/mapserv?map=display.map&"
>     WMS_SRS     "EPSG:4326" #"AUTO:42003"
>   END
> END
>
> PROJECTION
>   "init=epsg:4326"
> END
>
> LAYER # Shaded Relief Raster
>   NAME test_layer
>   DATA bath_mapserver.tif
>   STATUS ON
>   TYPE RASTER
> END
>
> LAYER
>   NAME "hpool"
>   STATUS ON
>   #DATA "thm_dir_00_030.tiff"
>   TILEINDEX "thm_dir.shp"
>   #TILEITEM "Location"
>   TYPE RASTER
> END
>
>
> END # of map file
>



More information about the MapServer-users mailing list