projection woes

Mark Adams markadams at CUESTASYS.COM
Tue Jan 25 12:10:45 EST 2005


I've included my map file below.

Regarding Stephen Woodbridge's response, the data in all files is in zone 17, the only difference is the datum; and I can confirm that the data really is there. As I indicated, if I don't include the projection block on the layer the data shows, just shifted because of the different datum. (Also working with it in ArcMap etc.)

If it's likely that that I either don't have the right files, or for some reason they aren't being found, how can I test this, and how do I know which files I need? Incidentally, I installed proj.4 from the proj446_win32_bin.zip distribution; and I'm running on Win2000, IIS 5.


-----map file------

#
# Start of map file
#
MAP
  NAME "MVCA_GeoPortal"
  STATUS ON
  EXTENT 433350 4813769 546722 4889572
  SIZE 682 456
  #SIZE 674 474   
  SHAPEPATH "..\Data\Shapefiles"
  #TEMPLATEPATTERN "MVCA_GeoPortal"
  SYMBOLSET "GeoPortal.symbols"
  #fonset added AD 13-Jul-04
  FONTSET "GeoPortal.fonts"
  #IMAGETYPE PNG
  #IMAGETYPE swf
  #IMAGETYPE png24bit
  IMAGETYPE gif
  #IMAGECOLOR 255 255 255
  UNITS METERS
  OUTPUTFORMAT
    NAME gif
    DRIVER "GD/GIF"
    MIMETYPE "image/gif"
    IMAGEMODE PC256
    EXTENSION "gif"
    TRANSPARENT ON
  END
  OUTPUTFORMAT
    NAME png24bit
    DRIVER "GD/PNG"
    MIMETYPE "image/png"
    IMAGEMODE rgb
    FORMATOPTION "INTERLACE=OFF"
  END
  OUTPUTFORMAT
    NAME swf
    DRIVER "SWF"
    MIMETYPE "application/x-shockwave-flash"
    EXTENSION "swf"
    IMAGEMODE PC256
    FORMATOPTION "OUTPUT_MOVIE=SINGLE"
  END
  #
  # Start of web interface definition (including WMS enabling metadata)
  #
  WEB
    #MINSCALE 500
    MAXSCALE 1550000
    IMAGEPATH "C:\Inetpub\wwwroot\tmp\"
    IMAGEURL "/tmp/"
    HEADER "templates/header.html"
    FOOTER "templates/footer.html"
    TEMPLATE "set in index.html"
    METADATA
      "WMS_TITLE"    "MVCA MapServer GeoPortal"
      "WMS_ABSTRACT"    "This is MapServer application using data from Maitland Valley Conservation Authority."
      "WMS_ACCESSCONSTRAINTS"    "none"
      "WMS_ONLINERESOURCE"    "http://navigator/cgi-bin/mapserv.exe?map=C:\Inetpub\wwwroot\mapserver_demos\MVCA_GeoPortal\config\MVCA_GeoPortal.map&"
      "WMS_SRS"    "EPSG:26717"
    END
  END
  #
  # Start of reference map
  #
  REFERENCE
    IMAGE "reference.png"    
    EXTENT 433350 4813769 534792 4889572 
    SIZE 168 118 
    #SIZE 84 59
    STATUS ON    
    
    #COLOR 175 175 208
    COLOR -1 -1 -1
    OUTLINECOLOR 175 175 208
    MINBOXSIZE 5
    MAXBOXSIZE 500
    MARKER "star"
    MARKERSIZE 8
  END
  
  #
  # Projection definition, consult the PROJ.4 documentation for parameter discussion
  #
  PROJECTION
    #   proj=utm
    #   ellps=GRS80
    #   zone=15
    #   north
    #   no_defs
    #
    #   OR: 
    #
    #   init=epsg:26915
    "init=EPSG:26717" 
  END
  #
  # Start of legend
  #
  LEGEND
    STATUS ON
    KEYSIZE 18 12 
    LABEL
      TYPE BITMAP
      SIZE MEDIUM
      COLOR 0 0 89
    END
    TEMPLATE "legend.html"
  END
  #
  # Start of scalebar
  #
  SCALEBAR
    STATUS ON
    POSITION LR
    POSTLABELCACHE TRUE
    #BACKGROUNDCOLOR 166 202 240
    BACKGROUNDCOLOR 254 219 67
    COLOR 0 0 156
    OUTLINECOLOR 166 202 240
    TRANSPARENT ON
    #IMAGECOLOR 0 0 0
    UNITS KILOMETERS
    INTERVALS 4
    SIZE 200 8 
    STYLE 0
    LABEL
      SIZE SMALL
      COLOR 0 0 156
      ANTIALIAS TRUE
      OUTLINECOLOR 254 219 67
      #SHADOWCOLOR 166 202 240
      #SHADOWSIZE 3 3
    END
  END
  
  #
  # Start of layer definitions
  #
  

   #1
   LAYER
     NAME "Municipal_Boundaries"
     #GROUP "MUNICIPALBOUNDARY"
     STATUS ON
     DATA "municip_new2001"
     TYPE POLYGON
     TRANSPARENCY 50
     TEMPLATE "null"
     LABELITEM "township"
     LABELMINSCALE  300000
 #    LABELANGLEITEM
     METADATA
       "WMS_TITLE"    "Municipal Boundaries MVCA"
       "WMS_ABSTRACT"    "Depicts Municipal Boundaries in MVCA watershed as of 2001."
       "WMS_SRS"    "EPSG:26717"
     END
     CLASS
       NAME "Municipal_Boundaries"
       LABEL
         TYPE truetype
          FONT "Arial_bold"
         SIZE 8   
         POSITION CC
         COLOR 128 128 64
          #ANGLE AUTO
         ANTIALIAS TRUE        
       END
       STYLE
         #COLOR 247 235 208
          SYMBOL 'circle'
         OUTLINECOLOR 128 128 64
          SIZE 4
        END
       STYLE
         COLOR 247 235 208
         OUTLINECOLOR 128 128 64
       END
     END
   END
 
   #9
   LAYER
     NAME "Urban Areas"
     STATUS ON
     DATA "mv_builtup_areas"
     #DATA "\\Navigator\C\Inetpub\wwwroot\mapserver_demos\MS_GeoPortal\Data\Shapefiles\mv_builtup_areas"
     #FILTER ('[name]' =~ /(a|A)(t|T)(W|w)(o|O)(o|O)(d|D)/)
     #FILTER ('[name]' = 'Atwood')
     TYPE POLYGON
     #TRANSPARENCY 50
     TOLERANCE 25
     TEMPLATE "null"
     METADATA
       "WMS_TITLE"    "Urban Areas in MVCA Watershed"
       "WMS_ABSTRACT"    "Depicts Urban Areas in the MVCA watershed."
       "WMS_SRS"    "EPSG:26717"
     END    
     CLASS
       NAME "Urban Areas" 
       STYLE
         #COLOR 255 211 127
         OUTLINECOLOR 127 127 127
         SYMBOL 'circle'
         SIZE 2
       END 
       STYLE
         COLOR 255 211 127
         OUTLINECOLOR 127 127 127
       END     
     END
   END
 
 
   #3
   LAYER
     NAME "Lot Boundaries"
     STATUS OFF
     DATA "wlotarea_sort"
     TYPE POLYGON 
     TEMPLATE "null"
     #TRANSPARENCY 30
     METADATA
       "WMS_TITLE"    "Whole Lot Boundaries MVCA"
       "WMS_ABSTRACT"    "Depicts Whole Lot Boundaries in MVCA watershed."
       "WMS_SRS"    "EPSG:26717"
     END
     CLASS
       NAME "Lot Boundaries" 
       #MAXSCALE 100000
       STYLE
         #COLOR 247 235 208
         OUTLINECOLOR 104 104 104
         #SIZE 3
       END
     END
   END
 
   #5
   LAYER
     NAME "MVCA Watershed"
     STATUS ON
     DATA "mv_wthsd"
     TYPE POLYGON
     #TOLERANCE 25
     TEMPLATE "null"
     METADATA
       "WMS_TITLE"    "MVCA Watershed Boundary"
       "WMS_ABSTRACT"    "Depicts limits of the MVCA watershed."
       "WMS_SRS"    "EPSG:26717"
     END
     CLASS
       NAME "MVCA Watershed"
       STYLE
         # COLOR 247 235 208
         SIZE 2
         OUTLINECOLOR 230 152 0
       END
     END
   END
 
   LAYER
     NAME "SVCA Watershed"
     STATUS ON
     DATA "svca_bnd"
     TYPE POLYGON
     #TOLERANCE 25 
    PROJECTION
 #    "proj=utm"
 #    "ellps=GRS80"
 #    "zone=17"
 #    "north"
 #    "no_defs"
   "init=EPSG:26917" 
     END
     TEMPLATE "null"
     METADATA
       "WMS_TITLE"    "SVCA Watershed Boundary"
       "WMS_ABSTRACT"    "Depicts limits of the SVCA watershed."
       "WMS_SRS"    "EPSG:26917"
     END
     CLASS
       NAME "SVCA Watershed"
       STYLE
         # COLOR 247 235 208
         SIZE 2
         OUTLINECOLOR 230 152 0
       END
     END
  END
 
   #6
   LAYER
     NAME "MVCA Subwatersheds"
     STATUS OFF
     DATA "mv_sub_basins"
     TYPE POLYGON
     #TOLERANCE 25
     TEMPLATE "null"
     METADATA
       "WMS_TITLE"    "MVCA Watershed Boundary"
       "WMS_ABSTRACT"    "Depicts limits of the MVCA subwatersheds."
       "WMS_SRS"    "EPSG:26717"
     END
     CLASS
       NAME "MVCA Subwatersheds"
       STYLE
         # COLOR 247 235 208
         OUTLINECOLOR 230 152 0
       END
     END
   END
 
   #16
   LAYER
     NAME "Roads"
     STATUS ON
     DATA "wroad"
     TYPE LINE
     TOLERANCE 25
     TEMPLATE "null" 
     MAXSCALE 300000
     METADATA
       "WMS_TITLE"    "MVCA Roads"
       "WMS_ABSTRACT"    "MVCA Roads data."
       "WMS_SRS"    "EPSG:26917"
     END
    # LABELITEM length
    # LABELMAXSCALE 10000
     CLASS
       NAME "Roads"
       STYLE
         SYMBOL "circle"
         COLOR 0 0 0
         SIZE 2
       END
    #   LABEL
    #           TYPE truetype
    #           SIZE 8
    #           FONT "arial"
        # SIZE SMALL
    #     ANGLE AUTO
    #     POSITION UL
    #     COLOR 80 180 165
        # ANTIALIAS TRUE 
    #   END
     END  
   END
   
   #22
   #The query highlighting
   QUERYMAP
     STATUS ON
     STYLE HILITE
     COLOR 255 0 128
   END
 
   
  END

