]> granicus.if.org Git - postgis/commitdiff
Remove more orphaned box2d support functions
authorPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 26 Oct 2011 22:58:21 +0000 (22:58 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 26 Oct 2011 22:58:21 +0000 (22:58 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8007 b70326c6-7e19-0410-871a-916f4a2858ee

doc/rfc/postgis_rfc_03_sheet.txt
liblwgeom/box2d.c
liblwgeom/liblwgeom.h.in
liblwgeom/lwgeom_api.c

index 54df413ef2e4cbc7146ad584c4ce647625bd74ee..9a4609c76547481b17feb1c1781839c1ad0c1a22 100644 (file)
@@ -75,8 +75,6 @@ FUNCTION      "box2d_contained(box2d, box2d)" PRIVATE KEEP
 FUNCTION       "ST_box2d_contained(box2d, box2d)"      PRIVATE DELETE
 FUNCTION       "box2d_overlap(box2d, box2d)"   PRIVATE KEEP
 FUNCTION       "ST_box2d_overlap(box2d, box2d)"        PRIVATE DELETE
-FUNCTION       "box2d_same(box2d, box2d)"      PRIVATE KEEP
-FUNCTION       "ST_box2d_same(box2d, box2d)"   PRIVATE DELETE
 FUNCTION       "box2d_intersects(box2d, box2d)"        PRIVATE KEEP
 FUNCTION       "ST_box2d_intersects(box2d, box2d)"     PRIVATE DELETE
 FUNCTION       "geometry_lt(geometry, geometry)"       PRIVATE KEEP
index b230dd75b8405123e7e35e7bb8c25002d2627a8b..133da92bcb5bd876a90431b224db93488d730a08 100644 (file)
@@ -25,25 +25,6 @@ expand_box2d(BOX2DFLOAT4 *box, double d)
 }
 
 
-/*
- * This has been changed in PostGIS 1.1.2 to
- * check exact equality of values (rather then using
- * the FPeq macro taking into account coordinate drifts).
- */
-char
-box2d_same(BOX2DFLOAT4 *box1, BOX2DFLOAT4 *box2)
-{
-       return( (box1->xmax==box2->xmax) &&
-               (box1->xmin==box2->xmin) &&
-               (box1->ymax==box2->ymax) &&
-               (box1->ymin==box2->ymin));
-#if 0
-       return(FPeq(box1->xmax, box2->xmax) &&
-              FPeq(box1->xmin, box2->xmin) &&
-              FPeq(box1->ymax, box2->ymax) &&
-              FPeq(box1->ymin, box2->ymin));
-#endif
-}
 
 BOX2DFLOAT4 *
 box2d_clone(const BOX2DFLOAT4 *in)
index 80c1357f9c42d0f7070ba3f6fe3a9b9393eeb4e7..3bca34caf86bccfbc12357db48e4c6203870f1c0 100644 (file)
@@ -1284,28 +1284,10 @@ extern int box3d_union_p(BOX3D *b1, BOX3D *b2, BOX3D *ubox);
 extern BOX3D* box3d_from_gbox(const GBOX *gbox);
 extern GBOX* box3d_to_gbox(const BOX3D *b3d);
 
-/*
- * Returns a pointer to the BBOX internal to the serialized form.
- * READ-ONLY!
- * Or NULL if serialized form does not have a BBOX
- * OBSOLETED to avoid memory alignment problems.
- */
-/*extern BOX2DFLOAT4 *getbox2d_internal(uint8_t *serialized_form);*/
-
-/*
- * this function writes to 'box' and returns 0 if serialized_form
- * does not have a bounding box (empty geom)
- */
-extern int getbox2d_p(uint8_t *serialized_form, BOX2DFLOAT4 *box);
-
 /* Expand given box of 'd' units in all directions */
 void expand_box2d(BOX2DFLOAT4 *box, double d);
 void expand_box3d(BOX3D *box, double d);
 
-/* Check if to boxes are equal (considering FLOAT approximations) */
-char box2d_same(BOX2DFLOAT4 *box1, BOX2DFLOAT4 *box2);
-
-
 
 /****************************************************************
  * MEMORY MANAGEMENT
@@ -1457,12 +1439,6 @@ extern void lwtriangle_force_clockwise(LWTRIANGLE *triangle);
 
 extern void interpolate_point4d(POINT4D *A, POINT4D *B, POINT4D *I, double F);
 
-/* return alloced memory */
-extern BOX2DFLOAT4 *box2d_union(BOX2DFLOAT4 *b1, BOX2DFLOAT4 *b2);
-
-/* args may overlap ! */
-extern int box2d_union_p(BOX2DFLOAT4 *b1, BOX2DFLOAT4 *b2, BOX2DFLOAT4 *ubox);
-
 void lwgeom_longitude_shift(LWGEOM *lwgeom);
 
 
index ca1f7dbdf966f345caad3570e73c83eef9b528e0..a2ba191756fd56669c7fe1849c059beb56aba9c4 100644 (file)
@@ -408,42 +408,6 @@ box3d_union_p(BOX3D *b1, BOX3D *b2, BOX3D *ubox)
 }
 
 
