Box on reference map

Stephen Davies sdc at SDC.COM.AU
Mon Nov 7 16:14:46 PST 2005


G'day.

I am building an application based on the javascript dbox tutorial.
My data is all stored in PostGIS as lat/longs (SRID 4283) and I am
projecting this to the main map. (I have tried several different projections
but have currently settled on eqc.)
My reference map image was created by taking a snapshot of the main map and
reducing it to 120x120.

I have amended mapserv.js to handle southern hemisphere data.

If I do not project the data (map projection=init=epsg:4283), everything
seems to work fine and in particular, the current box of interest displays
on the reference map.

However, when I do project the data (with map projection laea, merc or eqc
and changing units from DD to metres) the box of interest stops displaying
even though all other operations - including clicking on the reference map -
continue to work.

Here is my map file.
MAP
  NAME bp1
  EXTENT 112.0 -44.0 154.0 -9.0

  PROJECTION
#    "init=epsg:4283"
#       "proj=laea"
#       "proj=merc"
        "proj=eqc"
        "lon_0=138e"
  END

  SIZE 600 600
  UNITS METERS
#  UNITS DD
  imagetype png
  imagecolor 255 255 255

    web
        template /usr/local/apache2/htdocs/benparts/templates/test1.html
        imagepath "/usr/local/apache2/htdocs/tmp/"
        imageurl  "/tmp/"
    end

    LAYER
      CONNECTIONTYPE postgis
      NAME "layer1"
      DATA "the_geom from geog5"
      CONNECTION "user=scldad dbname=benparts"
      STATUS default
      TYPE POLYGON
      PROJECTION
        "init=epsg:4283"
      END
      CLASS
        NAME       "Oz"
        STYLE
          COLOR        168 255 214
          OUTLINECOLOR 0 0 0
        END
      END
    END
  #
  # Start of reference map
  #
  REFERENCE
    IMAGE /usr/local/apache2/htdocs/benparts/refmaps/oz.png
    EXTENT 112.0 -44.0 154.0 -9.0
    SIZE 120 120
    STATUS ON
    MINBOXSIZE 5
    MAXBOXSIZE 100
    COLOR 0 255 0
    OUTLINECOLOR 0 0 0
    MARKERSIZE 8
    MARKER 'star'
  END
  #
  # Start of scalebar
  #
  SCALEBAR
    IMAGECOLOR 0 0 0
    LABEL
      COLOR 255 255 255
      SIZE TINY
    END
    STYLE 1
    SIZE 200 2
    COLOR 255 255 255
    UNITS KILOMETERS
    INTERVALS 2
    TRANSPARENT TRUE
    STATUS ON
  END
END

What have I missed?

Cheers and thanks,
Stephen



More information about the MapServer-users mailing list