[Mapserver-users] Shape problems

Rodrigo Zanato Tripodi rodrigotripodi at bol.com.br
Wed Nov 12 09:47:43 PST 2003


Hi Fernando,

Whatzup?

Maybe you found a bug at php mapscript.

file: mapscript_i.c
function: lineObj_add
code:

    self->point[self->numpoints].x = p->x;
    self->point[self->numpoints].y = p->y;
    self->point[self->numpoints].m = p->m;
    self->numpoints++;

With this, the last point is equal to the first.

Right?

It need to be disabled at MS_SHAPE_LINE?

[]'s

Rodrigo Zanato Tripodi

----- Original Message ----- 
From: "Fernando S." <simon at inf.univali.br>
To: <mapserver-users at lists.gis.umn.edu>
Sent: Wednesday, November 12, 2003 10:33 AM
Subject: [Mapserver-users] Shape problems


> 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 at cttmar.univali.br
>
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list