]> granicus.if.org Git - postgis/commitdiff
Remove warnings from liblwgeom
authorSandro Santilli <strk@keybit.net>
Mon, 3 Jun 2013 08:26:51 +0000 (08:26 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 3 Jun 2013 08:26:51 +0000 (08:26 +0000)
These are mostly unused variables

git-svn-id: http://svn.osgeo.org/postgis/trunk@11511 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwgeodetic.c
liblwgeom/lwgeodetic_tree.c
liblwgeom/lwout_geojson.c
liblwgeom/lwout_x3d.c

index c92d8ecc39b54bbb9f3827783ff73b82eb82510b..dcbabeca77ff1e77a76b8af4897fdc6bb931fe5c 100644 (file)
@@ -947,6 +947,7 @@ double sphere_direction(const GEOGRAPHIC_POINT *s, const GEOGRAPHIC_POINT *e, do
        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
@@ -970,6 +971,7 @@ static double sphere_excess(const GEOGRAPHIC_POINT *a, const GEOGRAPHIC_POINT *b
        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
 
 
 /**
@@ -3167,7 +3169,7 @@ int ptarray_contains_point_sphere(const POINTARRAY *pa, const POINT2D *pt_outsid
 {
        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! */
@@ -3181,7 +3183,6 @@ int ptarray_contains_point_sphere(const POINTARRAY *pa, const POINT2D *pt_outsid
        /* 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++ )
@@ -3239,7 +3240,6 @@ int ptarray_contains_point_sphere(const POINTARRAY *pa, const POINT2D *pt_outsid
                
                /* Increment to next edge */
                E1 = E2;
-               q = p;
        }
 
        LWDEBUGF(4,"final count == %d", count);
index 02f00028842974dfd7936e439c477e50e06a61df..1ab59606de63672a71bc114f4aa2e6d4f27fa3ab 100644 (file)
@@ -498,10 +498,10 @@ circ_tree_distance_tree(const CIRC_NODE* n1, const CIRC_NODE* n2, const SPHEROID
        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;
index f7ec7e49cfdb3b16b1f375f32ddde7159798ab79..034b067e0da67991d638986cb131dd0cf3878afe 100644 (file)
@@ -37,7 +37,6 @@ lwgeom_to_geojson(const LWGEOM *geom, char *srs, int precision, int has_bbox)
        int type = geom->type;
        GBOX *bbox = NULL;
        GBOX tmp;
-       int rv;
 
        if ( precision > OUT_MAX_DOUBLE_PRECISION ) precision = OUT_MAX_DOUBLE_PRECISION;
 
@@ -45,7 +44,7 @@ lwgeom_to_geojson(const LWGEOM *geom, char *srs, int precision, int has_bbox)
        {
                /* 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;
        }               
 
index a1a9c4a34a8bd6ecb57ce57eadabbf4b022a97d5..12c262defb5952f5a629b0d226355aa582469a51 100644 (file)
@@ -312,10 +312,7 @@ asx3d3_poly_buf(const LWPOLY *poly, char *srs, char *output, int precision, int
 {
        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++)
        {