[Mapserver-users] I'm getting a little frustrated...

Paul VanDyke pvandyke at kib.co.kodiak.ak.us
Mon Apr 5 16:08:10 EDT 2004


Thank you for your quick reply...

I've got the PROJECTION lines setup and here is my .prj file for one the
shape files:

PROJCS["NAD_1927_StatePlane_Alaska_5_FIPS_5005",GEOGCS["GCS_North_Americ
an_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,
294.9786982]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
,PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],P
ARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-154.0],PARA
METER["Scale_Factor",0.9999],PARAMETER["Latitude_Of_Origin",54.0],UNIT["
Foot_US",0.3048006096012192]]

Can you tell what type of projection I need to specify for it?

Thanks,

Paul

-----Original Message-----
From: Paul Ramsey [mailto:pramsey at refractions.net] 
Sent: Monday, April 05, 2004 11:46 AM
To: Ed McNierney
Cc: Paul VanDyke; mapserver-users at lists.gis.umn.edu
Subject: Re: [Mapserver-users] I'm getting a little frustrated...


Odd that your wld file seems to disagree with the coordinate information

embedded in the GeoTIFF. Possibly it is being ignored since the GeoTIFF 
already has coordinate system and location information in it.

What you need to do now:

Declare a projection for your map service. How about UTM5, since that is

what your GeoTIFF says it is in. This is the master projection that all 
your layers will be reprojected to before the map is written out. So add

a set of lines under your MAP:

   PROJECTION
     "init=epsg:26705"
   END

Now, for each of your LAYERS you have to declare what projection *they* 
are in. For your modis, that is easy, since we have already seen it is 
declared in UTM5. So some lines to the MODIS LAYER:

   PROJECTION
     "init=epsg:26705"
   END

For the shape files, things are harder. What projection is the shape 
data in? Lat/Lon? Stateplane? Some other UTM zone? If you have .prj 
files with your shape files, you are in luck: open those babies up and 
see what they say. If not, you are stuck going back for metadata on your

files, checking the coordinate extents (if the extents are all < 180, 
probably it is lat/lon :), etc, until you can find the projection. Hunt 
down the relevant projection in your epsg file and plug the appropriate 
number into a PROJECTION for each layer. Wash, rinse, repeat.

Paul

Ed McNierney wrote:

> Paul -
> 
> ArcMap will read .prj files for each layer (ESRI forgot to include 
> projection definitions in their earlier file formats) for determining 
> what projection they're in.  You need to have that information in the 
> PROJECTION block *inside* each LAYER block in your map file.
> 
> Know your data before trying to make it work in MapServer.  Your 
> shapefiles are likely to be in decimal degrees, but they might not be.

> ArcMap will reproject layers into the projection of the current data 
> view, and MapServer will do the same.
> 
> 	- 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: Paul VanDyke [mailto:pvandyke at kib.co.kodiak.ak.us]
> Sent: Monday, April 05, 2004 3:05 PM
> To: Ed McNierney; mapserver-users at lists.gis.umn.edu
> Subject: RE: [Mapserver-users] I'm getting a little frustrated...
> 
> Eureka!!!  Success at last!! WOOT!!!
> 
> Ok, using the LISTGEO tool, I was able to find the correct extents to 
> MY (not the tutorial's) tif image.  I plugged those in on a test map 
> and can now see a working raster image in mapserver.  Now I have proff

> that it works on my system in my environment.  THANK YOU ED!!!
> 
> Now, how do I display my raster and my shape files together on the 
> same page?  When I look at the extents, they don't overlap. However, 
> when I add them as two layers in ArcMap they mesh perfectly.  I do
have a .wld
> file for the tif.  Do I need to create/adjust my projections?    All
the
> files are NAD_27.  Again, this is a learning process for me, so I 
> appreciate all the help that everyone is giving me.
> 
> Here is the new .map file that I'm working with:
> 
> MAP
>   NAME map7
>   IMAGETYPE PNG
>   EXTENT 517415 6368214 542392 6403304
>   SIZE 800 400
>   SHAPEPATH "c:/program files/apache group/apache2/htdocs/data"
>   IMAGECOLOR 255 255 255
>   DEBUG ON
> 
>   WEB
>     TEMPLATE  'map6.html'
>     IMAGEPATH '/data/tmp/'
>     IMAGEURL '/tmp/'
>     LOG 'c:\mapserver.log'
>   END
> 
> 
>   # Start of LAYER DEFINITIONS -----------------------------
> 
> 
>   LAYER # water
> 	NAME water
> 	DATA kib_boundary
> 	STATUS DEFAULT
> 	TYPE POLYGON
> 
> 	CLASS
> 	  STYLE
> 		COLOR 115 207 255
> 		OUTLINECOLOR 32 32 32
> 	  END
> 	END
>    END
>   
> 
> 
>   LAYER # coast
> 	NAME coast
> 	DATA kib_coast
> 	STATUS DEFAULT
> 	TYPE POLYGON
> 
> 	CLASS
> 	  STYLE
> 		COLOR 0 216 56
> 		OUTLINECOLOR 32 32 32
> 	  END
> 	END
>    END
> 
> 
>  LAYER # MODIS raster layer begins here
>     NAME test123
>     DATA raster/kodiakc2.tif
>     STATUS DEFAULT
>     TYPE RASTER
> #    PROCESSING "BANDS=1"
> #    OFFSITE 71 74 65
>   END # MODIS raster layer ends here
> 
> 
> 
>   # End of LAYER DEFINITIONS -------------------------------
> 
> 
> END # end of map file/object
> 
> 
> Here is the output from the LISTGEO on the kodiakc2.tif file:
> 
> C:\Program Files\Apache Group\Apache2\htdocs\data\raster>listgeo
> kodiakc2.tif
> Geotiff_Information:
>    Version: 1
>    Key_Revision: 0.2
>    Tagged_Information:
>       ModelTiepointTag (2,3):
>          0                0                0
>          517415.363       6403304.71       0
>       ModelPixelScaleTag (1,3):
>          6.437376         6.437376         0
>       End_Of_Tags.
>    Keyed_Information:
>       GTModelTypeGeoKey (Short,1): ModelTypeProjected
>       GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
>       ProjectedCSTypeGeoKey (Short,1): PCS_NAD27_UTM_zone_5N
>       PCSCitationGeoKey (Ascii,24): "UTM Zone 5 N with NAD27"
>       End_Of_Keys.
>    End_Of_Geotiff.
> 
> PCS = 26705 (name unknown)
> Projection = 16005 ()
> Projection Method: CT_TransverseMercator
>    ProjNatOriginLatGeoKey: 0.000000 (  0d 0' 0.00"N)
>    ProjNatOriginLongGeoKey: -153.000000 (153d 0' 0.00"W)
>    ProjScaleAtNatOriginGeoKey: 0.999600
>    ProjFalseEastingGeoKey: 500000.000000 m
>    ProjFalseNorthingGeoKey: 0.000000 m
> GCS: 4267/NAD27
> Datum: 6267/North American Datum 1927
> Ellipsoid: 7008/Clarke 1866 (6378206.40,6356583.80) Prime Meridian: 
> 8901/Greenwich (0.000000/  0d 0' 0.00"E)
> 
> Corner Coordinates:
> Upper Left    ( 517415.363,6403304.706)
> Lower Left    ( 517415.363,6368214.569)
> Upper Right   ( 542392.381,6403304.706)
> Lower Right   ( 542392.381,6368214.569)
> Center        ( 529903.872,6385759.638)
> 
> 
> Here's the kodiakc2.wld file
> 
> 21.098407687615669
> 
> 0.283828823820080900
> 
> 0.308025501864488020
> 
> -21.117268418850411
> 
> 752488.58435255091
> 
> 1380675.7577753554
> 
> 
> 
> Thanks,
> 
> Paul
> 
> 
> 
> 
> _______________________________________________
> Mapserver-users mailing list Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users


-- 
       __
      /
      | Paul Ramsey
      | Refractions Research
      | Email: pramsey at refractions.net
      | Phone: (250) 885-0632
      \_





More information about the mapserver-users mailing list