Questions

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Wed Jan 5 16:49:55 EST 2005


Jeff Portwine wrote:
> I have finally got mapserver working to the point that I've been able to
> work with it a little bit, at least on a very basic level.    I have a lot
> of questions that I'm having trouble finding answers to.   Some of these
> answers may be on the website, but a lot of things are spread around and
> I'm
> not always sure where to find them so just a pointer in the right direction
> to find the answers I seek may be enough...
>
> Anyway, just a few questions for now.
>
> First of all, does it matter what projection I use for my maps, as long
> as I
> am consistant?

The projection defines the math that essentially is happening when you
unroll a sphere onto a flat piece of paper (your image in this case).
There are lots of projections and they have lots on interesting
properties beside how they look on the screen.

Mapserver supports both input and output projection. The projection
block in the MAP section of you mapfile is the output projection and
your mapfile extents should be in this projection space as should your
UNITS. Within a LAYER block the project should be that of your data. If
the input and output projection are the same then it is basically a NOOP
otherwise the data is transformed on the fly. If you are looking for
high performance then you should try to get all your data files
reprojected to the output projection so you minimize the CPU cycles on
every map draw. It is not required, and simpler to let mapserver do the
re-projection on the fly if performance is not an issue.

> I've created a very basic michigan map using shapefile layers, but it
> appears to be "tilted" a bit.... is this because of my projection, or is
> there another reason for it?
> (http://solo.veritime.com/cgi-bin/mapserv40.exe?map=c:/program+files/apache+group/apache2/htdocs/map/map.map&mode=browse)

This is probably because of the projection.
>
> How do I determine the proper extents?   I would like to make my map of
> michigan fill the entire viewing area, but as I've tried changing the
> extents it just shifts the map around without "enlarging".    When I used
> the ogrinfo program to try to get the extents , it gave me numbers that
> looked like longitude and latitude values rather than "meters" like the
> extents I was using were using (I basically modified one of the tutorial
> files to get my own map and started with the extents they had used).
>
> If extents are in "meters"... what does that mean?   Where are you
> measuring
> from?   "meters" only gives a size, not a location like longitude/latitude
> would give so I'm not exactly sure what it means to express the extents in
> "meters".

Many projection use meters of feet as their UNITS. This is because they
define a horizontal and vertical reference line and then these are
distance off the reference lines.

If your data is in lat/long, then you UNITS should be DD and your
EXTENTS should be in lat,long. Don't forget that mapserver uses X,Y
which is equivalent to LONG, LAT, not lat/long.

To find out the extents of a shapefile use a utility like shpdump, if
you want to see the attributes then use dbfdump. I think you can do the
same with ogrinfo utility also.

> Sorry to post so many newbie type questions to this list where I see so
> many
> questions that are much more advanced but hopefully I can get up this
> learning curve as quickly as possible :)
>
> Thanks in advance,
> Jeff
>



More information about the mapserver-users mailing list