<!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> </DIV>
<DIV><FONT face=Arial size=2>I first create a polygon shape file. Then
I apply the shape file to a map object and display it.</FONT></DIV>
<DIV> </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> </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> </DIV>
<DIV><FONT face=Arial size=2>Ps. Here is the code I am using</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </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", 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> {<BR> $buffer = fgets($fp ,
4096);<BR> chop($buffer);<BR> list ($lat1, $lon1) = split (':',
$buffer);<BR> if ($lat1 !=
"")<BR> {<BR> $oLine->addXY($lon1,
$lat1);<BR> }<BR> array_push ($lat, $lat1);<BR> array_push
($lon, $lon1);<BR> }</FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR>$oShp->add( $oLine
);<BR>$shpFile->addShape($oShp);<BR>dbase_add_record($dbfFile,
array("76"));<BR>pclose;</DIV>
<DIV> </DIV>
<DIV>$shpFile->free();<BR>dbase_close($dbfFile);</DIV>
<DIV> </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> </DIV>
<DIV>$map = ms_newMapObj("php.map");<BR>$map->setExtent($minx, $miny, $maxx,
$maxy);<BR>$layer =
$map->getlayerbyname(field);<BR>$layer->set("data","/tmp/shape");<BR>$img
= $map->draw();<BR>$url = $img->saveWebImage(1, 0, 0,
65);<BR>printf("<IMG SRC=%s WIDTH=%d HEIGHT=%d>\n", $url, $map->width,
$map->height);</FONT></DIV></BODY></HTML>