Image projection question

Stephen Davies sdc at SDC.COM.AU
Fri Jun 15 22:33:42 EDT 2007


G'day Frank.

Thank you again for your feedback.

My problem with displaying the shapefile was one of colour. When I added 
a CLASS to the unit layer, it became visible.

I checked my spatial_ref_sys table and the 28354 definition is correct.

I tried expanding the map PROJECTON definition but this had no visible 
effect.

What did have an effect however, was to change the map projection to:
    PROJECTION
       "init=epsg:28354"
    END

This fixed the polygon location relative to the raster - but broke the 
reference map. It no longer shows the map location.

As I think I mentioned earlier, this was the reason that I originally 
chose eqc as the map projection. It was the only one I could find that 
produced matching map, reference map and scale map.

I am attaching the complete map file that was used in this latest test. 
If you could identify why the reference map has stopped working, I 
think my whole problem might be solved.

Cheers and thanks,
Stephen

On Saturday 16 June 2007 00:18, you wrote:
> Stephen Davies wrote:
>   > MAP
> >
> >   NAME benparts1
> >
> >
> >     PROJECTION
> > 	"proj=eqc"
> > 	"lon_0=139.591e"
> >     END
>
> Stephen,
>
> I suspect the above is your problem.  The above definition will
> default to using the WGS84 as the datum, but everything else is GRS80
> (the GDA94 ellipsoid).  Hmm, on review GRS80 is a very close match to
> WGS84 as an ellipsoid, so this isn't so likely. Nevertheless, it
> would make me feel better if you included an explicit ellipsoid.
>
> eg.
>
> PROJECTION
>    "+proj=eqc +lon_0=139.59 +ellps=GRS80 +towgs84=0,0,0 +no_defs"
> END
>
> You mentioned you weren't able to get the shapefile to show:
>
>      LAYER
> #      CONNECTIONTYPE postgis
>        NAME "unit"
>        DATA "/var/shapefiles/CondoCitrus"
>        CONNECTION "user=scldad dbname=benparts"
>        STATUS default
>        TYPE POLYGON
> #      FILTER "unit_id in (0)"
>        PROJECTION
>          "init=epsg:28354"
>        END
>        MAXSCALE 5000000
>      END
>
>
> I would suggest also commending out the CONNECTION.  I assume the
> shapefile is /var/shapefiles/CondoCitrus.shp?
>
> You might also consider replacing init=epsg:28354 with the following
> definition just to be sure the expected definitions are being used.
>
> PROJECTION
> "+proj=utm +zone=54 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0
> +units=m +no_defs" END
>
> You should also check the spatial_ref_sys table in postgis, to
> verify the same proj.4 string is being used there for SRID 28354.
>
> Best regards,

-- 
 =======================================================================
This email is for the person(s) identified above, and is confidential to
the sender and the person(s).  No one else is authorised to use or
disseminate this email or its contents.

Stephen Davies Consulting                            Voice: 08-8177 1595
Adelaide, South Australia.                             Fax: 08-8177 0133
Computing & Network solutions.                       Mobile:0403 0405 83
-------------- next part --------------
#
# Copyright Stephen Davies Consulting P/L 2005
#
# template map file for Agua Soil Database
#
MAP
  NAME benparts1
   

    PROJECTION
       "init=epsg:28354"
    END

    SIZE 600 600
    FONTSET "/var/www/html2/benparts/fonts.list"
    SYMBOLSET "/var/www/html2/benparts/symbols"
    UNITS METERS
    IMAGETYPE  jpeg
    OUTPUTFORMAT
	NAME jpeg
	DRIVER "GD/JPEG"
	MIMETYPE "image/jpeg"
	IMAGEMODE RGB
	EXTENSION "jpg"
	FORMATOPTION "QUALITY=80"
    END
    IMAGECOLOR 255 255 255

    WEB
	template /var/www/html2/benparts/templates/test1.html
	imagepath "/var/www/html2/tmp/"
	imageurl  "/tmp/"
    END

    LEGEND
	KEYSIZE 18 12
	LABEL
	  TYPE BITMAP
	  SIZE MEDIUM
	  COLOR 0 0 94
	END
	STATUS ON
    END

    LAYER
      TYPE RASTER
      NAME "bkgrnd"
      STATUS DEFAULT
      PROJECTION
       "init=epsg:28354"
      END
      DATA "/var/www/html2/benparts/rasters/SwanReach_Citrus_Mar07_2m.tif"
#      OFFSITE 0 0 0
      PROCESSING "DITHER=YES"
    END

    LAYER
      CONNECTIONTYPE postgis
      NAME "geog"
      DATA "geom from geog"
      CONNECTION "user=scldad dbname=benparts"
      STATUS DEFAULT
      TYPE POLYGON
      PROJECTION
        "init=epsg:4283"
      END
      CLASS
        STYLE
#          COLOR        233 233 233
          OUTLINECOLOR 11 11 11
        END
      END
    END

    LAYER
      CONNECTIONTYPE postgis
      NAME "unit"
      DATA "geom from unit"
      CONNECTION "user=scldad dbname=benparts"
      STATUS default
      TYPE POLYGON
