[mapserver-users] No fill after creating a shapeObj

Arthur, John John.Arthur at voicestream.com
Wed May 22 09:48:25 EDT 2002


No, something shows up, but it is only an outline.  In fact, if I take the
outlinecolor off and leave the fill color, the outline will remain, but in
the color of the fill.  I am using MapServer 3.5 & PHP 4.06, but I have not
had a problem closing the SHP file.  

By the way, is there a better way to create a semi-circle or pie shape?


-----Original Message-----
From: Daniel Morissette [mailto:morissette at dmsolutions.ca]
Sent: Wednesday, May 22, 2002 9:41 AM
To: Arthur, John
Cc: mapserver-users at lists.gis.umn.edu
Subject: Re: [mapserver-users] No fill after creating a shapeObj


I assume that after creating the shapefile you add it to a layer on the
fly and then nothing shows up in the layer?

You should check a few things:

1- Make sure that you close the DBF and SHP files before using them in
   a layer:

    $shpFile->free();
    dbase_close($dbfFile);

2- Make sure you use MapServer 3.6 since 3.5 may have had some problems
with closing the SHP file depending on your version of PHP.

Daniel


"Arthur, John" wrote:
> 
> What am I doing wrong?  The following example will create a shape (line),
> but it will not be filled.  I works if I use similar code for dynamic
> layers, but fails to fill if I write it to a shp file.  Thanks for your
> help.
> 
> example:--------------------------------------------------
> 
> $shpFile = ms_newShapeFileObj( $shpFname, MS_SHP_POLYGON);
> $dbfFile = dbase_create( $shpFname.".dbf", <!-- My field array here -->);
> $oShp = ms_newShapeObj(MS_SHAPE_POLYGON);
> $oLine = ms_NewLineObj();
> $mid_h=90;
> $beg_h=$mid_h+(($horizontal/2)-$horizontal);
> $midbeg_h=$mid_h+((($horizontal/2)+($horizontal/4))-$horizontal);
> $midend_h=$mid_h+((($horizontal/4)*5)-$horizontal);
> $end_h=$mid_h+((($horizontal/2)*3)-$horizontal);
> 
> $oLine->addXY($x, $y);
> $oLine->addXY($x + 0.015 * 0.4 *
> cos((($orientation*-1)+$beg_h)*3.14159265/180), $y + 0.015 * 0.4 *
> sin((($orientation*-1)+$beg_h)*3.14159265/180));
> $oLine->addXY($x + 0.015 * 0.4 *
> cos((($orientation*-1)+$midbeg_h)*3.14159265/180), $y + 0.015 * 0.4 *
> sin((($orientation*-1)+$midbeg_h)*3.14159265/180));
> $oLine->addXY($x + 0.015 * 0.4 *
> cos((($orientation*-1)+$mid_h)*3.14159265/180), $y + 0.015 * 0.4 *
> sin((($orientation*-1)+$mid_h)*3.14159265/180));
> $oLine->addXY($x + 0.015 * 0.4 *
> cos((($orientation*-1)+$midend_h)*3.14159265/180), $y + 0.015 * 0.4 *
> sin((($orientation*-1)+$midend_h)*3.14159265/180));
> $oLine->addXY($x + 0.015 * 0.4 *
> cos((($orientation*-1)+$end_h)*3.14159265/180), $y + 0.015 * 0.4 *
> sin((($orientation*-1)+$end_h)*3.14159265/180));
> $oLine->addXY($x, $y);
> 
> $oShp->add($oLine);
> 
> $oShp->add( $oLine );
> $shpFile->addShape($oShp);
> 
> dbase_add_record($dbfFile, <!-- My field array here -->);
> 
> John Arthur
> RF Technician
> Office:   (757) 490-7221
> Cellular: (757) 692-1515
> Email: john.arthur at voicestream.com
> VoiceStream Wireless
> Global Wireless by
> ···T···Mobile·



More information about the mapserver-users mailing list