Things are comming along but .... please look at this mapfile dump

David Fawcett David.Fawcett at STATE.MN.US
Mon Nov 29 15:18:30 EST 2004


Joseph,

Your first objective is to find out more about your California Zips
shapefile.  Is it projected, if so, what is the projection?  Where did
you get it from, is there any metadata or documentation there?

Where did you get the values for EXTENT in your map file?  If you got
these values from your Zips shapefile, I would guess that your data is
in UTM, you would then have to determine what UTM zone it is.  If you
run shpdump, shpinfo, or gdalinfo on the shapefile, you can get it's
extent.

Take a look at the mapfile documentation regarding projections.
http://mapserver.gis.umn.edu/doc42/mapfile-reference.html#projection
To use projections in MapServer, you define a PROJECTION block in the
MAP object to set the projection for the map to be created.  You then
create PROJECTION blocks in each layer, defining the projection that the
layer data exists in.

In your map file, you have set the projections in both your MAP object
and your 'calzip' layer to be 'latlong'.  You need to set the projection
for the 'calzip' layer to the definition for whatever projection it is
in.

David J. Fawcett
MN Office of Environmental Assistance

>>>How do I find out what my extent should be for lat/long?

-figure out what projection you want your final map to be in.  It can
be in the same projection as any of your layers, or something completely
different.  There are trade-offs for every projection (or lack of one).
Once you figure out what output projection you want, set the EXTENT,
UNITS, and PROJECTION object in the MAP file to match that projection.


If your 'calzip' polygon really is in UTM (my assumption)  and you like
the way that it looks, you may choose to use UTM as the output
projection and project your lat/long teacher points to UTM.

David.

>>> Joseph Norris <sirronj at PACBELL.NET> 11/29/2004 1:48:04 PM >>>
Thanks for responding David,

I follow you on most of this except for the following:

If all of your data is truly unprojected (lat/long), then all you
should need to do is change your extent to the appropriate boundaries
for your data in lat/long.


How do I find out what my extent should be for lat/long?

Here is my modified file - taking into account - I think - what you
have
specified.

MAP
  EXTENT 5706290.827754 -192053.2 9127890.404246 3226086.749
  TEMPLATEPATTERN "map"
  IMAGECOLOR 255 255 255
  IMAGETYPE gif
  SHAPEPATH
