return heading;
}
+#if 0 /* unused */
/**
* Computes the spherical excess of a spherical triangle defined by
* the three vectices A, B, C. Computes on the unit sphere (i.e., divides
double E = tan(ss/2.0)*tan((ss-a_dist)/2.0)*tan((ss-b_dist)/2.0)*tan((ss-c_dist)/2.0);
return 4.0 * atan(sqrt(fabs(E))) * sign;
}
+#endif
/**
{
POINT3D S1, S2; /* Stab line end points */
POINT3D E1, E2; /* Edge end points (3-space) */
- POINT2D p, q; /* Edge end points (lon/lat) */
+ POINT2D p; /* Edge end points (lon/lat) */
int count = 0, i, inter;
/* Null input, not enough points for a ring? You ain't closed! */
/* Initialize first point */
getPoint2d_p(pa, 0, &p);
ll2cart(&p, &E1);
- q = p;
/* Walk every edge and see if the stab line hits it */
for ( i = 1; i < pa->npoints; i++ )
/* Increment to next edge */
E1 = E2;
- q = p;
}
LWDEBUGF(4,"final count == %d", count);
double min_dist = MAXFLOAT;
double max_dist = MAXFLOAT;
GEOGRAPHIC_POINT closest1, closest2;
- double distance1, distance2;
+ double distance2;
double threshold_radians = threshold / spheroid->radius;
- distance1 = circ_tree_distance_tree_internal(n1, n2, threshold_radians, &min_dist, &max_dist, &closest1, &closest2);
+ circ_tree_distance_tree_internal(n1, n2, threshold_radians, &min_dist, &max_dist, &closest1, &closest2);
distance2 = spheroid_distance(&closest1, &closest2, spheroid);
return distance2;
int type = geom->type;
GBOX *bbox = NULL;
GBOX tmp;
- int rv;
if ( precision > OUT_MAX_DOUBLE_PRECISION ) precision = OUT_MAX_DOUBLE_PRECISION;
{
/* Whether these are geography or geometry,
the GeoJSON expects a cartesian bounding box */
- rv = lwgeom_calculate_gbox_cartesian(geom, &tmp);
+ lwgeom_calculate_gbox_cartesian(geom, &tmp);
bbox = &tmp;
}
{
int i;
char *ptr=output;
- int dimension=2;
- if (FLAGS_GET_Z(poly->flags))
- dimension = 3;
ptr += pointArray_toX3D3(poly->rings[0], ptr, precision, opts, 1);
for (i=1; i<poly->nrings; i++)
{