[fdo-trac] #662: Bug in FdoFilter::ToString

FDO trac_fdo at osgeo.org
Wed Jul 14 05:45:54 EDT 2010


#662: Bug in FdoFilter::ToString
-----------------------+----------------------------------------------------
   Reporter:  ijarm    |       Owner:  gregboone                                      
       Type:  defect   |      Status:  new                                            
   Priority:  minor    |   Milestone:  3.5.0                                          
  Component:  FDO API  |     Version:  3.4.0                                          
   Severity:  1        |    Keywords:  FDO FdoFilter ToString Parse parsing bug defect
External_id:           |  
-----------------------+----------------------------------------------------
 An FdoFilter representing NOT(a AND b) returns L"NOT a AND b" when its
 ToString is called.

 This code:
 {{{
 FdoFilter *NOTaANDb;//NOT(a AND b)
 FdoFilter *newFlt = FdoFilter::Parse(NOTaANDb->ToString());
 }}}
 makes newFlt that is not equal to the original.

 I tested this in FDO 3.4 but as far as I could see parsing code in FDO 3.5
 hasn't changed at all.

 The following is a sample code used to produce the error:
 {{{
 //a
   FdoPtr<FdoFilter> flt1 = FdoFilter::Parse(L"Geometry INTERSECTS
 GeomFromText('POLYGON ((461848 100030, 462399 100892, 463039 100544,
 462697 99882, 462545 99926, 462652 100525, 462539 100612, 462075 99911,
 461848 100030))')");

 //b
   FdoPtr<FdoFilter> flt2 = FdoFilter::Parse(L"POVRSINA < 200");

 //a AND b
   FdoPtr<FdoFilter> fltand = FdoFilter::Combine(flt1,
 FdoBinaryLogicalOperations_And, flt2);

 //NOT(a AND b)
   FdoPtr<FdoFilter> fltnot = FdoUnaryLogicalOperator::Create(fltand,
 FdoUnaryLogicalOperations_Not);

 //the same filter can be parsed directly from string
 //  fltnot = FdoFilter::Parse(L"NOT(Geometry INTERSECTS
 GeomFromText('POLYGON ((461848 100030, 462399 100892, 463039 100544,
 462697 99882, 462545 99926, 462652 100525, 462539 100612, 462075 99911,
 461848 100030))') AND POVRSINA < 200)");

 //WRONG: filterStr equals L"NOT Geometry INTERSECTS GeomFromText('POLYGON
 ((461848 100030, 462399 100892, 463039 100544, 462697 99882, 462545 99926,
 462652 100525, 462539 100612, 462075 99911, 461848 100030))') AND POVRSINA
 < 200"
 //SHOULD BE: L"NOT ( Geometry INTERSECTS GeomFromText('POLYGON ((461848
 100030, 462399 100892, 463039 100544, 462697 99882, 462545 99926, 462652
 100525, 462539 100612, 462075 99911, 461848 100030))') AND POVRSINA < 200
 )"
   FdoString *filterStr = fltnot->ToString();
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/fdo/ticket/662>
FDO <http://fdo.osgeo.org/>
Feature Data Objects


More information about the fdo-trac mailing list