Tiger Line Data

Hermawan Sutantio hermawan_s at HOTMAIL.COM
Mon Feb 28 20:46:57 PST 2005


Thanks,for your help.
It helps in an instant.
I'm trying to display feature labels of the roads.

LAYER
  NAME "Michigan Labels"
  TYPE ANNOTATION
  STATUS DEFAULT
  TILEINDEX "C:\ms4w\apps\gmap\htdocs\michigan\mich-tile"
  LABELMAXSCALE 100000
  CLASS
      Name "Michigan Labels"
      LABEL
          TYPE TRUETYPE
          FONT "arial"
          SIZE 10
          ANGLE AUTO
            POSITION uc
      END
   END # Class
END

Does this layer...end code make any sense?
Thanks again.


Herman

Hermawan,

See comments below

Hermawan Sutantio wrote:
>Hi all.
>I might need some more help.
>Based on the recommendation that Stephen gave, I tried to compile 2
>counties
>in michigan using the commands recommended. Below is the michigan.map file
>that i generated. Please help me review them whether anything is wrong.
>Thanks.
>
You need to start your mapfile with:

MAP

>FONTSET "C:\MS4W\apps\maplab-2.2\tutorial\etc\fonts.list"
>#
># Start of map file
>#
>NAME Michigan
>STATUS ON
>SIZE 500 500
>UNITS DD
>EXTENT -84.133748 42.072069 -83.539394 42.4345936
>SHAPEPATH "C:\cygwin\hcslmap\data\tiger"
>IMAGECOLOR 255 255 255
>
>
>#
># Start of web interface definition
>#
>WEB
>#
># On Windows systems, /tmp and /tmp/ms_tmp/ should be created at the root
># of the drive where the .MAP file resides.
>#
>  IMAGEPATH "C/ms4w/tmp/ms_tmp/"

Are you missing a ":" as in "C:"

>  IMAGEURL "/ms_tmp/"
>#  LOG "/tmp/gmap.log"
>
>  TEMPLATE demo.html
>  METADATA
>    "TITLE"   "Michigan Test Demo"
>  END
>END
>
>
>#
># Start of legend
>#
>LEGEND
>  KEYSIZE 18 12
>  LABEL
>    TYPE BITMAP
>    SIZE MEDIUM
>    COLOR 0 0 89
>  END
>  STATUS OFF
>END
>
>#
># Start of scalebar
>#
>SCALEBAR
>  IMAGECOLOR 255 255 255
>  LABEL
>    COLOR 0 0 0
>    SIZE SMALL
>  END
>  SIZE 150 4
>  COLOR 255 255 255
>  BACKGROUNDCOLOR 0 0 0
>  OUTLINECOLOR 0 0 0
>  UNITS miles
>  INTERVALS 3
>  STATUS ON
>END
>
>#
># Querymap settings
>#
># Style is one of NORMAL, HILITE, or SELECTED
>#
>
>QUERYMAP
>  STYLE HILITE
>  COLOR 255 0 0
>END
>
>#
># Start of layer definitions
>#
>
>LAYER
>  NAME Street_Map
>  TYPE LINE
>  STATUS ON

STATUS ON says that you can display the layer, but not that it WILL be
desplayed. Until you understand this, I would use
    STATUS DEFAULT

>  TILEINDEX "C:\cygwin\hcslmap\data\tiger\mich-tile.shp"
>  CLASS
>    NAME "Street_Map"

You probably need to specify the color and style of the line. Try
      COLOR 0 0 0 # black
      SIZE 1      # one pixel width

>  END
>END # Layer
>
>END #map
>
>
>
>Herman Teo wrote:
>
>>Hi Stephen,
>>
>>Thanks for the tip. I'm now scouring through the previous list
>>messages for 'tile' commands. There is not much of that going on. Is
>>there a sample code where I might be able to learn how I should
>>proceed with shape tiling and a sniff of a LAYER...END code in the
>>map file. Also, is any of these tiger line on sale somewhere so that
>>I might not have to download 300k files as you said. Thanks a lot.
>
>
>Herman,
>
>There are two different tiling commands:
>
>1) tile4ms which is distributed as part of the mapserver source and is
>documented on the mapserver utilities page of the website. It is used to
>tiling shapefiles. The easiest way to use it is to putt all the data you
>want to tile in a directory tree located in your SHAPEPATH directory.
>Then on Linux do something like:
>
>find data_dir -name "*.shp" > data_dir.in
>tile4ms data_dir.in data-tile
>shptree data-tile
>cat data_dir.in | xargs -n 1 shptree
>
>Then in your mapfile do something like:
>
>LAYER
>   NAME "my tile data"
>   TYPE whatever
>   TILEINDEX data-tile
>   ...
>   CLASS
>     ...
>   END
>END
>
>One of the caveats of this is that all the shapefiles in the index MUST
>have the SAME attributes and order of attributes and they must be all
>the same type.
>
>2) For tiling images you should use gdaltindex which is distributed as
>part of the gdal libraries and tools. The concept is similar to the
>above and I documented it on the wiki at
>http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?RasterHOWTO
>in the Bathymetry and Topography HowTo link and others have added a lot
>more info there.
>



More information about the MapServer-users mailing list