[fdo-users] Spatial Filter Help Needed

Jackie Ng jumpinjackie at gmail.com
Thu Oct 2 13:04:09 EDT 2008


Both techniques you described should work.

- Jackie


surrounded wrote:
> 
> Hi Jackie,
> 
> Can you give an idea of how to apply the filter to the select command.  I
> thought the sel.SetFilter did that.  Perhaps, I'll try  sel.Filter =
> Filter.Parse(pPtLineFilter.toString());
> 
> I will also try Geometry.
> 
> Thanks.....
> 
> 
> Jackie Ng wrote:
>> 
>> I see two things:
>> 
>> 1) The filter is being created but not being applied to the select
>> command.
>> 2) I don't think you can apply filters on "aliased" properties. You
>> should be able to filter on the "Geometry" property and get the same
>> result.
>> 
>> - Jackie
>> 
>> 
>> surrounded wrote:
>>> 
>>> I'm trying to intersect a circle (created from input coordinates) with a
>>> shapefile.  I've created the circle geometry and am now trying to set up
>>> the filter.  In the code below, the statement
>>> 
>>> while(reader.ReadNext()) 
>>> 
>>> throws the follwing exception:
>>> "The property 'Shape' is not in the readers selected property set"
>>> 
>>> SUGGESTIONS....THANKS
>>> 
>>> **********************************************
>>> 
>>> OSGeo.FDO.Expression.GeometryValue pGVal = new
>>> GeometryValue(pByteCircle);
>>> OSGeo.FDO.Expression.ComputedIdentifier pPropName = new
>>> ComputedIdentifier("Shape", new Identifier("Geometry"));
>>> 
>>> IdentifierCollection pIDColl = sel.PropertyNames;
>>> pIDColl.Add(pPropName);
>>> 
>>> OSGeo.FDO.Filter.Filter pPtLineFilter = new
>>> OSGeo.FDO.Filter.SpatialCondition(pPropName,
>>> OSGeo.FDO.Filter.SpatialOperations.SpatialOperations_Intersect, pGVal);
>>> }
>>> 
>>> OSGeo.FDO.Commands.Feature.IFeatureReader reader = sel.Execute();
>>> while (reader.ReadNext())
>>> {
>>>      ......some code....
>>> } 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/Spatial-Filter-Help-Needed-tp1134329p1134384.html
Sent from the FDO Users mailing list archive at Nabble.com.



More information about the fdo-users mailing list