[mapserver-users] map projection problem

Tony Baylis baylis.tony at gmail.com
Sun Jan 10 20:30:55 EST 2010


Hi All,

I'm a bit confused as to the way mapserver deals with projections.  My
understanding is that if I place a 'PROJECTION' tag as a high level object
in the mapfile, then that is the projection I should expect when I read
coordinates from a tool such as Chameleon's cursorpos widget.

If I then have layers using data of a different base projection I need to
place a 'PROJECTION' tag within the 'LAYER' object describing the projection
of the base layer.  This will ensure all layers even if they are different
projections will reproject correctly and layers will render in the correct
position relative to each other.

If the above is correct can someone explain why I my map is rendering in the
projection of the base layers rather than the projection I define in the
mapfile level 'PROJECTION' object.  See below for me example mapfile.

Tony

#
# Start of map file
#
MAP
  NAME sp_geography
  STATUS ON
  SIZE 800 500
  EXTENT 564300 9470937 599600 9493000
  UNITS METERS
  SHAPEPATH "/opt/FriedaRiver/"
  IMAGECOLOR 237 255 208
  SYMBOLSET "/opt/testwww/htdocs/includes/symbols.sym"
  FONTSET "/usr/share/fonts/truetype/font.list"
  DEBUG 2
  CONFIG "MS_ERRORFILE" "/opt/testwww/wms_error/ms_error.txt"

OUTPUTFORMAT
  NAME "AGGA"
  MIMETYPE "image/png"
  DRIVER "AGG/PNG"
  EXTENSION "png"
  IMAGEMODE RGBA
  TRANSPARENT ON
END

#
# Start of web interface definition
#
WEB
      IMAGEPATH "/opt/testwww/ms_tmp/"
      IMAGEURL "/ms_tmp/"
 END
#
# Assign Projection
#
PROJECTION
  "init=epsg:32754"
END

LAYER
    GROUP "Geography"
    CONNECTIONTYPE postgis
    CONNECTION "host=localhost port=5432 dbname=FriedaRiver
user=****password=********"
    NAME "Rivers"
    DATA  "wkb_geometry FROM png_riversamg66z54 using unique ogc_fid"
    PROJECTION
      "init=epsg:20254"
    END
    METADATA
      SOURCE "METADATA:  Supplied by Xstrata 2003"
    END
    TEMPLATE "/var/www/chameleon/widgets/Query/QueryResults.phtml"
    STATUS ON
    TYPE LINE
    LABELITEM "name"
    CLASS
      STYLE
        SYMBOL "minor towns"
        COLOR 50 100 255
        SIZE 1
      END
      LABEL
        ANGLE FOLLOW
        MINDISTANCE 200
        FONT ArialItalic
        TYPE TRUETYPE
        SIZE 8
        COLOR 50 100 255
        OUTLINECOLOR 255 255 255
        POSITION UC
      END
    END
END

LAYER
    GROUP "Tenement"
    CONNECTIONTYPE postgis
    CONNECTION "host=localhost port=5432 dbname=FriedaRiver user=****
password=*****"
    NAME "Tenement EL58"
    DATA  "wkb_geometry FROM el58_agd66z54 using unique ogc_fid"
    PROJECTION
      "init=epsg:20254"
    END
    METADATA
      SOURCE "METADATA:  Supplied by Xstrata 2003"
    END
    TEMPLATE "/var/www/chameleon/widgets/Query/QueryResults.phtml"
    STATUS ON
    TYPE LINE
    CLASS
      STYLE
         COLOR 0 0 0
         WIDTH 3
      END
    END
END

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


More information about the mapserver-users mailing list