#      FILTER "unit_id in (0)"
      PROJECTION
        "init=epsg:4283"
      END
      MAXSCALE 5000000
      LABELITEM "name"
      CLASSITEM "mstatus"
      CLASS
#        NAME       "Unknown"
	EXPRESSION "x"
        STYLE
          OUTLINECOLOR        127 127 127
        END
        LABEL
          MINDISTANCE 150
          POSITION CC
          SIZE MEDIUM
          COLOR 255 0 255
	  FORCE TRUE
        END
      END
      CLASS
        NAME       "Saturated"
	EXPRESSION "1"
        STYLE
          COLOR        0 168 255
        END
        LABEL
          MINDISTANCE 150
          POSITION CC
          SIZE MEDIUM
          COLOR 255 0 255
	  FORCE TRUE
        END
      END
      CLASS
        NAME       "..."
	EXPRESSION "2A"
        STYLE
          COLOR        0 255 0
        END
        LABEL
          MINDISTANCE 150
          POSITION CC
          SIZE MEDIUM
          COLOR 255 0 255
	  FORCE TRUE
        END
      END
      CLASS
        NAME       "..   "
	EXPRESSION "2B"
        STYLE
          COLOR        115 255 0
        END
        LABEL
          MINDISTANCE 150
          POSITION CC
          SIZE MEDIUM
          COLOR 255 0 255
	  FORCE TRUE
        END
      END
      CLASS
        NAME       "."
	EXPRESSION "2C"
        STYLE
          COLOR        168 255 168
        END
        LABEL
          MINDISTANCE 150
          POSITION CC
          SIZE MEDIUM
          COLOR 255 0 255
	  FORCE TRUE
        END
      END
      CLASS
        NAME       "Refill Point"
	EXPRESSION "2D"
        STYLE
          COLOR        214 255 168
        END
        LABEL
          MINDISTANCE 150
          POSITION CC
          SIZE MEDIUM
          COLOR 255 0 255
	  FORCE TRUE
        END
      END
      CLASS
        NAME       "."
	EXPRESSION "3A"
        STYLE
          COLOR        255 255 0
        END
        LABEL
          MINDISTANCE 150
          POSITION CC
          SIZE MEDIUM
          COLOR 255 0 255
	  FORCE TRUE
        END
      END
      CLASS
        NAME       "Onset of Water Stress"
	EXPRESSION "3B"
        STYLE
          COLOR        255 235 0
        END
        LABEL
          MINDISTANCE 150
          POSITION CC
          SIZE MEDIUM
          COLOR 255 0 255
	  FORCE TRUE
        END
      END
      CLASS
        NAME       ".."
	EXPRESSION "4A"
        STYLE
          COLOR        255 215 0
        END
        LABEL
          MINDISTANCE 150
          POSITION CC
          SIZE MEDIUM
          COLOR 255 0 255
	  FORCE TRUE
        END
      END
      CLASS
        NAME       "..."
	EXPRESSION "4B"
        STYLE
          COLOR        255 195 0
        END
        LABEL
          MINDISTANCE 150
          POSITION CC
          SIZE MEDIUM
          COLOR 255 0 255
	  FORCE TRUE
        END
      END
      CLASS
        NAME       "Severe Water Stress"
	EXPRESSION "5"
        STYLE
          COLOR        255 0 96
        END
        LABEL
          MINDISTANCE 150
          POSITION CC
          SIZE MEDIUM
          COLOR 255 0 255
	  FORCE TRUE
        END
      END
    END

    LAYER
      CONNECTIONTYPE postgis
      NAME "cadt"
      DATA "geom from cad"
      CONNECTION "user=scldad dbname=benparts"
      STATUS DEFAULT
      TYPE POINT
      PROJECTION
        "init=epsg:4283"
      END
      FILTER "gtype='T' and client_id=49"
      CLASSITEM "type"
      CLASS
	EXPRESSION "201"
	STYLE
	  COLOR 0 255 0
	END
	STYLE
	  SYMBOL "tree"
	  COLOR 0 255 0
	  SIZE 9
	END
      END

      CLASS
	EXPRESSION "754"
        LABEL
          MINDISTANCE 150
          POSITION CR
          SIZE TINY
          COLOR 0 0 0
	  FORCE TRUE
        END
	TEXT 'WM'
	STYLE
	  SYMBOL "dot"
	  COLOR 0 0 0
	  SIZE 5
	END
      END

      CLASS
	EXPRESSION "757"
        LABEL
          MINDISTANCE 150
          POSITION CR
          SIZE TINY
          COLOR 0 0 0
	  FORCE TRUE
        END
	TEXT 'Bore'
	STYLE
	  SYMBOL "dot"
	  COLOR 0 0 0
	  SIZE 5
	END
      END

      CLASS
	EXPRESSION "712"
	STYLE
	  SYMBOL "stobie"
	  SIZE 4
	  COLOR 255 0 168
	END
      END

      CLASS
	EXPRESSION /./
        STYLE
	  SYMBOL "dot"
	  COLOR 9 9 9 
	  SIZE 5
        END
      END
    END

    LAYER
      CONNECTIONTYPE postgis
      NAME "cadl"
      DATA "geom from cad"
      CONNECTION "user=scldad dbname=benparts"
      STATUS DEFAULT
      TYPE LINE
      PROJECTION
        "init=epsg:4283"
      END
      FILTER "gtype in ('L','P') and client_id=49"
      CLASSITEM "type"
      CLASS
	EXPRESSION "908"
	STYLE
	  SYMBOL "fence"
	  SIZE 10
	  COLOR 0 255 0
	END
	STYLE
	  SYMBOL "dot"
	  COLOR 0 255 0
	  SIZE 1
	END
      END

      CLASS
	EXPRESSION "712"
	STYLE
	  SYMBOL "power"
	  SIZE 8
	  COLOR 255 0 168
	END
	STYLE
	  SYMBOL "dot"
	  COLOR 255 0 168
	  SIZE 1
	END
      END

      CLASS
	EXPRESSION "602"
        STYLE
	  SYMBOL "dot"
	  COLOR 137 205 190
	  SIZE 1
        END
      END
      CLASS
	EXPRESSION /./
        STYLE
          COLOR        9 9 9 
        END
      END
    END

    LAYER
      CONNECTIONTYPE postgis
      NAME "probe"
      DATA "geom from probe"
      CONNECTION "user=scldad dbname=benparts"
      STATUS DEFAULT
      TYPE POINT
