Changes between Version 4 and Version 5 of MapGuideRfc46


Ignore:
Timestamp:
Mar 14, 2008, 3:57:46 PM (16 years ago)
Author:
ronnielouie
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MapGuideRfc46

    v4 v5  
    5353== Implications ==
    5454
    55 Code that currently calls MgSelectionBase::GenerateFilter() should be updated to use MgSelectionBase::GenerateFilters() instead, and the caller will be required to process all the filters in the collection to correctly query the complete selection set.  In places where a relatively small number of features are expected in a selection (i.e. less than the value specified by SelectionFilterSize in serverconfig.ini/webconfig.ini), MgSelectionBase::GenerateFilter() can still be safely used to return correct results.
     55Code that currently calls MgSelectionBase::GenerateFilter() should be updated to use MgSelectionBase::GenerateFilters() instead, and the caller will be required to process all the filters in the collection to correctly query the complete selection set. 
     56
     57PHP code example using existing MgSelectionBase::GenerateFilter() API
     58{{{
     59            $filter = $sel->GenerateFilter($selLayer, $featureClassName);
     60           
     61            $query = new MgFeatureQueryOptions();
     62            $query->SetFilter($filter);
     63 
     64            $featureSource = new MgResourceIdentifier($selLayer->GetFeatureSourceId());
     65            $features = $featureSrvc->SelectFeatures($featureSource, $featureClassName, $query);
     66            if($features->ReadNext())
     67            {
     68                do
     69                {
     70                    AddFeatureToCollection($features->GetGeometry());
     71                }
     72                while($features->ReadNext());
     73                $features->Close();
     74            }
     75}}}
     76
     77PHP code example using NEW MgSelectionBase::GenerateFilters() API
     78{{{
     79            $filterCollection = $sel->GenerateFilters($selLayer, $featureClassName, GetMaxSelectionSize());
     80           
     81            for ($filterIndex = 0; $filterIndex < $filterCollection->GetCount(), $filterIndex++)
     82            {
     83                $query = new MgFeatureQueryOptions();
     84                $query->SetFilter($filterCollection->GetItem($filterIndex));
     85 
     86                $featureSource = new MgResourceIdentifier($selLayer->GetFeatureSourceId());
     87                $features = $featureSrvc->SelectFeatures($featureSource, $featureClassName, $query);
     88                if($features->ReadNext())
     89                {
     90                    do
     91                    {
     92                        AddFeatureToCollection($features->GetGeometry());
     93                    }
     94                    while($features->ReadNext());
     95                    $features->Close();
     96                }
     97            }
     98}}}
     99
     100In places where a relatively small number of features are expected in a selection (i.e. less than the value specified by SelectionFilterSize in serverconfig.ini/webconfig.ini), MgSelectionBase::GenerateFilter() can still be safely used to return correct results.
    56101
    57102This is a new API which will need to be documented.