Modify

Ticket #12413 (closed Bugs: fixed)

Opened 7 months ago

Last modified 4 months ago

boost::geometry::index::rtree.remove() with Geographic coordinate system can fail

Reported by: andydev2k2k@… Owned by: barendgehrels
Milestone: Boost 1.63.0 Component: geometry
Version: Boost 1.61.0 Severity: Showstopper
Keywords: Cc:

Description

example code:

#include <boost\config\compiler\visualc.hpp>
#include <boost/geometry/index/rtree.hpp>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/geometries.hpp>
namespace bgi = boost::geometry::index;

namespace bg = boost::geometry;

typedef bg::model::point<double, 2, bg::cs::geographic<bg::degree> > Geo2DPoint;
typedef std::pair< Geo2DPoint, unsigned > RTreeValue;
typedef bgi::rtree<RTreeValue, bgi::quadratic<5> > rtree_t;
typedef boost::geometry::model::box< Geo2DPoint > GeoBox;

int main()
{
	rtree_t rtree;
	Geo2DPoint p;

	p.set<0>( -1.558444 );
	p.set<1>( 52.38664 );
	rtree.insert( std::make_pair( p, 792) );

	p.set<0>( -1.558444 );
	p.set<1>( 52.38664 );
	rtree.insert( std::make_pair( p, 793 ) );


	p.set<0>( -2.088824 );
	p.set<1>( 51.907406 );
	rtree.insert( std::make_pair( p, 800 ) );

	p.set<0>( -1.576363 );
	p.set<1>( 53.784089 );
	rtree.insert( std::make_pair( p, 799 ) );

	p.set<0>( -77.038816 );
	p.set<1>( 38.897282 );
	rtree.insert( std::make_pair( p, 801 ) );

	p.set<0>( -1.558444 );
	p.set<1>( 52.38664 );
	rtree.insert( std::make_pair( p, 794 ) );

	p.set<0>( -0.141588 );
	p.set<1>( 51.501009 );
	rtree.insert( std::make_pair( p, 797 ) );

	p.set<0>( -118.410468 );
	p.set<1>( 34.103003 );
	rtree.insert( std::make_pair( p, 798 ) );

	p.set<0>( -0.127592 );
	p.set<1>( 51.503407 );
	rtree.insert( std::make_pair( p, 796 ) );

	size_t num_removed = rtree.remove( std::make_pair( p, 796 ) ); // Here, num_removed should be 1 but it is 0

	return 0;
}

as the comment says, num_removed should be 1 but it is 0

Attachments

Change History

comment:1 Changed 7 months ago by anonymous

  • Owner set to barendgehrels
  • Component changed from None to geometry

comment:2 Changed 7 months ago by awulkiew

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from To Be Determined to Boost 1.62.0

comment:3 Changed 4 months ago by awulkiew

  • Milestone changed from Boost 1.62.0 to Boost 1.63.0
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.