[mapguide-trac] #226: Buffer is not Accurate

MapGuide Open Source trac_mapguide at osgeo.org
Fri Jul 13 15:33:21 EDT 2007


#226: Buffer is not Accurate
-----------------------------+----------------------------------------------
 Reporter:  cgountanis       |         Owner:       
     Type:  defect           |        Status:  new  
 Priority:  high             |     Milestone:  1.3  
Component:  Drawing Service  |       Version:  1.2.0
 Severity:  major            |    Resolution:       
 Keywords:  buffer           |   External_id:       
-----------------------------+----------------------------------------------
Comment (by flipper):

 Same issues with me...What Units does Buffer Expect to be sent in?
 Starting with unit type of feet and distance of 100.
 Background:
 When I do a ->getunits on the Coordinate System (srsDs) it returns US_foot
 When I do a ->getunitScale on the Coordinate System (srsDs) it returns
 0.304800609601

 Earlier in the PHP code it converts my Units to Meters from feet:
 {if($units == "fe") //feet $distance *= .30480;} Returning distance=30.480
 Then later the Code does this:
 $dist = $srsDs->ConvertMetersToCoordinateSystemUnits($distance) returning
 dist=99.9998
 After this it Creates
 $measure = new MgCoordinateSystemMeasure($srsDs);

 Here's Where it gets weird if I run measure->getDistance(1.0,0.0,0.0,0.0)
 I would expect it to return the value of 1 but instead it returns
 3.27654107864
 (Shouldn't the Measure Object be in feet since it was created off a US
 Foot coordinate system or is it assuming Meters on coordinates sent in???)
 We Use Measure and dist to create the buffer so since a one unit
 coordinate change returns 3.27654107864 it makes sense why the distance
 would come up so much smaller.
 $geomBuffer = $geom->Buffer($dist, $measure);

 Its somewhere in the MgCoordinateSystemMeasure area or in the
 0.304800609601 UnitScale on the coordinate system...I know how to force a
 fix...but it wouldnt repair whats ultimately really broken here.

-- 
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/226#comment:5>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list