[mapserver-users] Use EXTENT to crop an image within a map file

Enzmann, Alexander R. xander at mitre.org
Fri Sep 9 10:28:38 EDT 2011


Is it possible to only use a subset of an image that is referenced in a mapfile?  In the mapfile below there are two FAA sectional charts.  There are borders on the charts that I don't want on the final composite image.

If the "EXTENT" actually clipped the image before rendering, I could get what I'm looking for, but it only seems to be used to determine overlap with the bounds of the output image (and not always then).

I'm sure I could use something like gdal_translate to preprocess all of the charts, but that a really tedious sort of task and results in extra images lying around.  Would prefer to use source images and have the mapfile pull the correct bits out of them.

The charts are available at: http://aeronav.faa.gov/index.asp?xml=aeronav/applications/VFR/chartlist_sect

Xander

#
# MapServer map file for FAA Sectional Raster charts (test case w/ only two charts)
#
MAP
  NAME "FAA Sectional Raster"
  IMAGETYPE PNG
  SIZE 256 256
  DEBUG OFF
  UNITS DD
  SHAPEPATH "/MapData/FAA/SectionalRaster"

  PROJECTION "init=epsg:4269" END

 WEB
    METADATA
      "wms_srs" "EPSG:900913 EPSG:4326"
      "ows_enable_request" "*"
    END
  END

  LAYER
    NAME "LA North" DATA "Los Angeles 89 North.tif"
    STATUS ON TYPE RASTER DUMP TRUE PROJECTION "auto" END
  END

  LAYER
    NAME "LA South" DATA "Los Angeles 89 South.tif"
    STATUS ON TYPE RASTER DUMP TRUE
    PROJECTION "+proj=lcc +lat_1=38.66667 +lat_2=33.33333 +lat_0=34.16667 +lon_0=-118.5" END
    EXTENT -122 32 -119 34 END
  END

END
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110909/8fa912e3/attachment.html


More information about the mapserver-users mailing list