[fdo-users] RE: WFS FDO Spatial Filtering

rogerG roger at ggpsystems.co.uk
Fri Jul 30 21:01:41 EDT 2010


Hi Greg,
I use FdoISelect::SetFilter2.

The client side code is actually in pascal (delphi)
and slightly simplified here as theres some wrapping code to use C++ classes
in Delphi,
and code from different routines is bought together here:

  FSelect := FConnection.CreateCommand(FdoCommandType_Select);
  FSelect.SetFeatureClassNameStr(PWideChar(FFDOFeatureClassName));
// TOPOArea mask
  lMaskGeom := TGISGeometryFactory.create_from_WKT(nil,
      'POLYGON ((495566.0 324296.5, 577840.0 324296.5, 577840.0 230844.25,
495566.0 230844.25, 495566.0 324296.5)));
lFilterExpression :=
TFDOFilterHelper.CreateSpatialFilterExpression(lMaskGeom,Fdo_soIntersects);

    FSelect.SetFilter2(PWideChar(lFilterExpression));
lReader := FSelect.Execute()

 -- here lFilterExpression gets the value in the previous post

Here's a simpler still C++ equivalent if you're unfamiliar with Delphi

 FSelect = FConnection->CreateCommand(FdoCommandType_Select);
 FSelect->SetFeatureClassNameStr(L"MyFeatureClass");
 FSelect->SetFilter2(L"Geom INTERSECTS GeomFromText('POLYGON ((495566.0
324296.5, 577840.0 324296.5, 577840.0 230844.25, 495566.0 230844.25,
495566.0 324296.5))')");
 FReader = FSelect->Execute();

It is occurring to me as I write that Geom is not a generic keyword after
all, but the name of the geometry field is that my mistake?

-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/WFS-FDO-Spatial-Filtering-tp5355815p5357107.html
Sent from the FDO Users mailing list archive at Nabble.com.


More information about the fdo-users mailing list