Raster Layer, Extent, etc.

Fawcett, David David.Fawcett at STATE.MN.US
Tue Jul 5 13:43:17 PDT 2005


Ian, 

I am guessing that the projection is causing your issues.  

The projection block in the MAP object (at the top of the map file) applies to the whole map file.  You set this to the projection that you want to output your data in.  The EXTENT and UNITS should be in the units of this projection.  

In each LAYER, you need to define the projection that the input data for that layer is in.  So, you have a PROJECTION ....   END block in each layer.  

At a minimum, you need to add a PROJECTION block to your 'counties' layer.  From your description, your raster may be unprojected (lat lon).  

David.

David Fawcett
Minnesota Office of Environmental Assistance
david.fawcett at moea.state.mn.us
651.215.0200


-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]On
Behalf Of Ian Harding
Sent: Tuesday, July 05, 2005 3:21 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] Raster Layer, Extent, etc.


I have no idea what I am doing.

I can get mapserver to work as advertised with vector data (geographic
coordinate system) and with raster data (some other crazy coordinate
system) but can't get the twain to meet.  

When I change the extent (as seen in the commented section) one or the
other layers will display, but not both.  I have controls that
successfully turn the layers off and on in isolation, so I know it's not
the DEFAULT versus ON issue.

The system seems to be very forgiving of bad stuff (or absense of any
stuff) in the "projection" section, and the "units" just screws up the
scalebar, but the "extent" seems to be killing me.  

There is only one "extent" section, which applies to the whole mapfile,
right?  From what I have read, the various layers can use different
coordinate systems and be 'translated' to the overall mapfile extent and
coordinate system.  This is not working for me.

What could be causing my pain here?

Thank you in advance....

- Ian

MAP
  IMAGETYPE      PNG24
  EXTENT         -122.5 46.5 -121.8 47.8
  UNITS          DD
#  Uncommenting these (and commenting the above) makes the raster image
appear.
#  EXTENT 1060000.000000 460000.000000 1460000.000000 660000.000000
#  UNITS                FEET
  SIZE           400 300
  SHAPEPATH      "pierceco"
  IMAGECOLOR     255 255 255

  PROJECTION
   "proj=latlong"
   "datum=NAD83"
   "init=epsg:32149"
  END

  SYMBOLSET      "symbols/symbols35.sym"
  FONTSET        "fonts/fonts.list"

  WEB
    TEMPLATE  'pierce.html'
    IMAGEPATH '/data/tmp/'
    IMAGEURL  '/tmp/'
  END


  # Start of scalebar
  #
  SCALEBAR
    IMAGECOLOR 255 255 255
    LABEL
      COLOR 0 0 0
      SIZE TINY
    END
    STYLE 1
    SIZE 100 2
    COLOR 0 0 0
    UNITS MILES
    INTERVALS 2
    TRANSPARENT FALSE
    STATUS ON
  END

  # Start of LAYER DEFINITIONS
---------------------------------------------



  LAYER
    CONNECTIONTYPE postgis
    NAME "counties"
    # Connect to a remote spatial database
    CONNECTION "user=user dbname=dbname host=localhost"
    DATA "the_geom from gis.wa_counties"
    STATUS ON
    TYPE POLYGON
    FILTER "true"
    LABELITEM "name"
    CLASS
      COLOR        232 232 232
      OUTLINECOLOR 32 32 32
      LABEL
        COLOR 0 0 0
        OUTLINECOLOR 255 255 255
        TYPE TRUETYPE
        FONT arial
        SIZE 10
        ANTIALIAS TRUE
      END
    END
  END


  LAYER
    NAME         "relief"
    STATUS       ON
    TILEINDEX "topo.shp"
    TILEITEM "location"
    TYPE         RASTER
#    PROJECTION
#       I was told this data was in "State Plane Feet NAD 83 WA South
4602"
#       Have tried all kinds of incantations in this section to no
effect.
#    END
  END 
  # End of LAYER DEFINITIONS -------------------------------
    
END # end of map file/object                                            
                   



More information about the MapServer-users mailing list