Exemple #1
0
bool 
PreparedPoint::intersects(const geom::Geometry* g)
{
	if (! envelopesIntersect( g)) return false;

	// This avoids computing topology for the test geometry
	return isAnyTargetComponentInTest( g);
}
bool 
PreparedLineString::intersects(const geom::Geometry * g) const
{
	if (! envelopesIntersect(g))
    {
        return false;
    }
    
    PreparedLineString& prep = *(const_cast<PreparedLineString*>(this));
    
    return PreparedLineStringIntersects::intersects(prep, g);
}
Exemple #3
0
bool 
PreparedPoint::intersects(const geom::Geometry* g) const
{
	if (! envelopesIntersect( g)) return false;

	const Point *pt_geom = dynamic_cast<const Point *>(g);
	if (pt_geom) 
        return getGeometry().equals(g);

	// This avoids computing topology for the test geometry
	return isAnyTargetComponentInTest( g);
}
Exemple #4
0
bool 
PreparedPolygon::
intersects( const geom::Geometry* g) const
{
  	// envelope test
  	if ( !envelopesIntersect( g) ) 
		return false;
  	
    // optimization for rectangles
    if ( isRectangle )
    {
        geom::Geometry const& geom = getGeometry();
        geom::Polygon const& poly = dynamic_cast<geom::Polygon const&>(geom);
        
        return operation::predicate::RectangleIntersects::intersects(poly, *g);
    }
    
	return PreparedPolygonIntersects::intersects( this, g);
}