[Mapserver-users] PHP Mapscript, Extent, and blank map -- I'm missing something

P Wilkerson 1wilkerson at charter.net
Mon Apr 19 06:53:40 PDT 2004


<second attempt at sending.  I rec'd a message that the first attempt
failed.>

I could use your help.

I have a PHP/Mapscript file that works when I use the EXTENT value and the
appropriate *.tiff and *.tfw world file from the GMAP75 DEMO.  But, when I
use a *.tiff and *.tfw for a Boston, MA, map and change the EXTENT value to
one given me, I get a blank page.

I have a scanned *.tiff image of an 1844 map of Boston, Massachusetts and
inherited an EXTENT statement that worked on one site but doesn't with my
script.  (additional info below)

I do not understand why the script works for one and not the other.

I suspect that the problem lies either in the EXTENT values or my PHP
script. - or both.


Peter Wilkerson

----------------------------------------------------------------------------
--------------------

QUESTIONS:

1. I wonder whether I am not initializing a variable in my PHP script (see
E. below).

2. I wonder whether my Extent values are correct or incorrect (see D. below)

3. I wonder whether my Extent values are of the same type as by tfw world
file. (see C below).

4. I would like to understand how to derive the Extent values.  I saw some
info at www.pghoster.com/gis but became confused how they actually got their
values for the EXTENT value.  There isn't an explicit link between the
values and the geospatial information they reference.  Something seems to be
missing.

5. What questions will I be asking next but I haven't thought far enough
ahead to realize it?

Where I have looked:
I have not found answers to my question by looking at the MapServer HOWTO
documents, the Mapserver Wiki, or by searching the Internet.  The Internet
site that had information related to my questions is www.pghoster.com/gis.
Unfortunately, it assumes that I have access to information that I do not
know how to find for maps other than their example.  Plus, the page jumps
from having spatial coordinates to having an EXTENT statement.  I do not
understand how to make that jump.

----------------------------------------------------------------------------
--------------------

Here is the information I have available:

A. I have a scanned *.tiff image of an 1844 map of Boston, Massachusetts.

B. With that scanned image I inherited a *.map file with an Extent value of

EXTENT 234503.759398496 899884.343580152 238052.631578947 902250.994765712

C. The *.tfw file reads
0.701844782744103330
0.791543562376848970
0.784906598953294070
-0.713650864002265410
233010.88920089259
899920.34490487236

D. Boston.map file ( * the second extent comes from shpdump.exe on a shp
file *)
MAP
NAME boston1868
SIZE 600 400
IMAGECOLOR 155 245 220
   EXTENT  234503.759398496 899884.343580152 238052.631578947
902250.994765712
# EXTENT  234368.977361       898337.203825       235831.484169
902022.271495
UNITS meters

WEB
    IMAGEPATH "/ms4w/tmp/ms_tmp/"
    IMAGEURL "/ms_tmp/"
END

LAYER
       NAME "boston1868"
       STATUS ON
       TYPE Raster
       DATA "E:/ms4w/Apache/htdocs/data/boston1868.tif"
END # Layer for base map

END # Mapfile

E. I've kept my *.phtml file straightforward for my testing.  It works for
the gmap75 *.map file but not for the above *.map file (line numbers added).

1. <?php
2. dl('php_mapscript.so');

3. $map_path="e:/ms4w/apache/htdocs/";
4. $ms_newmap = ($map_path.'boston03.map');

5. $map = ms_newMapObj($ms_newmap);
6. $image=$map->draw();

7. $gImagesFmt = MS_PNG;
8. $image_url=$image->saveWebImage($gImagesFmt, 0, 0, -1);
9. ?>

10. <HTML>
11. <HEAD>
12. <TITLE>Example 1: Displaying a map</TITLE>
13. </HEAD>
14. <BODY>
15.                <IMG SRC=<?php echo $image_url; ?> >
16. </BODY>
17. </HTML>




More information about the MapServer-users mailing list