Raster Layer, Extent, etc.

Fawcett, David David.Fawcett at STATE.MN.US
Tue Jul 5 17:11:19 EDT 2005


Projections may make our data look 'funny', but it also lets us put features from the 3D globe on 2D paper or screens.... ; ]  

By enabling projections in MapServer, it allows us to gather data in several different projections and use them all in the same output map.  

I would go back to your data sources and find out what projection the data sets are in.  There are a lot of possible projections, so it is difficult to guess the projection by trial and error.  Better to just contact the data provider and get the original info.  If someone is familiar with The large numbers in the extents of your counties data set could possibly be feet or meters.  

ALSO, I just noticed your MAP PROJECTION block.  You are requesting both "latlong" and    "init=epsg:32149"  Try choosing one or the other, you can't have both at the same time.  

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


-----Original Message-----
From: Ian Harding [mailto:iharding at TPCHD.ORG]
Sent: Tuesday, July 05, 2005 3:57 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU; David.Fawcett at state.mn.us
Subject: RE: [UMN_MAPSERVER-USERS] Raster Layer, Extent, etc.


Thanks for the reply!  I fooled around a bit with those blocks (added
one to 'counties' too) with no luck.  As I understand projections, they
might make my data look funny, but it should at least show up, right?  I
have zoomed and panned like crazy and can't find it.

Also, in the "proj=????" bit, what other options are there besides
latlong?  This coordinate system seems to have some awfully big numbers,
that don't look like latlong to me.

I am missing something very simple here, no doubt.  Doh!

Thanks, 

Ian

>>> "Fawcett, David" <David.Fawcett at state.mn.us> 07/05/05 1:43 PM >>>
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