-/*
- * Same as getbox2d, but modifies box instead of returning result on the stack
- */
-int
-getbox2d_p(uint8_t *srl, BOX2DFLOAT4 *box)
-{
-       uint8_t type = srl[0];
-       uint8_t *loc;
-       BOX3D box3d;
-
-       LWDEBUGF(2, "getbox2d_p call on type %d -> %d", type, TYPE_GETTYPE(type));
-
-       loc = srl+1;
-
-       if (lwgeom_hasBBOX(type))
-       {
-               /*woot - this is easy */
-               LWDEBUG(4, "getbox2d_p: has box");
-               memcpy(box, loc, sizeof(BOX2DFLOAT4));
-               return LW_TRUE;
-       }
-
-       LWDEBUG(4, "getbox2d_p: has no box - computing");
-
-       /* We have to actually compute it! */
-       if ( ! compute_serialized_box3d_p(srl, &box3d)) return LW_FALSE;
-
-       LWDEBUGF(4, "getbox2d_p: compute_serialized_box3d returned %p", box3d);
-
-       if ( ! box3d_to_box2df_p(&box3d, box) ) return LW_FALSE;
-
-
-       LWDEBUG(4, "getbox2d_p: box3d converted to box2d");
-
-       return LW_TRUE;
-}
 
 /************************************************************************
  * POINTARRAY support functions
@@ -1889,88 +1853,6 @@ ptarray_isccw(const POINTARRAY *pa)
        else return 1;
 }
 
-/**
- * Returns a BOX2DFLOAT4 that encloses b1 and b2
- *
- * box2d_union(NULL,A) --> A
- * box2d_union(A,NULL) --> A
- * box2d_union(A,B) --> A union B
- */
-BOX2DFLOAT4 *
-box2d_union(BOX2DFLOAT4 *b1, BOX2DFLOAT4 *b2)
-{
-       BOX2DFLOAT4 *result;
-
-       if ( (b1 == NULL) && (b2 == NULL) )
-       {
-               return NULL;
-       }
-
-       result = lwalloc(sizeof(BOX2DFLOAT4));
-
-       if  (b1 == NULL)
-       {
-               memcpy(result, b2, sizeof(BOX2DFLOAT4));
-               return result;
-       }
-       if (b2 == NULL)
-       {
-               memcpy(result, b1, sizeof(BOX2DFLOAT4));
-               return result;
-       }
-
-       if (b1->xmin < b2->xmin) result->xmin = b1->xmin;
-       else result->xmin = b2->xmin;
-
-       if (b1->ymin < b2->ymin) result->ymin = b1->ymin;
-       else result->ymin = b2->ymin;
-
-       if (b1->xmax > b2->xmax) result->xmax = b1->xmax;
-       else result->xmax = b2->xmax;
-
-       if (b1->ymax > b2->ymax) result->ymax = b1->ymax;
-       else result->ymax = b2->ymax;
-
-       return result;
-}
-
-/**
- * ubox may be one of the two args...
- * return 1 if done something to ubox, 0 otherwise.
- */
-int
-box2d_union_p(BOX2DFLOAT4 *b1, BOX2DFLOAT4 *b2, BOX2DFLOAT4 *ubox)
-{
-       if ( (b1 == NULL) && (b2 == NULL) )
-       {
-               return 0;
-       }
-
-       if  (b1 == NULL)
-       {
-               memcpy(ubox, b2, sizeof(BOX2DFLOAT4));
-               return 1;
-       }
-       if (b2 == NULL)
-       {
-               memcpy(ubox, b1, sizeof(BOX2DFLOAT4));
-               return 1;
-       }
-
-       if (b1->xmin < b2->xmin) ubox->xmin = b1->xmin;
-       else ubox->xmin = b2->xmin;
-
-       if (b1->ymin < b2->ymin) ubox->ymin = b1->ymin;
-       else ubox->ymin = b2->ymin;
-
-       if (b1->xmax > b2->xmax) ubox->xmax = b1->xmax;
-       else ubox->xmax = b2->xmax;
-
-       if (b1->ymax > b2->ymax) ubox->ymax = b1->ymax;
-       else ubox->ymax = b2->ymax;
-
-       return 1;
-}
 
 const char *
 lwgeom_typeflags(uint8_t flags)