[mapserver-users] New User - Projection Question

Jeff McKenna mckenna at dmsolutions.ca
Mon Jul 16 10:16:41 PDT 2001


Mike Boone wrote:

> Hi all.
>
> I'm a novice user who stumbled upon mapserver as a way to plot GPS tracks on
> the web.
>
> I was looking at examples of mapserver in use and found this one:
> http://www.sis.ec.gc.ca/msapps/ec_species/htdocs/ec_species_e.phtml
>
> What makes this different from what I've done is that this map's longitude
> lines look like they will merge at the north pole. I think this was done by
> some projection change, but maybe that layout is stored in the shapefile?
>
> I swiped a 50 states shapefile from nationalatlas.gov and it displays in my
> mapserver in a "flat" layout. How can I get it to map-out like the Canada
> map in the example?
>
> I have PROJ.4 compiled into my mapserver OK, but I after putting various
> PROJECTION settings in my mapfile, I see no difference.
>
> Is PROJECTION the right place to get this result, or do I need shapefiles
> made specifically for this purpose?
>
> Please excuse me if my terminology is wrong...I'm still figuring it all out.
>
> Thanks!
> Mike Boone
> mike at boonedocks.net

Hi Mike,

Although I am no expert myself when it comes to projections, I think I can help
you (I was one of the developers involved in the Species At Risk site that you
were looking at).
The shapefiles that you see in the Species application are all in the Lambert
Conforml Conic (LCC) projection.  From your description of your data I would
guess that your data is in generic lat/longs (a 'Geographic' projection).  A
solution to your problem could be to specify LCC as your default projection in
your mapfile, through a PROJECTION object, and then declare 'Geographic' as the
layer(s) projection:

eg.


# Main map and default projection definition
#
PROJECTION
  "proj=lcc"
  "ellps=GRS80"
  "lat_0=49"
  "lon_0=-95"
  "lat_1=49"
  "lat_2=77"
END
...
LAYER
  NAME States
  DESCRIPTION "States_poly"
  TYPE POLYGON
  STATUS ON
  DATA bounds
  # Specify the data's projection
  PROJECTION
    geographic
  END
  ...
  CLASS
    ...
  END
END # Layer



Declaring 'PROJECTION geographic END' in each layer will re-project your data to
the default projection that you specify in the PROJECTION object.
I hope this helps you, good luck.


Jeff



--------------------------
Jeff McKenna
GIS Specialist
DM Solutions Group Inc.
Ottawa, Ontario
http://www.dmsolutions.ca







More information about the MapServer-users mailing list