<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4522.1800" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I am trying to create a php/mapscript program. 
</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I first create a polygon shape file. Then 
I&nbsp;apply the shape file to a map object and display it.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>When I do this The new shape file does not display. 
If I re-run the program with out rewriting the shape file and using the old on, 
it works.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>How can I get this to work?</FONT></DIV>
<DIV><FONT face=Arial size=2>Thank you for any help </FONT></DIV>
<DIV><FONT face=Arial size=2>Aaron</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Ps. Here is the code I am using</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>$dbname = "/tmp/shape";<BR>$shpFname = 
"/tmp/shape";<BR>$shpFile = ms_newShapeFileObj( $shpFname, 
MS_SHP_POLYGON);<BR>$dbfFile = dbase_create( $dbname.".dbf",&nbsp; array( 
array("File", "C", 50) ));<BR>$lat = array();<BR>$lon = array();<BR>$oShp = 
ms_newShapeObj(MS_SHAPE_POLYGON);<BR>$oLine = ms_newLineObj();<BR>//Used to 
parse data from xml and run the data ($lat:$lon)<BR>$fp = popen ("perl t.pl 
/home/httpd/db/76.xml boundary_20010820", "r");<BR>while(!feof ($fp)) 
<BR>&nbsp;{<BR>&nbsp;$buffer = fgets($fp , 
4096);<BR>&nbsp;chop($buffer);<BR>&nbsp;list ($lat1, $lon1) = split (':', 
$buffer);<BR>&nbsp;if ($lat1 != 
"")<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;$oLine-&gt;addXY($lon1, 
$lat1);<BR>&nbsp;&nbsp;}<BR>&nbsp;array_push ($lat, $lat1);<BR>&nbsp;array_push 
($lon, $lon1);<BR>&nbsp;}</FONT></DIV>
<DIV>&nbsp;</DIV><FONT face=Arial size=2>
<DIV><BR>$oShp-&gt;add( $oLine 
);<BR>$shpFile-&gt;addShape($oShp);<BR>dbase_add_record($dbfFile, 
array("76"));<BR>pclose;</DIV>
<DIV>&nbsp;</DIV>
<DIV>$shpFile-&gt;free();<BR>dbase_close($dbfFile);</DIV>
<DIV>&nbsp;</DIV>
<DIV>sort($lat);<BR>sort($lon);<BR>$maxx = $lon[1];<BR>$miny = $lat[1];<BR>$minx 
= $lon[count($lon) -1];<BR>$maxy = $lat[count($lat) -1];</DIV>
<DIV>&nbsp;</DIV>
<DIV>$map = ms_newMapObj("php.map");<BR>$map-&gt;setExtent($minx, $miny, $maxx, 
$maxy);<BR>$layer = 
$map-&gt;getlayerbyname(field);<BR>$layer-&gt;set("data","/tmp/shape");<BR>$img 
= $map-&gt;draw();<BR>$url = $img-&gt;saveWebImage(1, 0, 0, 
65);<BR>printf("&lt;IMG SRC=%s WIDTH=%d HEIGHT=%d&gt;\n", $url, $map-&gt;width, 
$map-&gt;height);</FONT></DIV></BODY></HTML>