Projection Help

Ed McNierney ed at TOPOZONE.COM
Thu Mar 24 19:30:45 PST 2005


Giridhar -

I think you are slightly misunderstanding the meaning of the EPSG codes.

The term "map projection" is commonly used informally to describe a type
or class of map projections.  For example, the Transverse Mercator
projection is a method for projecting points on to a plane (a map), but
there are many specific implementations of this class of projections.
For example, a Transverse Mercator projection has a central meridian -
you may select any line of longitude for that value.  Each choice will
give you a different output image.

In MapServer (and most other GIS usage) a "projection" refers to a
specific implementation of a type of projection.  This basically
describes the combination of a projection type (like Transverse
Mercator) and a specific set of parameters (like the choice of central
meridian) that go with it.  This meaning of "projection" refers to the
set of ALL parameters required to completely, unambigiously describe the
actual mathematical transformations used to create a map.

These parameters can get wordy and easy to mistype or miscode.  It is
also sometimes hard to recognize a familiar projection if it's only
described parametrically.  The EPSG coding system addresses these
problems.  Commonly-used projections are tabulated and each given an
unique index number, the "EPSG code".

For example the following definition:

PROJECTION
+proj=utm
+zone=15
+ellps=GRS80
+datum=NAD83
+units=m
+no_defs
END

defines, in a MapServer map file, the UTM Zone 15N NAD83 projection.
This is a common projection and has been assigned the EPSG code 26915.
As a result, you could use this equivalent definition:

PROJECTION
+init=epsg:26915
END

The benefits are that the description is much shorter, it's easier to
type correctly, and it's easy to see if two projections are really the
same.  The disadvantages are that it's cryptic (and meaningless without
an EPSG table) and it's impossible to use for "non-standard" projections
that don't have a code assigned.

So - now to get to your questions <g>:

Q: Can anyone tell me how to set the EPSG or other information in the
map file?

A: By using a PROJECTION block as I have just shown above.  A PROJECTION
block at the top level (not inside a LAYER) of the map file describes
the projection of the output map image.  A PROJECTION block inside a
LAYER block describes the projection of the source input data set.  If
they are different, MapServer will do the reprojection for you (assuming
it's properly configured, which is the normal case).

Q: Can I know the Projection coordinates from the shapefile?

A: The shapefile is really just a lot of coordinates.  I suspect you
want to know if you can know the PROJECTION from the shapefile.  Often
the answer is "No".  The shapefile format does not include projection
information in any way.  Relatively recently, ESRI has started using an
auxiliary file with the extension .PRJ (with the same base name as the
shapefile) to describe the projection of the shapefile.  You will
sometimes find these files with shapefiles - often you will not.

Q: Is there a specific EPSG Code for each country or is it for each
state in each country?

A: There is a specific EPSG code for each projection.  You may be
getting slightly confused by the adoption of standardized local
projection systems.  Since you talk about Virginia, I'll give the United
States example.  Each state in the US has adopted one or more State
Plane Coordinate Systems (SPCS).  These are map projections that are
used for surveying and legal coordinate documentation in each state.
Each SPCS is designed to cover an entire small state or a portion of a
larger state.  Map projections suitable for high-precision work are only
suitable over a limited area - as you move farther from the natural
origin of the projection, your errors increase.  In order to support
highly accurate survey work, large states provide several "zones",
usually all of which use the same class of projection with slightly
different parameters.

Q: How do I find the EPSG Code for Virginia or a city in Virginia?

A: Therefore, you should know by now that Virginia does not have an EPSG
code.  The State of Virginia has a State Plane Coordinate system divided
into two zones - North and South.  To find out the boundaries of these
zones, you can refer to an ESRI shapefile available at
http://www.geographynetwork.com/data/download/esri/stateplane.zip
showing the extent of all SPCS zones.

        - Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
Phone: +1 (978) 251-4242
Fax: +1 (978) 251-1396
ed at topozone.com

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Giridhar Manepalli
Sent: Thursday, March 24, 2005 9:22 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] Projection Help

Hello All,

I really appreciate the support that I have been getting in this list,
without which it is impossible for me to go ahead in my project.
Although, I have bulleted the questions that I have in my mind, any help
in the discipline is invaluable to me.

These are my questions:-

Can anyone tell me how to set the EPSG or other information in the map
file?

Can I know the Projection coordinates from the shapefile?

Is there a specific EPSG Code for each country or is it for each state
in each country?

How do I find the EPSG Code for Virginia or a city in Virginia?

I appreciate if someone can throw some light onto this.

Regards,
Giridhar



More information about the MapServer-users mailing list