[mapserver-users] plz response immediate (deadline)

José María Michia jose.maria.michia at gmail.com
Wed Jan 21 13:23:05 EST 2009


2009/1/21 Amiya Patra <amiyapatra188 at gmail.com>:
> hi
> But I am not getting how to addtwo points via shapeobj  as I already placed
> points in my map file. my function is like this....
> function AddPoints ( $map, $qresult )
>         {
>             $i = 0;
>              foreach($qresult as $row)
>             {
>
>                  $poi[$i] = ms_newPointObj();
>                  $ln[$i] = ms_newLineObj();

Maybe one problem is the following line:

>                  $shp[$i] = ms_newShapeObj(MS_SHAPE_POINT)

You must create a new shape of type LINE, not POINT. Change this line to:

>                  $shp[$i] = ms_newShapeObj(MS_SHAPE_LINE)

> ;
>                  $poi[$i]->setXY($row[1],$row[2]);
>                  $ln[$i]->add($poi[$i]);
>                  $shp[$i]->add($ln[$i]);
>                  $shp[$i]->set(index, $row[0]);
>                  $this_layer->addFeature( $shp[$i] );
>                  $i++;
>              }
>
>          } // end AddPoints
>   plz response .......
> thanks

Perhaps there are other issues with your problem, I hope not!

Saludos
José María


More information about the mapserver-users mailing list