"/usr/local/apache/htdocs/mco.communityservers.com/htdocs/maps/teacher/tdata
"
  SIZE 600 600
  STATUS ON
  UNITS DD
  NAME "calmap"

  PROJECTION
          "proj=latlong"
  END

  OUTPUTFORMAT
    NAME gif
    MIMETYPE image/gif
    DRIVER GD/GIF
    EXTENSION gif
    IMAGEMODE PC256
    TRANSPARENT FALSE
  END

  SYMBOL
    NAME "circle"
    TYPE ELLIPSE
    FILLED TRUE
    POINTS
      1 1
    END
  END

  LEGEND
      IMAGECOLOR 255 255 255
    KEYSIZE 20 10
    KEYSPACING 5 5
    LABEL
      SIZE MEDIUM
      TYPE BITMAP
      BUFFER 0
      COLOR 0 0 0
      FORCE FALSE
      MINDISTANCE -1
      MINFEATURESIZE -1
      OFFSET 0 0
      PARTIALS TRUE
      POSITION CC
    END
    POSITION LL
    STATUS EMBED
  END

  QUERYMAP
      COLOR 255 255 0
    SIZE -1 -1
    STATUS OFF
    STYLE HILITE
  END

  SCALEBAR
      COLOR 0 0 0
    IMAGECOLOR 255 255 255
    INTERVALS 4
    LABEL
      SIZE MEDIUM
      TYPE BITMAP
      BUFFER 0
      COLOR 0 0 0
      FORCE FALSE
      MINDISTANCE -1
      MINFEATURESIZE -1
      OFFSET 0 0
      PARTIALS TRUE
    END
    POSITION LL
    SIZE 200 3
    STATUS OFF
    STYLE 0
    UNITS MILES
  END

  WEB
    IMAGEPATH ""
    IMAGEURL ""
    QUERYFORMAT text/html
  END

  LAYER
    CLASSITEM "zcta"
    DATA "cal_zp_st"
    NAME "calzip"
    SIZEUNITS PIXELS
    STATUS DEFAULT
    TOLERANCE 0
    TOLERANCEUNITS PIXELS
    TYPE POLYGON
    UNITS DD
        PROJECTION
          "proj=latlong"
        END
    CLASS
      NAME "Zip Boundries"
      EXPRESSION /./
      STYLE
        MAXSIZE 100
        MINSIZE 1
          OUTLINECOLOR 204 204 204
        SIZE 1
        SYMBOL 0
      END

    END
   END

  LAYER
    NAME "points"
    SIZEUNITS PIXELS
    STATUS DEFAULT
    TOLERANCE 0
    TOLERANCEUNITS PIXELS
    TYPE POINT
    UNITS DD
        PROJECTION
          "proj=latlong"
        END
    CLASS
      NAME "teacher"
      LABEL
        SIZE MEDIUM
        TYPE BITMAP
        BUFFER 2
        COLOR 255 102 102
        FORCE FALSE
        MINDISTANCE -1
        MINFEATURESIZE -1
        OFFSET 0 0
        PARTIALS FALSE
        POSITION AUTO
      END
      STYLE
          COLOR 255 102 102
        MAXSIZE 100
        MINSIZE 1
          OUTLINECOLOR 255 255 255
        SIZE 8
        SYMBOL "circle"
      END
    END
    FEATURE
      POINTS
        -121.507 38.5263
      END
      TEXT "Mary Lyn Kagan"
    END
    FEATURE
      POINTS
        -122.451 37.7752
      END
      TEXT "Greg D'Amico"
    END
    FEATURE
      POINTS
        -119.646 36.3426
      END
      TEXT "Leslie Steffen"
    END
    FEATURE
      POINTS
        -122.54 38.0065
      END
      TEXT "john antico"
    END
    FEATURE
      POINTS
        -116.976 32.7712
      END
      TEXT "SWANSONG BRAHMAN"
    END
  END
END

#Joseph Norris (Perl - what else is there?/Linux/CGI/Mysql) print
@c=map chr
$_+100,(6,17,15,16,-68,-3,10,11,16,4,1,14,-68,12,1,14,8,-68,4,-3,-1,7,1,14,-
68,-26,11,15,1,12,4,-68,-22,11,14,14,5,15,-90);

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at lists.umn.edu]On

Behalf Of David Fawcett
Sent: Monday, November 29, 2004 11:26 AM
To: MAPSERVER-USERS at lists.umn.edu
Subject: Re: [UMN_MAPSERVER-USERS] Things are comming along but ....
please
look at this mapfile dump

Joseph,

A few things that I noticed that are probably related to your problem:

It looks like your EXTENT is in meters suggesting a UTM projection.
Your UNITS specify DD, suggesting that your data is in Lat Long.

It also looks like you are creating your new points using Lat Long.

If all of your data is truly unprojected (lat/long), then all you
should need to do is change your extent to the appropriate boundaries
for your data in lat/long.

My guess is that you got your EXTENT from your Zip Code shapefile,
which suggests that it is projected to something like UTM.  If this is
the case, you will have to add a PROJECTION block for the map and
PROJECTION information for each layer in your map file.

David.

David J. Fawcett
MN Office of Environmental Assistance

>>> Joseph Norris <sirronj at PACBELL.NET> 11/29/2004 1:12:40 PM >>>
Hello again,

I am now on the quest to add points to my map of zips in California.
I
have
the following map file but the points are not showing up in the layer.
If
you can see anything that I need to change - please let me know.  I
have
found that it is easier to work from a dump of the mapfile - make
adjustments then return to my perl script and make sure that these
adjustments happen.

Thanks to all.


MAP
  EXTENT 5706290.827754 -192053.2 9127890.404246 3226086.749
  TEMPLATEPATTERN "map"
  IMAGECOLOR 255 255 255
  IMAGETYPE gif
  SHAPEPATH
"/usr/local/apache/htdocs/mco.communityservers.com/htdocs/maps/teacher/tdata
"
  SIZE 600 600
  STATUS ON
  UNITS DD
  NAME "calmap"

  OUTPUTFORMAT
    NAME gif
    MIMETYPE image/gif
    DRIVER GD/GIF
    EXTENSION gif
    IMAGEMODE PC256
    TRANSPARENT FALSE
  END

  SYMBOL
    NAME "circle"
    TYPE ELLIPSE
    FILLED TRUE
    POINTS
      1 1
    END
  END

  SYMBOL
    NAME "plus"
    TYPE VECTOR
    POINTS
      0.5 0
      0.5 1
      -99 -99
      0 0.5
      1 0.5
    END
  END

  LEGEND
      IMAGECOLOR 255 255 255
    KEYSIZE 20 10
    KEYSPACING 5 5
    LABEL
      SIZE MEDIUM
      TYPE BITMAP
      BUFFER 0
      COLOR 0 0 0
      FORCE FALSE
      MINDISTANCE -1
      MINFEATURESIZE -1
      OFFSET 0 0
      PARTIALS TRUE
      POSITION CC
    END
    POSITION LL
    STATUS EMBED
  END

  QUERYMAP
      COLOR 255 255 0
    SIZE -1 -1
    STATUS OFF
    STYLE HILITE
  END

  SCALEBAR
      COLOR 0 0 0
    IMAGECOLOR 255 255 255
    INTERVALS 4
    LABEL
      SIZE MEDIUM
      TYPE BITMAP
      BUFFER 0
      COLOR 0 0 0
      FORCE FALSE
      MINDISTANCE -1
      MINFEATURESIZE -1
      OFFSET 0 0
      PARTIALS TRUE
    END
    POSITION LL
    SIZE 200 3
    STATUS OFF
    STYLE 0
    UNITS MILES
  END

  WEB
    IMAGEPATH ""
    IMAGEURL ""
    QUERYFORMAT text/html
  END

  LAYER
    NAME "points"
    SIZEUNITS PIXELS
    STATUS ON
    TEMPLATE "bogus.html"
    TOLERANCE 10
    TOLERANCEUNITS PIXELS
    TYPE POINT
    UNITS METERS
    CLASS
      NAME "buoy"
      LABEL
        SIZE MEDIUM
        TYPE BITMAP
        BUFFER 2
        COLOR 255 102 102
        FORCE FALSE
        MINDISTANCE -1
        MINFEATURESIZE -1
        OFFSET 0 0
        PARTIALS FALSE
        POSITION AUTO
      END
      STYLE
          COLOR 255 102 102
        MAXSIZE 100
        MINSIZE 1
          OUTLINECOLOR 255 255 255
        SIZE 8
        SYMBOL "circle"
      END
    END
    FEATURE
      POINTS
        -121.507 38.5263
      END
      TEXT "Mary Lyn Kagan"
    END
    FEATURE
      POINTS
        -122.451 37.7752
      END
      TEXT "Greg D'Amico"
    END
    FEATURE
      POINTS
        -119.646 36.3426
      END
      TEXT "Leslie Steffen"
    END
    FEATURE
      POINTS
        -122.54 38.0065
      END
      TEXT "john antico"
    END
    FEATURE
      POINTS
        -116.976 32.7712
      END
      TEXT "SWANSONG BRAHMAN"
    END
  END


  LAYER
    CLASSITEM "zcta"
    DATA "cal_zp_st"
    NAME "calzip"
    SIZEUNITS PIXELS
    STATUS DEFAULT
    TOLERANCE 0
    TOLERANCEUNITS PIXELS
    TYPE POLYGON
    UNITS METERS
    CLASS
      NAME "Zip Boundries"
      EXPRESSION /./
      STYLE
        MAXSIZE 100
        MINSIZE 1
          OUTLINECOLOR 204 204 204
        SIZE 1
        SYMBOL 0
      END

    END
  END


END


#Joseph Norris (Perl - what else is there?/Linux/CGI/Mysql) print
@c=map chr
$_+100,(6,17,15,16,-68,-3,10,11,16,4,1,14,-68,12,1,14,8,-68,4,-3,-1,7,1,14,-
68,-26,11,15,1,12,4,-68,-22,11,14,14,5,15,-90);



More information about the mapserver-users mailing list