latlong issues

Ed McNierney ed at TOPOZONE.COM
Mon Sep 10 10:48:48 PDT 2007


Chris -

First, I think you¹re using ³geocodes² in an unusual way, and I¹m not really
sure what you mean by it.  ³Geocode² is a verb that means ³take some data
(like street addresses) and turn it into geographic coordinates (like
lat/lon)².  The process is called geocoding.  You¹re using it as a noun and
I really can¹t figure out just what you mean.  If you can give some examples
that would be helpful.

The EXTENT of your map must be specified in the units and coordinates of the
output projection of your map image.  While you can combine lat/lon data and
UTM data in multiple layers, your output map image must be one projection.
As I recall, you were taking a UTM source raster and producing a UTM output
image.  That¹s fine.  Do you want to change that?  I would discourage you
strongly from changing your output projection, as UTM is an excellent choice
for your application.

Your raster map image shows a certain portion of the world, at a certain
resolution/scale, in a particular projection.  Your world file documents
this information so applications can use it.  You can¹t modify your image by
playing with the world file ­ the world file either accurately describes the
raster image, or it¹s wrong.  I think you had a correct world file for your
raster layer already; if so, don¹t touch it ­ you can only make it
incorrect.

If you can explain a little about what your geocodes are and how you need to
display them we can probably help.  If I¹m missing the boat please try to
explain what it is you¹re trying to go (in non-technical terms).

     - Ed
  
-- 
Ed McNierney
Chief Mapmaker
Demand Media / TopoZone.com
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
Phone: (978) 251-4242
Fax: (978) 251-1396
ed at topozone.com



From: Christopher Harris <docterrobert at MSN.COM>
Reply-To: Christopher Harris <docterrobert at MSN.COM>
Date: Mon, 10 Sep 2007 11:44:06 -0500
To: <MAPSERVER-USERS at LISTS.UMN.EDU>
Subject: [UMN_MAPSERVER-USERS] latlong issues

    Hi.  I posted last week about trying to get an image that I already have
to be displayed on a layer with help from a world file.  That all works.
Now, I have new questions.

    My world file is using the UTM projection.  The tricky part now is that
I need to specify in my map file the extent in latitudes and longitudes.  I
have the appropriate geocodes, and I know that a world file and extent are
lower left x,y then top right x,y and that an image is top left x,y then
bottom right x,y.  So I have all that compensated for, otherwise I wouldn't
have gotten it working in meters for UTM as my extent.  I've tried entering
in the geocodes as the extent for the MAP object.  That didn't work.  So, I
figured "I'm using UTM in my world file.  Maybe I need to specify latlong
projection for the MAP object."  That didn't work either.  I then tried
adding that same projection to the one layer that I have.  No luck.  The
image comes up blank once again.  And yes, I've read the section on rasters.

My questions:
How do I switch from using Meters as my extent to geocodes?
Do I need to use UTM for my world file?  Every example I've seen on the net
uses UTM.  I've tried geocodes for the world file, but gdalinfo <image>
indicates that the corner coordinates are totally off.

The .php file is nothing special or elaborate.  It just simply creates the
image and draws it.

My world file:
1
0.0000000000
0.0000000000
-1
393898.00
4438945.00

My map file  (I have the projections commented out as well as the EXTENT in
METERS that worked)
MAP
    NAME UniversityOfIllinois
    STATUS ON
    SIZE 1747 1916
    IMAGETYPE GIF    #image is 1747 X 1916 pixels
    #PROJECTION
    #    "proj=latlong"
    #    "ellps=WGS84"
    #    "datum=NAD83"
    #END
    #EXTENT 393897.50 4437029.50 395644.50 4438945.50
    #UNITS METERS
    EXTENT 40.071888 -88.244698 40.094110 -88.217468
    SHAPEPATH "/var/www/mapserver/basic/data/illinois/"
    IMAGECOLOR 255 255 255
    
    OUTPUTFORMAT
        NAME thegif
        DRIVER "GD/GIF"
        MIMETYPE "image/gif"
        IMAGEMODE RGB
        EXTENSION "gif"
    END
    OUTPUTFORMAT
        NAME thepng
        DRIVER "GD/PNG"
        MIMETYPE "image/png"
        IMAGEMODE PC256
        EXTENSION "png"
    END

    WEB
            IMAGEPATH "/var/www/mapserver/basic/images/"
            IMAGEURL "/mapserver/basic/images/"
        END

    LAYER
        NAME "UofI"
          DATA "colorUofIllinois.gif"
          TYPE RASTER
          STATUS DEFAULT
        #PROJECTION
        #    "proj=latlong"
        #    "ellps=WGS84"
        #    "datum=NAD83"
        #END
    END    
END

Any extra info needed:
MapServer version 4.10.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT
SUPPORTS=WCS_SERVER SUPPORTS=THREADS SUPPORTS=GEOS INPUT=EPPL7 INPUT=POSTGIS
INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE DEBUG=MSDEBUG

Any help would be spectacular.  Thanks advance.

 - Chris


Gear up for Halo® 3 and get a $25 Best Buy gift card. It¹s our way of saying
thanks for using Windows Live. Get it now!
<http://gethalo3gear.com?ocid=SeptemberWLHalo3_WLHMTxt_1> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20070910/5eb01d13/attachment.htm>


More information about the MapServer-users mailing list