#      FILTER "probe_id in (0)"
      PROJECTION
        "init=epsg:4283"
      END
      MAXSCALE 5000000
      LABELITEM "location"
      CLASS
        NAME       "Probe (Right Click to select)"
        STYLE
          COLOR        0 214 0
          SYMBOL 'circle'
	  SIZE 7
        END
        LABEL
          MINDISTANCE 15
          POSITION CR
          SIZE SMALL
          COLOR  0 0 0
	  FORCE TRUE
        END
      END
    END

    LAYER
      CONNECTIONTYPE postgis
      NAME "bore"
      DATA "geom from bore"
      CONNECTION "user=scldad dbname=benparts"
      FILTER "id in (0)"
      STATUS DEFAULT
      TYPE POINT
      PROJECTION
        "init=epsg:4283"
      END
      LABELITEM "name"
      CLASS
        NAME       "Bore"
        STYLE
          COLOR        0 0 214
          SYMBOL 'circle'
	  SIZE 7
        END
        LABEL
          MINDISTANCE 150
          POSITION CR
          SIZE TINY
          COLOR 9 9 9
        END
      END
    END

    LAYER
      CONNECTIONTYPE postgis
      NAME "weather"
      DATA "geom from weather_station"
      CONNECTION "user=scldad dbname=benparts"
      STATUS DEFAULT
      TYPE POINT
      FILTER "id in (0)"
      PROJECTION
        "init=epsg:4283"
      END
      LABELITEM "name"
      CLASS
        NAME       "Weather Station"
        STYLE
          COLOR        214 0 0 
          SYMBOL 'circle'
	  SIZE 7
        END
        LABEL
          MINDISTANCE 150
          POSITION CR
          SIZE TINY
          COLOR 9 9 9 
        END
      END
    END

    LAYER
      CONNECTIONTYPE postgis
      NAME "onswitch"
      DATA "geom from onswitch using unique id using SRID=4283"
      CONNECTION "user=scldad dbname=benparts"
      STATUS DEFAULT
      TYPE POLYGON
      PROJECTION
        "init=epsg:4283"
      END
      MAXSCALE 5000000
      CLASS
        STYLE
          OUTLINECOLOR        0 0 255
          MINWIDTH 3
        END
      END
    END

    LAYER
      NAME 'copyright'
      TYPE ANNOTATION
      STATUS DEFAULT
      TRANSFORM FALSE # coordinates are in pixels
      FEATURE
        POINTS 10 595 END
      END
      CLASS
        LABEL
          TYPE TRUETYPE
          FONT arial
          SIZE 8
          COLOR 255 255 255
          POSITION CR
        END
        TEXT 'Photography supplied by MAPLAND, Environment Information, Dept Environment & Heritage'
      END
    END
#
    LAYER
      NAME 'movie'
      TYPE ANNOTATION
      STATUS DEFAULT
      TRANSFORM FALSE # coordinates are in pixels
      FEATURE
        POINTS 270 10 END
      END
      CLASS
        LABEL
          TYPE TRUETYPE
          FONT arial
          SIZE 10
          COLOR 251 196 6 
          POSITION CR
        END
        TEXT 'Status at 2007-06-13 07:00:00 .'
      END
    END
  #
  # Start of reference map
  #
  REFERENCE
    IMAGE /var/www/html2/benparts/refmaps/sa.png
    EXTENT -1191229.87 -4230140.65 167981.11 -2872042.86
    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


More information about the mapserver-users mailing list