[Mapserver-users] Shape problems
Fernando S.
simon@inf.univali.br
Wed, 12 Nov 2003 10:33:07 -0200
Dear list,
I'm having difficulty to create line type shapefiles, the problems is
the Mapserver closing the shape.
The script closes the line, the first point with the last point of
line. How can I fix this?
I'm using this code to generate the shape:
<?php
set_time_limit(0);
include_once( "dual/oci.inc" );
dl( 'php_mapscript.so' );
ociConectar(); //database conection
function createShape($programId, $pname )
{
GLOBAL $shpFile,$dbfFile;
$query = "select x.* from hidrografia_sc h, table (SELECT
h.COORDENADA.SDO_ORDINATES FROM hidrografia_sc h WHERE h.codigo_ott =
83851000) x"; //query
ociExecutar($query); //execute query
$oShp = ms_newShapeObj(MS_SHAPE_LINE);
$oLine = ms_newLineObj();
while (list($x) = ociTupla())
{
list($y) = ociTupla();
$point = ms_newPointObj();
$point->setXY( $x, $y );
$oLine->add($point);
}
$oShp->add($oLine);
$shpFile->addShape($oShp);
dbase_add_record($dbfFile, array($programId, $pname ));
}
$shpFname = "/home/apache/htdocs/tmp/pol";
$shpFile = ms_newShapeFileObj( $shpFname, MS_SHP_ARC);
$dbfFile =
dbase_create($shpFname.".dbf",array(array("ID","N",5,0),array("NAME","C",10)));
createShape(1,"River");
echo "Shapes Created.<BR>";
$shpFile->free();
echo "Shape File ($shpFname) closed.<BR>";
dbase_close($dbfFile);
echo "Dbase file closed. <br>";
ociEncerrar(); //close connection
ociDesconectar();
?>
Fernando Simon
simon@cttmar.univali.br
_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users