[mapserver-users] Projections and raster files

Fawcett, David (MNIT) David.Fawcett at state.mn.us
Thu Aug 29 08:43:14 PDT 2013


David,

Take a look at the map extent and units.  They should be the units used by your output spatial reference system.

In your current map file, you have DD for the units, for 3857, they should be meters.  You will also want to express your extent in 3857 coords.

David.

From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of David Power
Sent: Thursday, August 29, 2013 10:01 AM
To: MapserverList OSGEO
Subject: [mapserver-users] Projections and raster files

Hello,

I have a number of geotiffs which are currently using epsg:4326 and I would like to output a region using epsg:3857.

I am new to mapserver but from what I have read the way achieve this is by setting the projection of the map to epsg:3857 and the layer to epsg:4326.

When I set the projections to the same value I get the output I expect without a problem, if I set the projections to different values I do not get an error but the output is blank.

To make life more complicated I am using mapscript via the Java swig interface, the version of mapserver I am using is mapserver 6.1.2.1 which I built from source.

If anybody has any advice I would be most grateful.

David

-

gdalinfo gives the following information about one of the files:

Driver: GTiff/GeoTIFF
Files: globcover_n10e005.tif
Size is 7200, 7200
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (5.000000000000000,9.999999999999615)
Pixel Size = (0.000138888888889,-0.000138888888889)
Metadata:
  DataType=Generic
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (   5.0000000,  10.0000000) (  5d 0'0.00"E, 10d 0'0.00"N)
Lower Left  (   5.0000000,   9.0000000) (  5d 0'0.00"E,  9d 0'0.00"N)
Upper Right (   6.0000000,  10.0000000) (  6d 0'0.00"E, 10d 0'0.00"N)
Lower Right (   6.0000000,   9.0000000) (  6d 0'0.00"E,  9d 0'0.00"N)
Center      (   5.5000000,   9.5000000) (  5d30'0.00"E,  9d30'0.00"N)
Band 1 Block=7200x128 Type=Byte, ColorInterp=Gray
  NoData Value=0

-

The map file is built programmatically, the following is the result of saving the map object to file:

MAP
  EXTENT 5 9.9 5.1 10
  IMAGETYPE "png"
  NAME "blank"
  SIZE 800 800
  STATUS ON
  UNITS DD

  OUTPUTFORMAT
    NAME "png"
    MIMETYPE "image/png"
    DRIVER "AGG/PNG"
    EXTENSION "png"
    IMAGEMODE RGB
    TRANSPARENT FALSE
  END # OUTPUTFORMAT

  PROJECTION
    "init=epsg:3857"
  END # PROJECTION
  LEGEND
    KEYSIZE 20 10
    KEYSPACING 5 5
    LABEL
      SIZE MEDIUM
      OFFSET 0 0
      SHADOWSIZE 1 1
      TYPE BITMAP
    END # LABEL
    STATUS OFF
  END # LEGEND

  QUERYMAP
    SIZE -1 -1
    STATUS OFF
    STYLE HILITE
  END # QUERYMAP

  SCALEBAR
    INTERVALS 4
    LABEL
      SIZE MEDIUM
      OFFSET 0 0
      SHADOWSIZE 1 1
      TYPE BITMAP
    END # LABEL
    SIZE 200 3
    STATUS OFF
    UNITS MILES
  END # SCALEBAR

  WEB
  END # WEB

  LAYER
    DATA "/home/leftworker/data/landcover/lefttiles/n10/globcover_n10e005.tif"
    NAME "n10e005"
    PROJECTION
      "init=epsg:4326"
    END # PROJECTION
    STATUS ON
    TILEITEM "location"
    TYPE RASTER
    UNITS DD
  END # LAYER

END # MAP





======================================
Dr David J Power
Research Officer
Department of Computer Science
University of Oxford
tel:   01865 283670
email: David.Power at cs.ox.ac.uk<mailto:David.Power at cs.ox.ac.uk>
======================================



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20130829/9246c4ac/attachment.htm>


More information about the MapServer-users mailing list