PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ test_geohash_bbox()

static void test_geohash_bbox ( void  )
static

Definition at line 1042 of file cu_algorithm.c.

1043 {
1044  double lat[2], lon[2];
1045 
1046  /* SELECT ST_GeoHash(ST_SetSRID(ST_MakePoint(-126,48),4326)) */
1047  decode_geohash_bbox("c0w3hf1s70w3hf1s70w3", lat, lon, 100);
1048  CU_ASSERT_DOUBLE_EQUAL(lat[0], 48, 1e-11);
1049  CU_ASSERT_DOUBLE_EQUAL(lat[1], 48, 1e-11);
1050  CU_ASSERT_DOUBLE_EQUAL(lon[0], -126, 1e-11);
1051  CU_ASSERT_DOUBLE_EQUAL(lon[1], -126, 1e-11);
1052 
1054  decode_geohash_bbox("@@@@@@", lat, lon, 100);
1055  ASSERT_STRING_EQUAL(cu_error_msg, "decode_geohash_bbox: Invalid character '@'");
1056 }
void cu_error_msg_reset()
char cu_error_msg[MAX_CUNIT_ERROR_LENGTH+1]
#define ASSERT_STRING_EQUAL(o, e)
void decode_geohash_bbox(char *geohash, double *lat, double *lon, int precision)
Definition: lwalgorithm.c:714

References ASSERT_STRING_EQUAL, cu_error_msg, cu_error_msg_reset(), and decode_geohash_bbox().

Referenced by algorithms_suite_setup().

Here is the call graph for this function:
Here is the caller graph for this function: