projection questions

Pericles S. Nacionales nacional at CBS.UMN.EDU
Mon Jan 24 16:13:58 EST 2005


On Monday 24 January 2005 02:12 pm, Jeff Portwine wrote:
>
> I put up a quick and dirty web page:   http://www.aiedail.net/maps  so that
> you can see exactly what I'm talking about (I didn't want to attach images
> to an email for the entire list).    I hope that these images will
> demonstrate what i've been trying to write in text.
>
> I'm not actually using mappoint data to create the map, so I have no idea
> how they project the data when they generate maps...  but I can't really
> seem to make my output look any different regardless of what I use for
> output projection.
>
> If there is no way to make it look the same that's probably OK, i'm just
> trying to understand what's happening.
>
> Thanks for the time, hope  the picture posting helps.
>

Jeff,

MapServer is capable of reprojecting your data on the fly.  From your example
it looks like your data is unprojected (in latlong) while the MapPoint map is
in some other projection.  You'll need to know what this projection is if you
want an exact match.  If all you want is to make your map look reasonably
like the MapPoint map, then I suggest using one of the USGS
projections-albers, lcc, lambert azimuthal equal area (the required
parameters can be found on pretty much any commercial GIS software, or can be
googled on the web).

Now, you'll probably ask how to reproject in MapServer.  Here's a quick
instructions:
1. In your mapfile, define a PROJECTION object at the top level:
  MAP
  ...
    PROJECTION
      "proj_parameter" "value"
      #or, alternatively,
      "init=epsg:<epsg projection code>"
    END
  ...
  END

This is your output projection so you want to define it as one of the
projections I mentioned above.  If you are using the EPSG codes, your init
string will look like this: "init=epsg:2163".  Search the archive for more
info on Proj and projections.

2. Define your MAP EXTENT using your output projection units:
    Example: EXTENT 201621.496941 -294488.285333 1425518.020722 498254.511514

    Your extent shouldn't be decimal degrees but rather in meters (or whatever
unit youur projection uses).  You can use the Proj utility "cs2cs" to convert
your extent from latlong to your output projection.

3. Define your UNITS as METERS (or feet, this depends on your output
projection)

4. For each LAYER you define, add a PROJECTION object:
  MAP
  ...
    PROJECTION
      "proj_parameter" "value"
      #or, alternatively,
      "init=epsg:<epsg projection code>"
    END
  ...
    LAYER #layer 1
      ...
      PROJECTION
        "init=epsg:4326" # this is latlong in WGS84 datum and spheroid
      END
    END
    LAYER #layer 2
      ...
      PROJECTION
        "init=epsg:4326" # this is latlong in WGS84 datum and spheroid
      END
  ...
  END

The projection definition within the layer object is your input projection.

I hope that helps.  If you need to learn more about projections, search the
web.

Good luck!
-Perry N.



More information about the mapserver-users mailing list