1191 CU_ASSERT_DOUBLE_EQUAL(d, s.
radius * M_PI / 180.0, 0.00001);
1199 CU_ASSERT_DOUBLE_EQUAL(d, 0.0, 0.00001);
1207 CU_ASSERT_DOUBLE_EQUAL(d, s.
radius * M_PI / 180.0, 0.00001);
1214 CU_ASSERT_DOUBLE_EQUAL(d, s.
radius * M_PI / 90.0, 0.00001);
1222 CU_ASSERT_DOUBLE_EQUAL(d, 0.0, 0.00001);
1227 lwg1 =
lwgeom_from_wkt(
"POLYGON((-4 -4, -4 4, 4 4, 4 -4, -4 -4), (-2 -2, -2 2, 2 2, 2 -2, -2 -2))",
LW_PARSER_CHECK_NONE);
1230 CU_ASSERT_DOUBLE_EQUAL(d, 111178.142466, 0.1);
1235 lwg1 =
lwgeom_from_wkt(
"POLYGON((-4 -4, -4 4, 4 4, 4 -4, -4 -4), (-2 -2, -2 2, 2 2, 2 -2, -2 -2))",
LW_PARSER_CHECK_NONE);
1238 CU_ASSERT_DOUBLE_EQUAL(d, 0.0, 0.00001);
1244 lwg2 =
lwgeom_from_hexwkb(
"0106000020E61000000100000001030000000100000007000000280EC3FB8CCA5EC0A5CDC747233C45402787C8F58CCA5EC0659EA2761E3C45400CED58DF8FCA5EC0C37FAE6E1E3C4540AE97B8E08FCA5EC00346F58B1F3C4540250359FD8ECA5EC05460628E1F3C45403738F4018FCA5EC05DC84042233C4540280EC3FB8CCA5EC0A5CDC747233C4540",
LW_PARSER_CHECK_NONE);
1246 CU_ASSERT_DOUBLE_EQUAL(d, 23630.8003, 0.1);
1254 CU_ASSERT_DOUBLE_EQUAL(d, 0.0, 0.00001);
1260 lwg2 =
lwgeom_from_wkt(
"POLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,7 5,7 7,5 7,5 5))",
LW_PARSER_CHECK_NONE);
1262 CU_ASSERT_DOUBLE_EQUAL(d, 0.0, 0.00001);
1268 lwg2 =
lwgeom_from_wkt(
"POLYGON M ((0 0 2,10 0 1,10 10 -2,0 10 -5,0 0 -5),(5 5 6,7 5 6,7 7 6,5 7 10,5 5 -2))",
LW_PARSER_CHECK_NONE);
1270 CU_ASSERT_DOUBLE_EQUAL(d, 0.0, 0.00001);
void spheroid_init(SPHEROID *s, double a, double b)
Initialize a spheroid object for use in geodetic functions.
void lwgeom_free(LWGEOM *geom)
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
#define LW_PARSER_CHECK_NONE
LWGEOM * lwgeom_from_hexwkb(const char *hexwkb, const char check)
double lwgeom_distance_spheroid(const LWGEOM *lwgeom1, const LWGEOM *lwgeom2, const SPHEROID *spheroid, double tolerance)
Calculate the geodetic distance from lwgeom1 to lwgeom2 on the spheroid.