------------------------------
Mark Adams
Business & Systems Analyst
Cuesta Systems Inc.
5230 South Service Road
Burlington, ON L7L 5K2
Phone: 905-333-4544 x14
Fax: 905-333-0455
Email: markadams at cuestasys.com
 

-----Original Message-----
From: Frank Warmerdam [mailto:fwarmerdam at gmail.com] 
Sent: Tuesday, January 25, 2005 11:18 AM
To: Mark Adams
Cc: MAPSERVER-USERS at lists.umn.edu
Subject: Re: [UMN_MAPSERVER-USERS] projection woes

On Tue, 25 Jan 2005 10:02:36 -0600, Mark Adams <markadams at cuestasys.com> wrote:
> Hoping someone can help me out with problems I'm having combining data from
> different projections. I have a set of layers in NAD 27 zone 17, which I'm
> displaying with a PROJECTION object set at the MAP level
> with "init=EPSG:26717". I'm trying to add a layer that is in NAD 83 zone
> 17. If I simply add this layer without specifying a PROJECTION, it displays
> fine, albeit out of sync with the underlying data due to the datum shift.
> If I add a PROJECTION object to the LAYER set with "init=EPSG:26917", the
> layer disappears – no error in the log file, just no data. The same thing
> happens if I add a similar PROJECTION object to any other layer – the data
> disappears.
> 
> I've gone through the proj installation instructions, I can't see anything
> wrong.

Mark,

For this to work you need datum shifting working.  The key to datum shifting
is that at runtime PROJ.4 (used by MapServer) needs to find the NAD27
grid shift files.   

Default installs of PROJ.4 don't even include the grid shift files.  When they
are present the main one is named "conus" (for Continental US).  On unix
it would be found in /usr/local/share/proj by default.    

If you have the file, it might still not be found.  If this is the
problem then you
need to define the PROJ_LIB environment variable to point to the directory
where the file is located.  You likely don't need to do this if your EPSG 
lookups are working as the EPSG lookup file is in the same place as the
grid shift files.  

If you have all that in place, and things are still not working then it might
be related incomplete coordinate system definitions in one of your
PROJECTION blocks.  Is both your UTM 17 NAD27 layer and your map
as a whole defined with init=EPSG:26717?  If you emailed me your .map
file I could make a quick inspection that you have complete definitions
everywhere. 

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the mapserver-users mailing list