Skip to content
jmckenna edited this page May 2, 2012 · 3 revisions

And here's the new GRID keyword documentation:

The layer definition

LAYER                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                       
  NAME "SAMPLE GRID"                                                                                                                                                                                                                                                                                                                   
  PROJECTION                                                                                                                                                                                                                                                                                                                           
          "proj=latlong"                                                                                                                                                                                                                                                                                                               
          "ellps=WGS84"                                                                                                                                                                                                                                                                                                                
          "datum=WGS84"                                                                                                                                                                                                                                                                                                                
  END                                                                                                                                                                                                                                                                                                                                  
  TYPE LINE                                                                                                                                                                                                                                                                                                                            
  STATUS DEFAULT                                                                                                                                                                                                                                                                                                                       
  CLASS                                                                                                                                                                                                                                                                                                                                
        COLOR 0 255 128                                                                                                                                                                                                                                                                                                                
          LABEL                                                                                                                                                                                                                                                                                                                        
                TYPE BITMAP                                                                                                                                                                                                                                                                                                            
                SIZE MEDIUM                                                                                                                                                                                                                                                                                                            
                COLOR 255 128 89                                                                                                                                                                                                                                                                                                       
          END                                                                                                                                                                                                                                                                                                                          
  END                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                       
  GRID                                                                                                                                                                                                                                                                                                                                 
  END                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                       
END                                                                                                                                                                                                                                                                                                                                    

Will generate a graticule with default arc spacing, arc color RGB 0 255 128 and labeled in decimal degrees with color RGB 255 128 89. Labels will appear at all four of the image edges.

Each arc in the resulting grid is composed of 256 line segments. To render grid arcs with a different number of segments, use the MINSUBDIVIDE and MAXSUBDIVIDE keywords. Setting MINSUBDIVIDE == MAXSUBDIVIDE will always yield exactly the number of segments specified.

To set the format of the grid labels, specify a printf style format string after the LABELFORMAT keyword. The default string is "%5.2f". To get DMS labeling, enter "DDMMSS" as the LABELFORMAT string used by the GRID, and for DM labeling, specify "DDMM".

The GRID feature

 GRID                                                                                                                                                                                                                                                                                                                                  
          MINSUBDIVIDE 64                                                                                                                                                                                                                                                                                                              
          MAXSUBDIVIDE 64                                                                                                                                                                                                                                                                                                              
          LABELFORMAT "DDMMSS"                                                                                                                                                                                                                                                                                                         
 END                                                                                                                                                                                                                                                                                                                                   

Yields a grid with 64 segments in every arc labeled with degrees, minutes and seconds.

Other keywords behave similarly:

MININTERVAL and MAXINTERVAL allow a range to be set for grid spacing. The interval is specified in the coordinate system of the grid. Since PROJECTION is supported, if your mapserver has PROJ4, the grid may be in any coordinate system supported by PROJ4, and will be projected into the coordinate system of the generated image.

MINARCS and MAXARCS are hints to the code that generates grid intervals regarding when to stop subdividing the range of an axis. The subdivider will try to honor the range specified, or the min/max id only one keyword is present.

Please let me know if there are bugs, questions or comments.

Regards,

John Novak Novacell Technologies www.novacell.com

Clone this wiki locally