Calculate a spherical point that falls outside the geocentric gbox.
Calculate a spherical point that falls outside the geocentric gbox.
Definition at line 1552 of file lwgeodetic.c.
1554 double grow = M_PI / 180.0 / 60.0;
1561 while ( grow < M_PI )
1565 if ( ge.
xmin > -1 ) ge.
xmin -= grow;
1566 if ( ge.
ymin > -1 ) ge.
ymin -= grow;
1567 if ( ge.
zmin > -1 ) ge.
zmin -= grow;
1568 if ( ge.
xmax < 1 ) ge.
xmax += grow;
1569 if ( ge.
ymax < 1 ) ge.
ymax += grow;
1570 if ( ge.
zmax < 1 ) ge.
zmax += grow;
1573 corners[0].
x = ge.
xmin;
1574 corners[0].
y = ge.
ymin;
1575 corners[0].
z = ge.
zmin;
1577 corners[1].
x = ge.
xmin;
1578 corners[1].
y = ge.
ymax;
1579 corners[1].
z = ge.
zmin;
1581 corners[2].
x = ge.
xmin;
1582 corners[2].
y = ge.
ymin;
1583 corners[2].
z = ge.
zmax;
1585 corners[3].
x = ge.
xmax;
1586 corners[3].
y = ge.
ymin;
1587 corners[3].
z = ge.
zmin;
1589 corners[4].
x = ge.
xmax;
1590 corners[4].
y = ge.
ymax;
1591 corners[4].
z = ge.
zmin;
1593 corners[5].
x = ge.
xmax;
1594 corners[5].
y = ge.
ymin;
1595 corners[5].
z = ge.
zmax;
1597 corners[6].
x = ge.
xmin;
1598 corners[6].
y = ge.
ymax;
1599 corners[6].
z = ge.
zmax;
1601 corners[7].
x = ge.
xmax;
1602 corners[7].
y = ge.
ymax;
1603 corners[7].
z = ge.
zmax;
1605 LWDEBUG(4,
"trying to use a box corner point...");
1606 for ( i = 0; i < 8; i++ )
1609 LWDEBUGF(4,
"testing corner %d: POINT(%.8g %.8g %.8g)", i, corners[i].
x, corners[i].
y, corners[i].z);
1612 LWDEBUGF(4,
"corner %d is outside our gbox", i);
1618 LWDEBUGF(4,
"returning POINT(%.8g %.8g) as outside point", pt_outside->
x, pt_outside->
y);
int gbox_contains_point3d(const GBOX *gbox, const POINT3D *pt)
Return true if the point is inside the gbox.
void normalize(POINT3D *p)
Normalize to a unit vector.
void cart2geog(const POINT3D *p, GEOGRAPHIC_POINT *g)
Convert cartesian coordinates on unit sphere to spherical coordinates.
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
Point in spherical coordinates on the world.
References cart2geog(), gbox_contains_point3d(), GEOGRAPHIC_POINT::lat, GEOGRAPHIC_POINT::lon, LW_FAILURE, LW_SUCCESS, LWDEBUG, LWDEBUGF, normalize(), rad2deg, POINT2D::x, POINT3D::x, pixval::x, GBOX::xmax, GBOX::xmin, POINT2D::y, POINT3D::y, pixval::y, GBOX::ymax, GBOX::ymin, POINT3D::z, GBOX::zmax, and GBOX::zmin.
Referenced by CircTreePIP(), geography_point_outside(), lwpoly_pt_outside(), and test_tree_circ_pip2().