[mapguide-users] buffer feature create. around added point.

Maciej Skorczewski maciej.skorczewski at procad.pl
Mon Jan 15 05:49:24 EST 2007


Hi!


I add some points to map  (code in PHP)
When point is created i want to create a buffer around this point...when 
i make it i get this error.

--start error message---
1 layers were excluded from buffer computation because their coordinate 
systems are incompatible with the coordinate system of the map, or 
because they have no coordinate system at all
--end error message---

so where can i set valid coordinate system? My map use
- *XY-M* (Arbitrary X-Y Coordinates (Meters))-.




//Creating the point
// $x , $y come from database
$geometryFactory = new MgGeometryFactory();
$coordinate = $geometryFactory->CreateCoordinateXY($x,$y);
$point = $geometryFactory->CreatePoint($coordinate);

//Define a property collection

$geometryReaderWriter = new MgAgfReaderWriter();
$properties = new MgPropertyCollection();
$properties->Add(new MgInt32Property('Id_obiektu',''.$id.''));
$properties->Add(new MgStringProperty('Typ',''.$typ_obiektu.''));
$properties->Add(new MgGeometryProperty('SHPGEOM', 
$geometryReaderWriter->Write($point)));


//Create an insert command for this property.

$parcelMarkerCommands->Add(new MgInsertFeatures('Obiekty', $properties));



if ($parcelMarkerCommands->GetCount() > 0)
        {
          $featureService->UpdateFeatures($parcelMarkerFeatureSourceId, 
$parcelMarkerCommands, false);
          $parcelMarkerLayer->SetVisible(true);


     $parcelMarkerLayer->SetName("Obiekty");
     $parcelMarkerLayer->SetLegendLabel("Obiekty");
     $parcelMarkerLayer->SetDisplayInLegend(true);
     $parcelMarkerLayer->SetSelectable(true);


          $parcelMarkerLayer->ForceRefresh();
          $sessionIdName = "Session:$mgSessionId//gdansk2.Map";
          $sessionResourceID = new MgResourceIdentifier($sessionIdName);
          $sessionResourceID->Validate();
          $map->Save($resourceService, $sessionResourceID);
          $mapUpdated = true;

        }

else
{}



Maciek


More information about the mapguide-users mailing list