Projection/Extent help
Ed McNierney
ed at TOPOZONE.COM
Thu Dec 16 09:02:19 PST 2004
Camden -
Your EXTENT and UNITS need to be described in the units of the output
projection your map is using. In your example below, everything is
fine. But if you switch to the two commented EXTENT and UNITS lines, it
won't work unless your PROJECTION block is changed to have the map
generated in a different projection that uses those units.
Leave your EXTENT and UNITS alone, since you want to (I think) still
have your output projection be "latlong". You need to create a new
PROJECTION block that's *inside* the LAYER definition block for the new
layer that's got units in feet.
By default MapServer assumes that all LAYERs not otherwise described are
in the same projection as the output projection of the image (the one
defined by the top-level PROJECTION block). If that's not the case,
MapServer can't guess - you have to tell it that a given layer is in a
different projection by including a PROJECTION block inside that layer
definition.
What is the "other" projection? You need to know either its name (if
it's a common, standard projection) or all the mathematical parameters
describing it if it's a custom projection. If you don't know how to
describe it accurately, MapServer won't be able to guess for you <g>!
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
ed at topozone.com
(978) 251-4242
-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Camden Daily
Sent: Thursday, December 16, 2004 11:30 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] Projection/Extent help
Hello all. I'm a mapserver newbie trying to figure something out.
Basically, I have two sets of shapefiles in different projections and
units. One has units of dd, and one has units of feet.
When I combine the two, I'd like to define my extents for the whole .map
file using dd instead of feet. I've made up a sample .map file where
I'm simply trying to display one layer with units of feet while defining
the extent using dd. However, everything I try just gives me a blank
page.
If I define the extent in terms of feet and drop the "proj=latlong"
line, it shows up fine. But I just can't get it to work when I define
the extent in dd.
Any help would be much appreciated!
-Camden Daily
MAP
NAME Chicago
STATUS ON
DEBUG ON
SIZE 300 300
IMAGETYPE PNG
IMAGECOLOR 240 240 240
SHAPEPATH "/web_system/data"
FONTSET "/web_system/fonts/fonts.list"
--------
EXTENT -87.74 41.80 -87.56 41.98
UNITS DD
PROJECTION
"proj=latlong"
END
-------
#EXTENT 1101584.450000 1841973.900000 1186739.850000 1969991.020000
#UNITS FEET
-------
WEB
LOG "/web_system/logs/mapserver.log"
IMAGEPATH "/web_system/tmp/"
IMAGEURL "/tmp/"
END
LAYER
NAME "cta_line"
TYPE LINE
STATUS DEFAULT
DEBUG ON
DATA "CTA_Line"
CLASS
COLOR 0 0 0
END
PROJECTION
"init=epsg:26971"
END
UNITS FEET
END
END
More information about the MapServer-users
mailing list