[mapguide-users] Unique Identify for Feature

flakesns flakesns at gmail.com
Wed May 6 01:08:17 EDT 2009


i use this code-->

 $queryOptions->SetFilter($selectionString);
 $featureReader = $featureService->SelectFeatures($layerFeatureResource,
$layerClassName, $queryOptions);
$idProp = $featureReader->GetClassDefinition()->GetIdentityProperties();
    $propCount = $idProp->GetCount();
    for($j=0; $j<$propCount; $j++)
    {
        $featureKey = $idProp->GetItem($j)->GetName();
        //$featureKeyType = $featureReader->GetPropertyType($featureKey);
    }
$propertyType = $featureReader->GetPropertyType($mgKey);
 while ($featureReader->ReadNext())
          {
              if($propertyType == 6){
                  $mgValue = $featureReader->GetInt16($mgKey);
              }
             if($propertyType == 7){
                  $mgValue = $featureReader->GetInt32($mgKey);
              }
              if($propertyType == 8){
                  $mgValue = $featureReader->GetInt64($mgKey);
             }
             if($propertyType == 9){
                  $mgValue = $featureReader->GetString($mgKey);
             }
          }



KeithC wrote:
> 
> I need to find a way to get unique ids for features so that I can store
> these unique ids and use them to link to other things (Urls etc).
> Presumably I can use MgClassDefinition::GetIdentityProperties to find
> which properties to interrogate. What are these Identity Properties for an
> SDF say? Will the values remain the same if the data source is updated
> using MapGuide Studio?
> Keith
> 

-- 
View this message in context: http://n2.nabble.com/Unique-Identify-for-Feature-tp2545225p2808646.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list