lwgeom_free(g);
/* LINESTRING(0 0, 0 Inf) = 00 00000002 00000002 0000000000000000 7FF0000000000000 0000000000000000 0000000000000000 */
+ /* Inf should show up in bbox */
g = lwgeom_from_hexwkb("00000000020000000200000000000000007FF000000000000000000000000000000000000000000000", LW_PARSER_CHECK_NONE);
lwgeom_calculate_gbox_cartesian(g, &b);
CU_ASSERT_DOUBLE_EQUAL(b.xmin, 0.0, 0.0000001);
lwgeom_free(g);
/* Geometry with NaN 0101000020E8640000000000000000F8FF000000000000F8FF */
+ /* NaN should show up in bbox */
g = lwgeom_from_hexwkb("0101000020E8640000000000000000F8FF000000000000F8FF", LW_PARSER_CHECK_NONE);
lwgeom_calculate_gbox_cartesian(g, &b);
CU_ASSERT(isnan(b.ymax));
LWDEBUGF(4, "Point: %g,%g,%g", p.x, p.y, p.z);
- /* Make sure we don't pass any infinite values down into GEOS */
- /* GEOS 3.3+ is supposed to handle this stuff OK */
#if POSTGIS_GEOS_VERSION < 33
- if ( isinf(p.x) || isinf(p.y) || (dims == 3 && isinf(p.z)) )
- lwerror("Infinite coordinate value found in geometry.");
+ /* Make sure we don't pass any infinite values down into GEOS */
+ /* GEOS 3.3+ is supposed to handle this stuff OK */
+ if ( isinf(p.x) || isinf(p.y) || (dims == 3 && isinf(p.z)) )
+ lwerror("Infinite coordinate value found in geometry.");
+ if ( isnan(p.x) || isnan(p.y) || (dims == 3 && isnan(p.z)) )
+ lwerror("NaN coordinate value found in geometry.");
#endif
GEOSCoordSeq_setX(sq, i, p.x);
bool result;
GEOSGeom g1;
#if POSTGIS_GEOS_VERSION < 33
- GBOX box1;
+ GBOX box1;
#endif
geom1 = (GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
PG_RETURN_BOOL(true);
#if POSTGIS_GEOS_VERSION < 33
- /* Short circuit and return FALSE if we have infinite coordinates */
- /* GEOS 3.3+ is supposed to handle this stuff OK */
+ /* Short circuit and return FALSE if we have infinite coordinates */
+ /* GEOS 3.3+ is supposed to handle this stuff OK */
if ( gserialized_get_gbox_p(geom1, &box1) )
{
if ( isinf(box1.xmax) || isinf(box1.ymax) || isinf(box1.xmin) || isinf(box1.ymin) ||
isnan(box1.xmax) || isnan(box1.ymax) || isnan(box1.xmin) || isnan(box1.ymin) )
{
- lwnotice("Geometry contains an Inf or NaN coordinate");
+ lwnotice("Geometry contains an Inf or NaN coordinate");
PG_RETURN_BOOL(FALSE);
}
}