]> granicus.if.org Git - postgis/commitdiff
Commit for GBT#97: Rename LWCURVE to LWCIRCSTRING (also know as restoring balance...
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Tue, 13 Jan 2009 12:27:39 +0000 (12:27 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Tue, 13 Jan 2009 12:27:39 +0000 (12:27 +0000)
Having gone through and re-read sections of the CIRCULARSTRING code, it is amazing how much easier the code is to read without the confusion of a curve being either a CIRCULARSTRING or LINESTRING as per the SQL-MM spec. The resulting commit compiles & installs cleanly for me, passes "make check" and also Regina's torture script. Please let me know if I accidentally broke anything :)

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

16 files changed:
liblwgeom/Makefile.in
liblwgeom/liblwgeom.h
liblwgeom/lwcircstring.c [moved from liblwgeom/lwcurve.c with 75% similarity]
liblwgeom/lwcollection.c
liblwgeom/lwcompound.c
liblwgeom/lwcurvepoly.c
liblwgeom/lwgeom.c
liblwgeom/lwgeom_api.c
liblwgeom/lwgparse.c
liblwgeom/lwgunparse.c
liblwgeom/lwmcurve.c
liblwgeom/lwsegmentize.c
liblwgeom/wktparse.h
lwgeom/lwgeom_functions_basic.c
lwgeom/lwgeom_ogc.c
lwgeom/lwgeom_transform.c

index b52af99c88c9ed64aad94b5e00eb3c95436f5cb2..00dee32f186b3f75fdc0892845358cb5b84f0e29 100644 (file)
@@ -30,7 +30,7 @@ SA_OBJS = \
        lwmline.o \
        lwmpoly.o \
        lwcollection.o \
-       lwcurve.o \
+       lwcircstring.o \
        lwcompound.o \
        lwcurvepoly.o \
        lwmcurve.o \
index 4a266e145b294126f07cfe289a66ec8d06351e69..4256c8f1ddd89eb081123ecf739a33d9a844faae 100644 (file)
@@ -630,7 +630,7 @@ char is_worth_caching_lwgeom_bbox(const LWGEOM *);
 extern size_t lwgeom_size(const uchar *serialized_form);
 extern size_t lwgeom_size_subgeom(const uchar *serialized_form, int geom_number);
 extern size_t lwgeom_size_line(const uchar *serialized_line);
-extern size_t lwgeom_size_curve(const uchar *serialized_curve);
+extern size_t lwgeom_size_circstring(const uchar *serialized_curve);
 extern size_t lwgeom_size_point(const uchar *serialized_point);
 extern size_t lwgeom_size_poly(const uchar *serialized_line);
 
@@ -1274,14 +1274,14 @@ extern char getMachineEndian(void);
 
 void errorIfSRIDMismatch(int srid1, int srid2);
 
-/* CURVETYPE */
+/* CIRCSTRINGTYPE */
 typedef struct
 {
-        uchar type; /* CURVETYPE */
+        uchar type; /* CIRCSTRINGTYPE */
         BOX2DFLOAT4 *bbox;
         uint32 SRID;
         POINTARRAY *points; /* array of POINT(3D/3DM) */
-} LWCURVE; /* "light-weight arcline" */
+} LWCIRCSTRING; /* "light-weight circularstring" */
 
 /* COMPOUNDTYPE */
 typedef struct
@@ -1323,54 +1323,54 @@ typedef struct
         LWGEOM **geoms;
 } LWMSURFACE;
 
-#define CURVETYPE         8
+#define CIRCSTRINGTYPE    8
 #define COMPOUNDTYPE      9
 #define CURVEPOLYTYPE    13
 #define MULTICURVETYPE   14
 #define MULTISURFACETYPE 15
 
 /******************************************************************
- * LWCURVE functions
+ * LWCIRCSTRING functions
  ******************************************************************/
 
 /* Casts LWGEOM->LW* (return NULL if cast is illegal) */
-extern LWCURVE *lwgeom_as_lwcurve(LWGEOM *lwgeom);
+extern LWCIRCSTRING *lwgeom_as_lwcircstring(LWGEOM *lwgeom);
 
 
-LWCURVE *lwcurve_construct(int SRID, BOX2DFLOAT4 *bbox, POINTARRAY *points);
+LWCIRCSTRING *lwcircstring_construct(int SRID, BOX2DFLOAT4 *bbox, POINTARRAY *points);
 
 /*
  * given the LWGEOM serialized form (or a pointer into a muli* one)
- * construct a proper LWCURVE.
+ * construct a proper LWCIRCSTRING.
  * serialized_form should point to the 8bit type format (with type = 2)
  * See SERIALIZED_FORM doc
  */
-extern LWCURVE *lwcurve_deserialize(uchar *serialized_form);
+extern LWCIRCSTRING *lwcircstring_deserialize(uchar *serialized_form);
 
 /* find the size this curve would get when serialized */
-extern size_t lwcurve_serialize_size(LWCURVE *curve);
+extern size_t lwcircstring_serialize_size(LWCIRCSTRING *curve);
 
 /*
- * convert this curve into its serialize form
+ * convert this circularstring into its serialize form
  * result's first char will be the 8bit type.  See serialized form doc
  * copies data.
  */
-extern uchar *lwcurve_serialize(LWCURVE *curve);
+extern uchar *lwcircstring_serialize(LWCIRCSTRING *curve);
 
 /* same as above, writes to buf */
-extern void lwcurve_serialize_buf(LWCURVE *curve, uchar *buf, size_t *size);
+extern void lwcircstring_serialize_buf(LWCIRCSTRING *curve, uchar *buf, size_t *size);
 
 /*
  * find bounding box (standard one)  zmin=zmax=0 if 2d (might change to NaN)
  */
-extern BOX3D *lwcurve_compute_box3d(LWCURVE *curve);
+extern BOX3D *lwcircstring_compute_box3d(LWCIRCSTRING *curve);
 
-LWGEOM *lwcurve_add(const LWCURVE *to, uint32 where, const LWGEOM *what);
-extern int lwcurve_compute_box2d_p(LWCURVE *curve, BOX2DFLOAT4 *box);
-extern BOX3D *lwcurve_compute_box3d(LWCURVE *curve);
-LWCURVE *lwcurve_clone(const LWCURVE *curve);
-extern LWCURVE *lwgeom_getcurve_inspected(LWGEOM_INSPECTED *inspected, int geom_number);
-extern void lwfree_curve(LWCURVE  *curve);
+LWGEOM *lwcircstring_add(const LWCIRCSTRING *to, uint32 where, const LWGEOM *what);
+extern int lwcircstring_compute_box2d_p(LWCIRCSTRING *curve, BOX2DFLOAT4 *box);
+extern BOX3D *lwcircstring_compute_box3d(LWCIRCSTRING *curve);
+LWCIRCSTRING *lwcircstring_clone(const LWCIRCSTRING *curve);
+extern LWCIRCSTRING *lwgeom_getcircstring_inspected(LWGEOM_INSPECTED *inspected, int geom_number);
+extern void lwfree_circstring(LWCIRCSTRING  *curve);
 
 /******************************************************************
  * LWMULTIx and LWCOLLECTION functions
similarity index 75%
rename from liblwgeom/lwcurve.c
rename to liblwgeom/lwcircstring.c
index 38f9f7b8b70c60fd7620d6494917f124104d4ce9..9b294b40ca61bc718d2cafdda95b9ede1162235d 100644 (file)
@@ -10,7 +10,7 @@
  * 
  **********************************************************************/
 
-/* basic LWCURVE functions */
+/* basic LWCIRCSTRING functions */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include "liblwgeom.h"
 
 BOX3D *lwcircle_compute_box3d(POINT4D *p1, POINT4D *p2, POINT4D *p3);
-void printLWCURVE(LWCURVE *curve);
-void lwcurve_reverse(LWCURVE *curve);
-LWCURVE *lwcurve_segmentize2d(LWCURVE *curve, double dist);
-char lwcurve_same(const LWCURVE *me, const LWCURVE *you);
-LWCURVE *lwcurve_from_lwpointarray(int SRID, unsigned int npoints, LWPOINT **points);
-LWCURVE *lwcurve_from_lwmpoint(int SRID, LWMPOINT *mpoint);
-LWCURVE *lwcurve_addpoint(LWCURVE *curve, LWPOINT *point, unsigned int where);
-LWCURVE *lwcurve_removepoint(LWCURVE *curve, unsigned int index);
-void lwcurve_setPoint4d(LWCURVE *curve, unsigned int index, POINT4D *newpoint);
+void printLWCIRCSTRING(LWCIRCSTRING *curve);
+void lwcircstring_reverse(LWCIRCSTRING *curve);
+LWCIRCSTRING *lwcircstring_segmentize2d(LWCIRCSTRING *curve, double dist);
+char lwcircstring_same(const LWCIRCSTRING *me, const LWCIRCSTRING *you);
+LWCIRCSTRING *lwcircstring_from_lwpointarray(int SRID, unsigned int npoints, LWPOINT **points);
+LWCIRCSTRING *lwcircstring_from_lwmpoint(int SRID, LWMPOINT *mpoint);
+LWCIRCSTRING *lwcircstring_addpoint(LWCIRCSTRING *curve, LWPOINT *point, unsigned int where);
+LWCIRCSTRING *lwcircstring_removepoint(LWCIRCSTRING *curve, unsigned int index);
+void lwcircstring_setPoint4d(LWCIRCSTRING *curve, unsigned int index, POINT4D *newpoint);
 
 
 
@@ -36,13 +36,13 @@ void lwcurve_setPoint4d(LWCURVE *curve, unsigned int index, POINT4D *newpoint);
 #endif
 
 /*
- * Construct a new LWCURVE.  points will *NOT* be copied
+ * Construct a new LWCIRCSTRING.  points will *NOT* be copied
  * use SRID=-1 for unknown SRID (will have 8bit type's S = 0)
  */
-LWCURVE *
-lwcurve_construct(int SRID, BOX2DFLOAT4 *bbox, POINTARRAY *points)
+LWCIRCSTRING *
+lwcircstring_construct(int SRID, BOX2DFLOAT4 *bbox, POINTARRAY *points)
 {
-        LWCURVE *result;
+        LWCIRCSTRING *result;
         
        /*
          * The first arc requires three points.  Each additional
@@ -51,16 +51,16 @@ lwcurve_construct(int SRID, BOX2DFLOAT4 *bbox, POINTARRAY *points)
          */
         if(points->npoints % 2 != 1 || points->npoints < 3) 
         {
-                lwerror("lwcurve_construct: invalid point count %d", points->npoints);
+                lwerror("lwcircstring_construct: invalid point count %d", points->npoints);
                 return NULL;
         }
         
-        result = (LWCURVE*) lwalloc(sizeof(LWCURVE));
+        result = (LWCIRCSTRING*) lwalloc(sizeof(LWCIRCSTRING));
 
         result->type = lwgeom_makeType_full(
                 TYPE_HASZ(points->dims),
                 TYPE_HASM(points->dims),
-                (SRID!=-1), CURVETYPE, 0);
+                (SRID!=-1), CIRCSTRINGTYPE, 0);
         result->SRID = SRID;
         result->points = points;
         result->bbox = bbox;
@@ -70,34 +70,34 @@ lwcurve_construct(int SRID, BOX2DFLOAT4 *bbox, POINTARRAY *points)
 
 /*
  * given the LWGEOM serialized form (or a point into a multi* one)
- * construct a propert LWCURVE.
+ * construct a proper LWCIRCSTRING.
  * serialized_form should point to the 8bit type format (with type = 8)
  * See serialized form doc
  */
-LWCURVE *
-lwcurve_deserialize(uchar *serialized_form)
+LWCIRCSTRING *
+lwcircstring_deserialize(uchar *serialized_form)
 {
         uchar type;
-        LWCURVE *result;
+        LWCIRCSTRING *result;
         uchar *loc=NULL;
         uint32 npoints;
         POINTARRAY *pa;
 
         type = (uchar)serialized_form[0];
-        if(lwgeom_getType(type) != CURVETYPE)
+        if(lwgeom_getType(type) != CIRCSTRINGTYPE)
         {
-                lwerror("lwcurve_deserialize: attempt to deserialize a curve which is really a %s", lwgeom_typename(type));
+                lwerror("lwcircstring_deserialize: attempt to deserialize a circularstring which is really a %s", lwgeom_typename(type));
                 return NULL;
         }
 
-        result = (LWCURVE*) lwalloc(sizeof(LWCURVE));
+        result = (LWCIRCSTRING*) lwalloc(sizeof(LWCIRCSTRING));
         result->type = type;
 
         loc = serialized_form + 1;
 
         if(lwgeom_hasBBOX(type))
         {
-                LWDEBUG(3, "lwcurve_deserialize: input has bbox");
+                LWDEBUG(3, "lwcircstring_deserialize: input has bbox");
 
                 result->bbox = lwalloc(sizeof(BOX2DFLOAT4));
                 memcpy(result->bbox, loc, sizeof(BOX2DFLOAT4));
@@ -105,21 +105,21 @@ lwcurve_deserialize(uchar *serialized_form)
          }
          else
          {
-                LWDEBUG(3, "lwcurve_deserialize: input lacks bbox");           
+                LWDEBUG(3, "lwcircstring_deserialize: input lacks bbox");           
                
                 result->bbox = NULL;
          }
 
          if(lwgeom_hasSRID(type))
          {
-                LWDEBUG(3, "lwcurve_deserialize: input has srid");
+                LWDEBUG(3, "lwcircstring_deserialize: input has srid");
 
                 result->SRID = lw_get_int32(loc);               
                 loc += 4; /* type + SRID */
          }
          else
          {
-                LWDEBUG(3, "lwcurve_deserialize: input lacks srid");
+                LWDEBUG(3, "lwcircstring_deserialize: input lacks srid");
 
                 result->SRID = -1;                
          }
@@ -128,7 +128,7 @@ lwcurve_deserialize(uchar *serialized_form)
 
          npoints = lw_get_uint32(loc);
 
-         LWDEBUGF(3, "curve npoints = %d", npoints);
+         LWDEBUGF(3, "circstring npoints = %d", npoints);
          
          loc += 4;
          pa = pointArray_construct(loc, TYPE_HASZ(type), TYPE_HASM(type), npoints);
@@ -137,53 +137,53 @@ lwcurve_deserialize(uchar *serialized_form)
 }
 
 /*
- * convert this curve into its serialized form
+ * convert this circularstring into its serialized form
  * result's first char will be the 8bit type. See serialized form doc
  */
 uchar *
-lwcurve_serialize(LWCURVE *curve)
+lwcircstring_serialize(LWCIRCSTRING *curve)
 {
         size_t size, retsize;
         uchar * result;
 
         if(curve == NULL) {
-                lwerror("lwcurve_serialize:: given null curve");
+                lwerror("lwcircstring_serialize:: given null curve");
                 return NULL;
         }
 
-        size = lwcurve_serialize_size(curve);
+        size = lwcircstring_serialize_size(curve);
         result = lwalloc(size);
-        lwcurve_serialize_buf(curve, result, &retsize);
+        lwcircstring_serialize_buf(curve, result, &retsize);
         if(retsize != size)
-                lwerror("lwcurve_serialize_size returned %d, ..selialize_buf returned %d", size, retsize);
+                lwerror("lwcircstring_serialize_size returned %d, ..serialize_buf returned %d", size, retsize);
         return result;
 }
 
 /*
- * convert this curve into its serialized form writing it into 
+ * convert this circularstring into its serialized form writing it into 
  * the given buffer, and returning number of bytes written into 
  * the given int pointer.
  * result's first char will be the 8bit type.  See serialized form doc
  */
-void lwcurve_serialize_buf(LWCURVE *curve, uchar *buf, size_t *retsize)
+void lwcircstring_serialize_buf(LWCIRCSTRING *curve, uchar *buf, size_t *retsize)
 {
         char hasSRID;
         uchar *loc;
         int ptsize;
         size_t size;
 
-        LWDEBUGF(2, "lwcurve_serialize_buf(%p, %p, %p) called",
+        LWDEBUGF(2, "lwcircstring_serialize_buf(%p, %p, %p) called",
                 curve, buf, retsize);
 
         if(curve == NULL) 
         {
-                lwerror("lwcurve_serialize:: given null curve");
+                lwerror("lwcircstring_serialize:: given null curve");
                 return;
         }
 
         if(TYPE_GETZM(curve->type) != TYPE_GETZM(curve->points->dims))
         {
-                lwerror("Dimensions mismatch in lwcurve");
+                lwerror("Dimensions mismatch in lwcircstring");
                 return;
         }
 
@@ -193,17 +193,17 @@ void lwcurve_serialize_buf(LWCURVE *curve, uchar *buf, size_t *retsize)
 
         buf[0] = (uchar)lwgeom_makeType_full(
                 TYPE_HASZ(curve->type), TYPE_HASM(curve->type),
-                hasSRID, CURVETYPE, curve->bbox ? 1 : 0);
+                hasSRID, CIRCSTRINGTYPE, curve->bbox ? 1 : 0);
         loc = buf+1;
 
-        LWDEBUGF(3, "lwcurve_serialize_buf added type (%d)", curve->type);
+        LWDEBUGF(3, "lwcircstring_serialize_buf added type (%d)", curve->type);
 
         if(curve->bbox)
         {
                 memcpy(loc, curve->bbox, sizeof(BOX2DFLOAT4));
                 loc += sizeof(BOX2DFLOAT4);
 
-                LWDEBUG(3, "lwcurve_serialize_buf added BBOX");
+                LWDEBUG(3, "lwcircstring_serialize_buf added BBOX");
         }                
 
         if(hasSRID)
@@ -211,13 +211,13 @@ void lwcurve_serialize_buf(LWCURVE *curve, uchar *buf, size_t *retsize)
                 memcpy(loc, &curve->SRID, sizeof(int32));
                 loc += sizeof(int32);
 
-                LWDEBUG(3, "lwcurve_serialize_buf added SRID");
+                LWDEBUG(3, "lwcircstring_serialize_buf added SRID");
         }
 
         memcpy(loc, &curve->points->npoints, sizeof(uint32));
         loc += sizeof(uint32);
 
-        LWDEBUGF(3, "lwcurve_serialize_buf added npoints (%d)",
+        LWDEBUGF(3, "lwcircstring_serialize_buf added npoints (%d)",
             curve->points->npoints);
 
         /* copy in points */
@@ -225,22 +225,22 @@ void lwcurve_serialize_buf(LWCURVE *curve, uchar *buf, size_t *retsize)
         memcpy(loc, getPoint_internal(curve->points, 0), size);
         loc += size;
 
-        LWDEBUGF(3, "lwcurve_serialize_buf copied serialized_pointlist (%d bytes)",
+        LWDEBUGF(3, "lwcircstring_serialize_buf copied serialized_pointlist (%d bytes)",
                 ptsize * curve->points->npoints);        
 
         if(retsize) *retsize = loc-buf;
 
-        LWDEBUGF(3, "lwcurve_serialize_buf returning (loc: %p, size: %d)",
+        LWDEBUGF(3, "lwcircstring_serialize_buf returning (loc: %p, size: %d)",
                 loc, loc-buf);
 }
 
-/* find length of this deserialized curve */
+/* find length of this deserialized circularstring */
 size_t
-lwcurve_serialize_size(LWCURVE *curve)
+lwcircstring_serialize_size(LWCIRCSTRING *curve)
 {
         size_t size = 1; /* type */
 
-        LWDEBUG(2, "lwcurve_serialize_size called");        
+        LWDEBUG(2, "lwcircstring_serialize_size called");        
 
         if(curve->SRID != -1) size += 4; /* SRID */
         if(curve->bbox) size += sizeof(BOX2DFLOAT4);
@@ -248,7 +248,7 @@ lwcurve_serialize_size(LWCURVE *curve)
         size += 4; /* npoints */
         size += pointArray_ptsize(curve->points) * curve->points->npoints;
 
-        LWDEBUGF(3, "lwcurve_serialize_size returning %d", size);
+        LWDEBUGF(3, "lwcircstring_serialize_size returning %d", size);
 
         return size;
 }
@@ -446,7 +446,7 @@ lwcircle_compute_box3d(POINT4D *p1, POINT4D *p2, POINT4D *p3)
  * TODO: This ignores curvature, which should be taken into account.
  */
 BOX3D *
-lwcurve_compute_box3d(LWCURVE *curve)
+lwcircstring_compute_box3d(LWCIRCSTRING *curve)
 {
         BOX3D *box, *tmp; 
         int i;
@@ -454,7 +454,7 @@ lwcurve_compute_box3d(LWCURVE *curve)
         POINT4D *p2 = lwalloc(sizeof(POINT4D));
         POINT4D *p3 = lwalloc(sizeof(POINT4D));
 
-        LWDEBUG(2, "lwcurve_compute_box3d called.");
+        LWDEBUG(2, "lwcircstring_compute_box3d called.");
 
         /* initialize box values */
         box = lwalloc(sizeof(BOX3D));
@@ -476,7 +476,7 @@ lwcurve_compute_box3d(LWCURVE *curve)
                 box->zmin = (box->zmin < tmp->zmin) ? box->zmin : tmp->zmin;
                 box->zmax = (box->zmax > tmp->zmax) ? box->zmax : tmp->zmax;
 
-                LWDEBUGF(4, "curve %d x=(%.16f,%.16f) y=(%.16f,%.16f) z=(%.16f,%.16f)", i/2, box->xmin, box->xmax, box->ymin, box->ymax, box->zmin, box->zmax);
+                LWDEBUGF(4, "circularstring %d x=(%.16f,%.16f) y=(%.16f,%.16f) z=(%.16f,%.16f)", i/2, box->xmin, box->xmax, box->ymin, box->ymax, box->zmin, box->zmax);
         }
 
         
@@ -484,17 +484,17 @@ lwcurve_compute_box3d(LWCURVE *curve)
 }
 
 int
-lwcurve_compute_box2d_p(LWCURVE *curve, BOX2DFLOAT4 *result)
+lwcircstring_compute_box2d_p(LWCIRCSTRING *curve, BOX2DFLOAT4 *result)
 {
-        BOX3D *box = lwcurve_compute_box3d(curve);
-        LWDEBUG(2, "lwcurve_compute_box2d_p called.");
+        BOX3D *box = lwcircstring_compute_box3d(curve);
+        LWDEBUG(2, "lwcircstring_compute_box2d_p called.");
 
         if(box == NULL) return 0;
         box3d_to_box2df_p(box, result);
         return 1;
 }
 
-void lwfree_curve(LWCURVE *curve)
+void lwfree_circstring(LWCIRCSTRING *curve)
 {
         lwfree(curve->points);
         lwfree(curve);
@@ -502,17 +502,17 @@ void lwfree_curve(LWCURVE *curve)
 
 /* find length of this serialized curve */
 size_t
-lwgeom_size_curve(const uchar *serialized_curve)
+lwgeom_size_circstring(const uchar *serialized_curve)
 {
         int type = (uchar)serialized_curve[0];
         uint32 result = 1; /* type */
         const uchar *loc;
         uint32 npoints;
 
-        LWDEBUG(2, "lwgeom_size_curve called");
+        LWDEBUG(2, "lwgeom_size_circstring called");
 
-        if(lwgeom_getType(type) != CURVETYPE)
-                lwerror("lwgeom_size_curve::attempt to find the length of a non-curve");
+        if(lwgeom_getType(type) != CIRCSTRINGTYPE)
+                lwerror("lwgeom_size_circstring::attempt to find the length of a non-circularstring");
 
         loc = serialized_curve + 1;
         if(lwgeom_hasBBOX(type))
@@ -533,26 +533,26 @@ lwgeom_size_curve(const uchar *serialized_curve)
 
         result += TYPE_NDIMS(type) * sizeof(double) * npoints;
 
-        LWDEBUGF(3, "lwgeom_size_curve returning %d", result);
+        LWDEBUGF(3, "lwgeom_size_circstring returning %d", result);
 
         return result;
 }
 
-void printLWCURVE(LWCURVE *curve)
+void printLWCIRCSTRING(LWCIRCSTRING *curve)
 {
-        lwnotice("LWCURVE {");
+        lwnotice("LWCIRCSTRING {");
         lwnotice("    ndims = %i", (int)TYPE_NDIMS(curve->type));
         lwnotice("    SRID = %i", (int)curve->SRID);
         printPA(curve->points);
         lwnotice("}");
 }
 
-/* Clone LWCURVE object.  POINTARRAY is not copied. */
-LWCURVE *
-lwcurve_clone(const LWCURVE *g)
+/* Clone LWCIRCSTRING object.  POINTARRAY is not copied. */
+LWCIRCSTRING *
+lwcircstring_clone(const LWCIRCSTRING *g)
 {
-        LWCURVE *ret = lwalloc(sizeof(LWCURVE));
-        memcpy(ret, g, sizeof(LWCURVE));
+        LWCIRCSTRING *ret = lwalloc(sizeof(LWCIRCSTRING));
+        memcpy(ret, g, sizeof(LWCIRCSTRING));
         if(g->bbox) ret->bbox = box2d_clone(g->bbox);
         return ret;
 }
@@ -564,7 +564,7 @@ lwcurve_clone(const LWCURVE *g)
  * Returns a MULTICURVE or a GEOMETRYCOLLECTION
  */
 LWGEOM *
-lwcurve_add(const LWCURVE *to, uint32 where, const LWGEOM *what)
+lwcircstring_add(const LWCIRCSTRING *to, uint32 where, const LWGEOM *what)
 {
         LWCOLLECTION *col;
         LWGEOM **geoms;
@@ -599,7 +599,7 @@ lwcurve_add(const LWCURVE *to, uint32 where, const LWGEOM *what)
         TYPE_SETHASBBOX(geoms[1]->type, 0);
 
         /* Find appropriate geom type */
-        if(TYPE_GETTYPE(what->type) == CURVETYPE || TYPE_GETTYPE(what->type) == LINETYPE) newtype = MULTICURVETYPE;
+        if(TYPE_GETTYPE(what->type) == CIRCSTRINGTYPE || TYPE_GETTYPE(what->type) == LINETYPE) newtype = MULTICURVETYPE;
         else newtype = COLLECTIONTYPE;
 
         col = lwcollection_construct(newtype, 
@@ -609,7 +609,7 @@ lwcurve_add(const LWCURVE *to, uint32 where, const LWGEOM *what)
         return (LWGEOM *)col;
 }
 
-void lwcurve_reverse(LWCURVE *curve)
+void lwcircstring_reverse(LWCIRCSTRING *curve)
 {
         ptarray_reverse(curve->points);
 }
@@ -617,26 +617,26 @@ void lwcurve_reverse(LWCURVE *curve)
 /*
  * TODO: Invalid segmentization.  This should accomodate the curvature.
  */
-LWCURVE *
-lwcurve_segmentize2d(LWCURVE *curve, double dist)
+LWCIRCSTRING *
+lwcircstring_segmentize2d(LWCIRCSTRING *curve, double dist)
 {
-        return lwcurve_construct(curve->SRID, NULL,
+        return lwcircstring_construct(curve->SRID, NULL,
                 ptarray_segmentize2d(curve->points, dist));
 }
                     
 /* check coordinate equality */
 char
-lwcurve_same(const LWCURVE *me, const LWCURVE *you)
+lwcircstring_same(const LWCIRCSTRING *me, const LWCIRCSTRING *you)
 {
         return ptarray_same(me->points, you->points);
 }
 
 /*
- * Construct a LWCURVE from an array of LWPOINTs
- * LWCURVE dimensions are large enough to host all input dimensions.
+ * Construct a LWCIRCSTRING from an array of LWPOINTs
+ * LWCIRCSTRING dimensions are large enough to host all input dimensions.
  */
-LWCURVE *
-lwcurve_from_lwpointarray(int SRID, unsigned int npoints, LWPOINT **points)
+LWCIRCSTRING *
+lwcircstring_from_lwpointarray(int SRID, unsigned int npoints, LWPOINT **points)
 {
         int zmflag=0;
         unsigned int i;
@@ -680,14 +680,14 @@ lwcurve_from_lwpointarray(int SRID, unsigned int npoints, LWPOINT **points)
         }
         pa = pointArray_construct(newpoints, zmflag&2, zmflag&1, npoints);
 
-        return lwcurve_construct(SRID, NULL, pa);
+        return lwcircstring_construct(SRID, NULL, pa);
 }
 
 /*
- * Construct a LWCURVE from a LWMPOINT
+ * Construct a LWCIRCSTRING from a LWMPOINT
  */
-LWCURVE *
-lwcurve_from_lwmpoint(int SRID, LWMPOINT *mpoint)
+LWCIRCSTRING *
+lwcircstring_from_lwmpoint(int SRID, LWMPOINT *mpoint)
 {
         unsigned int i;
         POINTARRAY *pa;
@@ -718,31 +718,31 @@ lwcurve_from_lwmpoint(int SRID, LWMPOINT *mpoint)
 
         LWDEBUGF(3, "lwcurve_from_lwmpoint: constructed pointarray for %d points, %d zmflag", mpoint->ngeoms, zmflag);
         
-        return lwcurve_construct(SRID, NULL, pa);
+        return lwcircstring_construct(SRID, NULL, pa);
 }
 
-LWCURVE *
-lwcurve_addpoint(LWCURVE *curve, LWPOINT *point, unsigned int where)
+LWCIRCSTRING *
+lwcircstring_addpoint(LWCIRCSTRING *curve, LWPOINT *point, unsigned int where)
 {
         POINTARRAY *newpa;
-        LWCURVE *ret;
+        LWCIRCSTRING *ret;
 
         newpa = ptarray_addPoint(curve->points, 
                 getPoint_internal(point->point, 0),
                 TYPE_NDIMS(point->type), where);
-        ret = lwcurve_construct(curve->SRID, NULL, newpa);
+        ret = lwcircstring_construct(curve->SRID, NULL, newpa);
 
         return ret;
 }
 
-LWCURVE *
-lwcurve_removepoint(LWCURVE *curve, unsigned int index)
+LWCIRCSTRING *
+lwcircstring_removepoint(LWCIRCSTRING *curve, unsigned int index)
 {
         POINTARRAY *newpa;
-        LWCURVE *ret;
+        LWCIRCSTRING *ret;
 
         newpa = ptarray_removePoint(curve->points, index);
-        ret = lwcurve_construct(curve->SRID, NULL, newpa);
+        ret = lwcircstring_construct(curve->SRID, NULL, newpa);
 
         return ret;
 }
@@ -751,7 +751,7 @@ lwcurve_removepoint(LWCURVE *curve, unsigned int index)
  * Note: input will be changed, make sure you have permissions for this.
  * */
 void
-lwcurve_setPoint4d(LWCURVE *curve, unsigned int index, POINT4D *newpoint)
+lwcircstring_setPoint4d(LWCIRCSTRING *curve, unsigned int index, POINT4D *newpoint)
 {
         setPoint4d(curve->points, index, newpoint);
 }
index 3e2a4010772d941a5a14a9a8720bef4708830bce..814b5fae29e2ccb6273cf06fbf6f936611f1a712 100644 (file)
@@ -378,7 +378,7 @@ int lwcollection_ngeoms(const LWCOLLECTION *col)
                        switch(TYPE_GETTYPE(col->geoms[i]->type)) {
                                case POINTTYPE:
                                case LINETYPE:
-                               case CURVETYPE:
+                               case CIRCSTRINGTYPE:
                                case POLYGONTYPE:
                                        ngeoms += 1;
                                        break;
index 1a6b08cd9931564140a46b50aed7216505f92ab6..8aafba2fbfeffa1755832483368ac2a362eee7ec 100644 (file)
@@ -49,10 +49,10 @@ lwcompound_deserialize(uchar *serialized)
                 if(lwgeom_getType(insp->sub_geoms[i][0]) == LINETYPE)
                         result->geoms[i] = (LWGEOM *)lwline_deserialize(insp->sub_geoms[i]);
                 else
-                        result->geoms[i] = (LWGEOM *)lwcurve_deserialize(insp->sub_geoms[i]);
+                        result->geoms[i] = (LWGEOM *)lwcircstring_deserialize(insp->sub_geoms[i]);
                 if(TYPE_NDIMS(result->geoms[i]->type) != TYPE_NDIMS(result->type))
                 {
-                        lwerror("Mixed dimensions (compound:%d, line/curve%d:%d)",
+                        lwerror("Mixed dimensions (compound: %d, line/circularstring %d:%d)",
                             TYPE_NDIMS(result->type), i,
                             TYPE_NDIMS(result->geoms[i]->type)
                         );
@@ -107,7 +107,7 @@ lwcompound_add(const LWCOMPOUND *to, uint32 where, const LWGEOM *what)
         TYPE_SETHASBBOX(geoms[1]->type, 0);
 
         /* Find appropriate geom type */
-        if(TYPE_GETTYPE(what->type) == LINETYPE || TYPE_GETTYPE(what->type) == CURVETYPE) newtype = COMPOUNDTYPE;
+        if(TYPE_GETTYPE(what->type) == LINETYPE || TYPE_GETTYPE(what->type) == CIRCSTRINGTYPE) newtype = COMPOUNDTYPE;
         else newtype = COLLECTIONTYPE;
 
         col = lwcollection_construct(newtype,
index d6c4a42e779346c4f104be2cdf5cebb4439945f8..3564188b09c511c51b7edcb9e9b0837802cdb731 100644 (file)
@@ -53,10 +53,10 @@ lwcurvepoly_deserialize(uchar *srl)
         for(i = 0; i < insp->ngeometries; i++)
         {
                 result->rings[i] = lwgeom_deserialize(insp->sub_geoms[i]);
-                if(lwgeom_getType(result->rings[i]->type) != CURVETYPE 
+                if(lwgeom_getType(result->rings[i]->type) != CIRCSTRINGTYPE 
                         && lwgeom_getType(result->rings[i]->type) != LINETYPE)
                 {
-                        lwerror("Only Circular curves and Linestrings are currently supported as rings, not %s (%d)", lwgeom_typename(result->rings[i]->type), result->rings[i]->type);
+                        lwerror("Only Circularstrings and Linestrings are currently supported as rings, not %s (%d)", lwgeom_typename(result->rings[i]->type), result->rings[i]->type);
                         lwfree(result);
                         lwfree(insp);
                         return NULL;
index aa0fe055876905206ae9cb39b06541f1ccbf6699..5e59b1d2894e94b23af5fc6516d7e19040afec3b 100644 (file)
@@ -31,8 +31,8 @@ lwgeom_deserialize(uchar *srl)
                        return (LWGEOM *)lwpoint_deserialize(srl);
                case LINETYPE:
                        return (LWGEOM *)lwline_deserialize(srl);
-                case CURVETYPE:
-                        return (LWGEOM *)lwcurve_deserialize(srl);
+                case CIRCSTRINGTYPE:
+                        return (LWGEOM *)lwcircstring_deserialize(srl);
                case POLYGONTYPE:
                        return (LWGEOM *)lwpoly_deserialize(srl);
                case MULTIPOINTTYPE:
@@ -74,8 +74,8 @@ lwgeom_serialize_size(LWGEOM *lwgeom)
                        return lwline_serialize_size((LWLINE *)lwgeom);
                case POLYGONTYPE:
                        return lwpoly_serialize_size((LWPOLY *)lwgeom);
-                case CURVETYPE:
-                        return lwcurve_serialize_size((LWCURVE *)lwgeom);
+                case CIRCSTRINGTYPE:
+                        return lwcircstring_serialize_size((LWCIRCSTRING *)lwgeom);
                 case CURVEPOLYTYPE:
                 case COMPOUNDTYPE:
                case MULTIPOINTTYPE:
@@ -111,8 +111,8 @@ lwgeom_serialize_buf(LWGEOM *lwgeom, uchar *buf, size_t *retsize)
                case POLYGONTYPE:
                        lwpoly_serialize_buf((LWPOLY *)lwgeom, buf, retsize);
                        break;
-                case CURVETYPE:
-                        lwcurve_serialize_buf((LWCURVE *)lwgeom, buf, retsize);
+                case CIRCSTRINGTYPE:
+                        lwcircstring_serialize_buf((LWCIRCSTRING *)lwgeom, buf, retsize);
                         break;
                 case CURVEPOLYTYPE:
                 case COMPOUNDTYPE:
@@ -210,8 +210,8 @@ lwgeom_compute_box2d_p(LWGEOM *lwgeom, BOX2DFLOAT4 *buf)
                        return lwpoint_compute_box2d_p((LWPOINT *)lwgeom, buf);
                case LINETYPE:
                        return lwline_compute_box2d_p((LWLINE *)lwgeom, buf);
-                case CURVETYPE:
-                        return lwcurve_compute_box2d_p((LWCURVE *)lwgeom, buf);
+                case CIRCSTRINGTYPE:
+                        return lwcircstring_compute_box2d_p((LWCIRCSTRING *)lwgeom, buf);
                case POLYGONTYPE:
                        return lwpoly_compute_box2d_p((LWPOLY *)lwgeom, buf);
                 case COMPOUNDTYPE:
@@ -257,11 +257,11 @@ lwgeom_as_lwline(LWGEOM *lwgeom)
        else return NULL;
 }
 
-LWCURVE *
-lwgeom_as_lwcurve(LWGEOM *lwgeom)
+LWCIRCSTRING *
+lwgeom_as_lwcircstring(LWGEOM *lwgeom)
 {
-        if( TYPE_GETTYPE(lwgeom->type) == CURVETYPE )
-                return (LWCURVE *)lwgeom;
+        if( TYPE_GETTYPE(lwgeom->type) == CIRCSTRINGTYPE )
+                return (LWCIRCSTRING *)lwgeom;
         else return NULL;
 }
 
@@ -362,8 +362,8 @@ lwgeom_clone(const LWGEOM *lwgeom)
                        return (LWGEOM *)lwpoint_clone((LWPOINT *)lwgeom);
                case LINETYPE:
                        return (LWGEOM *)lwline_clone((LWLINE *)lwgeom);
-                case CURVETYPE:
-                        return (LWGEOM *)lwcurve_clone((LWCURVE *)lwgeom);
+                case CIRCSTRINGTYPE:
+                        return (LWGEOM *)lwcircstring_clone((LWCIRCSTRING *)lwgeom);
                case POLYGONTYPE:
                        return (LWGEOM *)lwpoly_clone((LWPOLY *)lwgeom);
                 case COMPOUNDTYPE:
@@ -409,8 +409,8 @@ lwgeom_add(const LWGEOM *to, uint32 where, const LWGEOM *what)
                case LINETYPE:
                        return (LWGEOM *)lwline_add((const LWLINE *)to, where, what);
 
-                case CURVETYPE:
-                        return (LWGEOM *)lwcurve_add((const LWCURVE *)to, where, what);
+                case CIRCSTRINGTYPE:
+                        return (LWGEOM *)lwcircstring_add((const LWCIRCSTRING *)to, where, what);
 
                case POLYGONTYPE:
                        return (LWGEOM *)lwpoly_add((const LWPOLY *)to, where, what);
index 7afa02ea0e47933d69dafb9af61cb81d74840163..be13c41ebefde6ac3690cd9788e6ee877cf119d2 100644 (file)
@@ -948,9 +948,9 @@ lwgeom_inspect(const uchar *serialized_form)
                loc += 4;
        }
 
-       if ( (type==POINTTYPE) || (type==LINETYPE) || (type==POLYGONTYPE) || (type == CURVETYPE))
+       if ( (type==POINTTYPE) || (type==LINETYPE) || (type==POLYGONTYPE) || (type == CIRCSTRINGTYPE))
        {
-               /* simple geometry (point/line/polygon)-- not multi! */
+               /* simple geometry (point/line/polygon/circstring)-- not multi! */
                result->ngeometries = 1;
                sub_geoms = (uchar**) lwalloc(sizeof(char*));
                sub_geoms[0] = (uchar *)serialized_form;
@@ -1155,8 +1155,8 @@ lwgeom_getpoly_inspected(LWGEOM_INSPECTED *inspected, int geom_number)
  * if there arent enough geometries, return null.
  * this is fine to call on a circularstring
  */
-LWCURVE *
-lwgeom_getcurve_inspected(LWGEOM_INSPECTED *inspected, int geom_number)
+LWCIRCSTRING *
+lwgeom_getcircstring_inspected(LWGEOM_INSPECTED *inspected, int geom_number)
 {
        uchar *sub_geom;
        uchar type;
@@ -1166,9 +1166,9 @@ lwgeom_getcurve_inspected(LWGEOM_INSPECTED *inspected, int geom_number)
        if (sub_geom == NULL) return NULL;
 
        type = lwgeom_getType(sub_geom[0]);
-       if (type != CURVETYPE) return NULL;
+       if (type != CIRCSTRINGTYPE) return NULL;
 
-       return lwcurve_deserialize(sub_geom);
+       return lwcircstring_deserialize(sub_geom);
 }
 
 /*
@@ -1275,7 +1275,7 @@ lwgeom_getnumgeometries(uchar *serialized_form)
        uchar *loc;
 
        if ( (type==POINTTYPE) || (type==LINETYPE) || (type==POLYGONTYPE) ||
-            (type==CURVETYPE) || (type==COMPOUNDTYPE) || (type==CURVEPOLYTYPE) )
+            (type==CIRCSTRINGTYPE) || (type==COMPOUNDTYPE) || (type==CURVEPOLYTYPE) )
        {
                return 1;
        }
@@ -1511,11 +1511,11 @@ lwgeom_size(const uchar *serialized_form)
 
                return lwgeom_size_line(serialized_form);
        }
-        else if(type == CURVETYPE)
+        else if(type == CIRCSTRINGTYPE)
         {
-                LWDEBUG(3, "lwgeom_size: is a curve");
+                LWDEBUG(3, "lwgeom_size: is a circularstring");
 
-                return lwgeom_size_curve(serialized_form);
+                return lwgeom_size_circstring(serialized_form);
         }
        else if (type == POLYGONTYPE)
        {
@@ -1676,11 +1676,11 @@ compute_serialized_box3d(uchar *srl)
                return result;
 
        }
-        else if (type == CURVETYPE)
+        else if (type == CIRCSTRINGTYPE)
         {
-                LWCURVE *curve = lwcurve_deserialize(srl);
-                result = lwcurve_compute_box3d(curve);
-                lwfree_curve(curve);
+                LWCIRCSTRING *curve = lwcircstring_deserialize(srl);
+                result = lwcircstring_compute_box3d(curve);
+                lwfree_circstring(curve);
                 return result;
         }
        else if (type == POLYGONTYPE)
index b65f518472c1dd1b6fabbe47cdf0323e92a36d88..6edcaa4cdc64d0034426f3dac8759cfcf8ade0b0 100644 (file)
@@ -208,7 +208,7 @@ double read_wkb_double(const char **in, int convert_from_int);
 void read_wkb_point(const char **b);
 void read_wkb_polygon(const char **b);
 void read_wkb_linestring(const char **b);
-void read_wkb_curve(const char **b);
+void read_wkb_circstring(const char **b);
 void read_wkb_ordinate_array(const char **b);
 void read_collection(const char **b, read_col_func f);
 void parse_wkb(const char **b);
@@ -640,7 +640,7 @@ alloc_circularstring(void)
 {
         LWDEBUG(2, "alloc_circularstring");
 
-        alloc_stack_tuple(CURVETYPE,write_type,1);
+        alloc_stack_tuple(CIRCSTRINGTYPE,write_type,1);
         minpoints=3;
         checkclosed=0;
         isodd=1;
@@ -988,10 +988,10 @@ read_wkb_linestring(const char **b)
 
 
 void
-read_wkb_curve(const char **b)
+read_wkb_circstring(const char **b)
 {
 
-       /* Things to check for CURVE ORDINATE_ARRAYs */
+       /* Things to check for CIRCULARSTRING ORDINATE_ARRAYs */
        minpoints=3;
        checkclosed=0;
        isodd=-1;
@@ -1103,8 +1103,8 @@ parse_wkb(const char **b)
                        read_wkb_linestring(b);
                        break;
 
-                case    CURVETYPE:
-                        read_wkb_curve(b);
+                case    CIRCSTRINGTYPE:
+                        read_wkb_circstring(b);
                         break;
 
                case    POLYGONTYPE:
index dd22381f29711ae87aa96613a5ebdd4a6b085633..28d372b5ff2ffcffd85ee3437ddd16af298b7173 100644 (file)
@@ -43,7 +43,7 @@ uchar* output_collection(uchar* geom,outfunc func,int supress);
 uchar* output_line_collection(uchar* geom,outfunc func,int supress);
 uchar* output_polygon_collection(uchar* geom,int suppress);
 uchar* output_polygon_ring_collection(uchar* geom,outfunc func,int supress);
-uchar* output_curve_collection(uchar* geom,outfunc func,int supress);
+uchar* output_circstring_collection(uchar* geom,outfunc func,int supress);
 uchar* output_multipoint(uchar* geom,int suppress);
 uchar* output_compound(uchar* geom, int suppress);
 uchar* output_multisurface(uchar* geom, int suppress);
@@ -58,7 +58,7 @@ uchar* output_wkb_collection(uchar* geom,outwkbfunc func);
 uchar* output_wkb_polygon_collection(uchar* geom);
 uchar* output_wkb_polygon_ring_collection(uchar* geom,outwkbfunc func);
 uchar* output_wkb_line_collection(uchar* geom,outwkbfunc func);
-uchar* output_wkb_curve_collection(uchar* geom,outwkbfunc func);
+uchar* output_wkb_circstring_collection(uchar* geom,outwkbfunc func);
 uchar* output_wkb_point(uchar* geom);
 uchar* output_wkb(uchar* geom);
 
@@ -358,7 +358,7 @@ output_polygon_ring_collection(uchar* geom,outfunc func,int supress)
 
 /* Ouput the points from a CIRCULARSTRING */
 uchar *
-output_curve_collection(uchar* geom,outfunc func,int supress)
+output_circstring_collection(uchar* geom,outfunc func,int supress)
 {
        int cnt = read_int(&geom);
        int orig_cnt = cnt;
@@ -428,7 +428,7 @@ uchar *output_compound(uchar* geom, int suppress) {
                 case LINETYPE:
                         geom = output_wkt(geom,2);
                         break;
-                case CURVETYPE:
+                case CIRCSTRINGTYPE:
                         geom = output_wkt(geom,1);
                         break;
         }
@@ -500,13 +500,13 @@ output_wkt(uchar* geom, int supress)
                        }
                        geom = output_line_collection(geom,output_point,0);
                        break;
-                case CURVETYPE:
+                case CIRCSTRINGTYPE:
                         if ( supress < 2 )
                         {
                                 if(writeM) write_str("CIRCULARSTRINGM");
                                 else write_str("CIRCULARSTRING");
                         }
-                        geom = output_curve_collection(geom,output_point,0);
+                        geom = output_circstring_collection(geom,output_point,0);
                         break;
                case POLYGONTYPE:
                        if ( supress < 2 )
@@ -832,7 +832,7 @@ output_wkb_polygon_collection(uchar* geom)
 
 /* Ouput the points from a CIRCULARSTRING */
 uchar *
-output_wkb_curve_collection(uchar* geom,outwkbfunc func)
+output_wkb_circstring_collection(uchar* geom,outwkbfunc func)
 {
        int cnt = read_int(&geom);
        int orig_cnt = cnt;
@@ -897,8 +897,8 @@ output_wkb(uchar* geom)
                case LINETYPE:
                        geom=output_wkb_line_collection(geom,output_wkb_point);
                        break;
-                case CURVETYPE:
-                        geom=output_wkb_curve_collection(geom,output_wkb_point);
+                case CIRCSTRINGTYPE:
+                        geom=output_wkb_circstring_collection(geom,output_wkb_point);
                         break;
                case POLYGONTYPE:
                        geom=output_wkb_collection(geom,output_wkb_polygon_collection);
index c508aa1c879ebeb2296d2776dae5be1657f99ffe..66e55c8fbfa2a930a664dc7b5b3f43016bc37348 100644 (file)
@@ -36,7 +36,7 @@ lwmcurve_deserialize(uchar *srl)
         result->type = insp->type;
         result->SRID = insp->SRID;
         result->ngeoms = insp->ngeometries;
-        result->geoms = lwalloc(sizeof(LWCURVE *)*insp->ngeometries);
+        result->geoms = lwalloc(sizeof(LWGEOM *)*insp->ngeometries);
 
         if(lwgeom_hasBBOX(srl[0]))
         {
@@ -48,9 +48,9 @@ lwmcurve_deserialize(uchar *srl)
         for(i = 0; i < insp->ngeometries; i++)
         {
                 stype = lwgeom_getType(insp->sub_geoms[i][0]);
-                if(stype == CURVETYPE)
+                if(stype == CIRCSTRINGTYPE)
                 {
-                        result->geoms[i] = (LWGEOM *)lwcurve_deserialize(insp->sub_geoms[i]);
+                        result->geoms[i] = (LWGEOM *)lwcircstring_deserialize(insp->sub_geoms[i]);
                 }
                 else if(stype == LINETYPE)
                 {
@@ -113,7 +113,7 @@ lwmcurve_add(const LWMCURVE *to, uint32 where, const LWGEOM *what)
                 geoms[i+1] = lwgeom_clone((LWGEOM *)to->geoms[i]);
         }
 
-        if(TYPE_GETTYPE(what->type) == CURVETYPE) newtype = MULTICURVETYPE;
+        if(TYPE_GETTYPE(what->type) == CIRCSTRINGTYPE) newtype = MULTICURVETYPE;
         else newtype = COLLECTIONTYPE;
 
         col = lwcollection_construct(newtype,
index d87a949495beafe7ad3f670d81f9eab52b93a486..199c9ebda6d23504219cc23c5255a2e115919617 100644 (file)
@@ -21,7 +21,7 @@
 
 double interpolate_arc(double angle, double zm1, double a1, double zm2, double a2);
 POINTARRAY *lwcircle_segmentize(POINT4D *p1, POINT4D *p2, POINT4D *p3, uint32 perQuad);
-LWLINE *lwcurve_segmentize(LWCURVE *icurve, uint32 perQuad);
+LWLINE *lwcurve_segmentize(LWCIRCSTRING *icurve, uint32 perQuad);
 LWLINE *lwcompound_segmentize(LWCOMPOUND *icompound, uint32 perQuad);
 LWPOLY *lwcurvepoly_segmentize(LWCURVEPOLY *curvepoly, uint32 perQuad);
 LWMLINE *lwmcurve_segmentize(LWMCURVE *mcurve, uint32 perQuad);
@@ -63,7 +63,7 @@ has_arc(LWGEOM *geom)
         case MULTILINETYPE:
         case MULTIPOLYGONTYPE:
                 return 0;
-        case CURVETYPE:
+        case CIRCSTRINGTYPE:
                 return 1;
         /* It's a collection that MAY contain an arc */
         default:
@@ -281,7 +281,7 @@ lwcircle_segmentize(POINT4D *p1, POINT4D *p2, POINT4D *p3, uint32 perQuad)
 }
 
 LWLINE *
-lwcurve_segmentize(LWCURVE *icurve, uint32 perQuad)
+lwcurve_segmentize(LWCIRCSTRING *icurve, uint32 perQuad)
 {
         LWLINE *oline;
         DYNPTARRAY *ptarray;
@@ -349,9 +349,9 @@ lwcompound_segmentize(LWCOMPOUND *icompound, uint32 perQuad)
         for(i = 0; i < icompound->ngeoms; i++)
         {
                 geom = icompound->geoms[i];
-                if(lwgeom_getType(geom->type) == CURVETYPE)
+                if(lwgeom_getType(geom->type) == CIRCSTRINGTYPE)
                 {
-                        tmp = lwcurve_segmentize((LWCURVE *)geom, perQuad);
+                        tmp = lwcurve_segmentize((LWCIRCSTRING *)geom, perQuad);
                         for(j = 0; j < tmp->points->npoints; j++)
                         {
                                 getPoint4d_p(tmp->points, j, p);
@@ -396,9 +396,9 @@ lwcurvepoly_segmentize(LWCURVEPOLY *curvepoly, uint32 perQuad)
         for(i = 0; i < curvepoly->nrings; i++)
         {
                 tmp = curvepoly->rings[i];
-                if(lwgeom_getType(tmp->type) == CURVETYPE)
+                if(lwgeom_getType(tmp->type) == CIRCSTRINGTYPE)
                 {
-                        line = lwcurve_segmentize((LWCURVE *)tmp, perQuad);
+                        line = lwcurve_segmentize((LWCIRCSTRING *)tmp, perQuad);
                         ptarray[i] = ptarray_clone(line->points);
                         lwfree(line);
                 }
@@ -433,9 +433,9 @@ lwmcurve_segmentize(LWMCURVE *mcurve, uint32 perQuad)
         for(i = 0; i < mcurve->ngeoms; i++)
         {
                 tmp = mcurve->geoms[i];
-                if(lwgeom_getType(tmp->type) == CURVETYPE)
+                if(lwgeom_getType(tmp->type) == CIRCSTRINGTYPE)
                 {
-                        lines[i] = (LWGEOM *)lwcurve_segmentize((LWCURVE *)tmp, perQuad);
+                        lines[i] = (LWGEOM *)lwcurve_segmentize((LWCIRCSTRING *)tmp, perQuad);
                 }
                 else if(lwgeom_getType(tmp->type) == LINETYPE)
                 {
@@ -509,8 +509,8 @@ lwcollection_segmentize(LWCOLLECTION *collection, uint32 perQuad)
         {
                 tmp = collection->geoms[i];
                 switch(lwgeom_getType(tmp->type)) {
-                case CURVETYPE:
-                        geoms[i] = (LWGEOM *)lwcurve_segmentize((LWCURVE *)tmp, perQuad);
+                case CIRCSTRINGTYPE:
+                        geoms[i] = (LWGEOM *)lwcurve_segmentize((LWCIRCSTRING *)tmp, perQuad);
                         break;
                 case COMPOUNDTYPE:
                         geoms[i] = (LWGEOM *)lwcompound_segmentize((LWCOMPOUND *)tmp, perQuad);
@@ -532,8 +532,8 @@ lwgeom_segmentize(LWGEOM *geom, uint32 perQuad)
 {
         LWGEOM * ogeom = NULL;
         switch(lwgeom_getType(geom->type)) {
-        case CURVETYPE:
-                ogeom = (LWGEOM *)lwcurve_segmentize((LWCURVE *)geom, perQuad);
+        case CIRCSTRINGTYPE:
+                ogeom = (LWGEOM *)lwcurve_segmentize((LWCIRCSTRING *)geom, perQuad);
                 break;
         case COMPOUNDTYPE:
                 ogeom = (LWGEOM *)lwcompound_segmentize((LWCOMPOUND *)geom, perQuad);
@@ -575,7 +575,7 @@ append_segment(LWGEOM *geom, POINTARRAY *pts, int type, int SRID)
 
                         return (LWGEOM *)lwline_construct(SRID, NULL, pts);
                 }
-                else if(type == CURVETYPE)
+                else if(type == CIRCSTRINGTYPE)
                 {
 #if POSTGIS_DEBUG_LEVEL >= 4
                         POINT4D tmp;
@@ -588,7 +588,7 @@ append_segment(LWGEOM *geom, POINTARRAY *pts, int type, int SRID)
                                 LWDEBUGF(4, "new point: (%.16f,%.16f)",tmp.x,tmp.y);
                         }
 #endif
-                        return (LWGEOM *)lwcurve_construct(SRID, NULL, pts);
+                        return (LWGEOM *)lwcircstring_construct(SRID, NULL, pts);
                 }
                 else
                 {
@@ -620,13 +620,13 @@ append_segment(LWGEOM *geom, POINTARRAY *pts, int type, int SRID)
                 lwgeom_release(geom);
                 return result;
         }
-        else if(currentType == CURVETYPE && type == CURVETYPE)
+        else if(currentType == CIRCSTRINGTYPE && type == CIRCSTRINGTYPE)
         {
                 POINTARRAY *newPoints;
                 POINT4D pt;
-                LWCURVE *curve = (LWCURVE *)geom;
+                LWCIRCSTRING *curve = (LWCIRCSTRING *)geom;
 
-                LWDEBUG(3, "append_segment: curve to curve");
+                LWDEBUG(3, "append_segment: circularstring to circularstring");
 
                 newPoints = ptarray_construct(TYPE_HASZ(pts->dims), TYPE_HASM(pts->dims), pts->npoints + curve->points->npoints - 1);
 
@@ -648,11 +648,11 @@ append_segment(LWGEOM *geom, POINTARRAY *pts, int type, int SRID)
 
                         setPoint4d(newPoints, i + curve->points->npoints - 1, &pt);
                 }
-                result = (LWGEOM *)lwcurve_construct(SRID, NULL, newPoints);
+                result = (LWGEOM *)lwcircstring_construct(SRID, NULL, newPoints);
                 lwgeom_release(geom);
                 return result;
         }
-        else if(currentType == CURVETYPE && type == LINETYPE)
+        else if(currentType == CIRCSTRINGTYPE && type == LINETYPE)
         {
                 LWLINE *line;
                 LWGEOM **geomArray;
@@ -670,17 +670,17 @@ append_segment(LWGEOM *geom, POINTARRAY *pts, int type, int SRID)
                 lwgeom_release(geom);
                 return result;
         }
-        else if(currentType == LINETYPE && type == CURVETYPE)
+        else if(currentType == LINETYPE && type == CIRCSTRINGTYPE)
         {
-                LWCURVE *curve;
+                LWCIRCSTRING *curve;
                 LWGEOM **geomArray;
 
-                LWDEBUG(3, "append_segment: curve to line");
+                LWDEBUG(3, "append_segment: circularstring to line");
 
                 geomArray = lwalloc(sizeof(LWGEOM *)*2);
                 geomArray[0] = lwgeom_clone(geom);
 
-                curve = lwcurve_construct(SRID, NULL, pts);
+                curve = lwcircstring_construct(SRID, NULL, pts);
                 geomArray[1] = lwgeom_clone((LWGEOM *)curve);
 
                 result = (LWGEOM *)lwcollection_construct(COMPOUNDTYPE, SRID, NULL, 2, geomArray);
@@ -708,11 +708,11 @@ append_segment(LWGEOM *geom, POINTARRAY *pts, int type, int SRID)
 
                         newGeom = (LWGEOM *)lwline_construct(SRID, NULL, pts);
                 }
-                else if(type == CURVETYPE)
+                else if(type == CIRCSTRINGTYPE)
                 {
-                        LWDEBUG(3, "append_segment: curve to compound");
+                        LWDEBUG(3, "append_segment: circularstring to compound");
 
-                        newGeom = (LWGEOM *)lwcurve_construct(SRID, NULL, pts);
+                        newGeom = (LWGEOM *)lwcircstring_construct(SRID, NULL, pts);
                 }
                 else
                 {
@@ -796,10 +796,10 @@ pta_desegmentize(POINTARRAY *points, int type, int SRID)
                         if(isline > 0)
                         {
                         }
-                        /* We were tracking a curve, commit it and start line*/
+                        /* We were tracking a circularstring, commit it and start line*/
                         else if(isline == 0)
                         {
-                                LWDEBUGF(3, "Building curve, %d - %d", commit, i);
+                                LWDEBUGF(3, "Building circularstring, %d - %d", commit, i);
 
                                 count = i - commit;
                                 pts = ptarray_construct(
@@ -815,7 +815,7 @@ pta_desegmentize(POINTARRAY *points, int type, int SRID)
                                 setPoint4d(pts, 2, &tmp);
 
                                 commit = i-1;
-                                geom = append_segment(geom, pts, CURVETYPE, SRID);
+                                geom = append_segment(geom, pts, CIRCSTRINGTYPE, SRID);
                                 isline = -1;
 
                                 /* 
@@ -857,10 +857,10 @@ pta_desegmentize(POINTARRAY *points, int type, int SRID)
                                 isline = 1;
                         }
                 }
-                /* Found a curve segment */
+                /* Found a circularstring segment */
                 else
                 {
-                        /* We were tracking a curve, commit it and start line */
+                        /* We were tracking a circularstring, commit it and start line */
                         if(isline > 0)
                         {
                                 LWDEBUGF(3, "Building line, %d - %d", commit, i-2);
@@ -881,7 +881,7 @@ pta_desegmentize(POINTARRAY *points, int type, int SRID)
                                 geom = append_segment(geom, pts, LINETYPE, SRID);
                                 isline = -1;
                         }
-                        /* We are tracking a curve, keep going */
+                        /* We are tracking a circularstring, keep going */
                         else if(isline == 0)
                         {
                                 ;
@@ -889,7 +889,7 @@ pta_desegmentize(POINTARRAY *points, int type, int SRID)
                         /* We didn't know what we were tracking, now we do */
                         else
                         {
-                                LWDEBUG(3, "It's a curve");
+                                LWDEBUG(3, "It's a circularstring");
                                 isline = 0;
                         }
                 }
@@ -897,7 +897,7 @@ pta_desegmentize(POINTARRAY *points, int type, int SRID)
         count = i - commit;
         if(isline == 0 && count > 2)
         {
-                LWDEBUGF(3, "Finishing curve %d,%d.", commit, i);
+                LWDEBUGF(3, "Finishing circularstring %d,%d.", commit, i);
 
                 pts = ptarray_construct(
                         TYPE_HASZ(type),
@@ -910,7 +910,7 @@ pta_desegmentize(POINTARRAY *points, int type, int SRID)
                 getPoint4d_p(points, i - 1, &tmp);
                 setPoint4d(pts, 2, &tmp);
 
-                geom = append_segment(geom, pts, CURVETYPE, SRID);
+                geom = append_segment(geom, pts, CIRCSTRINGTYPE, SRID);
         }
         else 
         {
@@ -950,7 +950,7 @@ lwpolygon_desegmentize(LWPOLY *poly)
         for(i=0; i<poly->nrings; i++)
         {
                 geoms[i] = pta_desegmentize(poly->rings[i], poly->type, poly->SRID);
-                if(lwgeom_getType(geoms[i]->type) == CURVETYPE ||
+                if(lwgeom_getType(geoms[i]->type) == CIRCSTRINGTYPE ||
                         lwgeom_getType(geoms[i]->type) == COMPOUNDTYPE)
                 {
                         hascurve = 1;
@@ -980,7 +980,7 @@ lwmline_desegmentize(LWMLINE *mline)
         for(i=0; i<mline->ngeoms; i++)
         {
                 geoms[i] = lwline_desegmentize((LWLINE *)mline->geoms[i]);
-                if(lwgeom_getType(geoms[i]->type) == CURVETYPE ||
+                if(lwgeom_getType(geoms[i]->type) == CIRCSTRINGTYPE ||
                         lwgeom_getType(geoms[i]->type) == COMPOUNDTYPE)
                 {
                         hascurve = 1;
index 2c8a54830f709e117fac147ea9df46c399f7b2fe..8bdb74dfdc9b7b71758298edcbd8bbee2909ff62 100644 (file)
@@ -63,7 +63,7 @@ typedef void  (*report_error)(const char* string, ...);
 #define LINETYPEI     11
 #define POLYGONTYPEI  12
 
-#define CURVETYPE       8
+#define CIRCSTRINGTYPE       8
 #define COMPOUNDTYPE    9
 #define CURVEPOLYTYPE   13
 #define MULTICURVETYPE          14
index 13cb349b4ea7835a5b14a10f8eebec45f5b41d1e..98985bcf7a579737712dc07d4354878ffb8343cf 100644 (file)
@@ -207,7 +207,7 @@ lwgeom_npoints(uchar *serialized)
                LWLINE *line=NULL;
                LWPOINT *point=NULL;
                LWPOLY *poly=NULL;
-               LWCURVE *curve=NULL;
+               LWCIRCSTRING *curve=NULL;
                uchar *subgeom=NULL;
 
                point = lwgeom_getpoint_inspected(inspected, i);
@@ -234,7 +234,7 @@ lwgeom_npoints(uchar *serialized)
                        continue;
                }
 
-               curve = lwgeom_getcurve_inspected(inspected, i);
+               curve = lwgeom_getcircstring_inspected(inspected, i);
                if (curve != NULL)
                {
                        npoints += curve->points->npoints;
@@ -500,7 +500,7 @@ lwgeom_force2d_recursive(uchar *serialized, uchar *optr, size_t *retsize)
        uchar newtypefl;
        LWPOINT *point = NULL;
        LWLINE *line = NULL;
-       LWCURVE *curve = NULL;
+       LWCIRCSTRING *curve = NULL;
        LWPOLY *poly = NULL;
        POINTARRAY newpts;
        POINTARRAY **nrings;
@@ -562,11 +562,11 @@ lwgeom_force2d_recursive(uchar *serialized, uchar *optr, size_t *retsize)
                return;
        }
 
-       if ( type == CURVETYPE )
+       if ( type == CIRCSTRINGTYPE )
        {
-               curve = lwcurve_deserialize(serialized);
+               curve = lwcircstring_deserialize(serialized);
 
-               LWDEBUGF(3, "lwgeom_force2d_recursize: it's a curve with %d points", curve->points->npoints);
+               LWDEBUGF(3, "lwgeom_force2d_recursize: it's a circularstring with %d points", curve->points->npoints);
 
                TYPE_SETZM(newpts.dims, 0, 0);
                newpts.npoints = curve->points->npoints;
@@ -583,7 +583,7 @@ lwgeom_force2d_recursive(uchar *serialized, uchar *optr, size_t *retsize)
                }
                curve->points = &newpts;
                TYPE_SETZM(curve->type, 0, 0);
-               lwcurve_serialize_buf(curve, optr, retsize);
+               lwcircstring_serialize_buf(curve, optr, retsize);
                lwfree(newpts.serialized_pointlist);
                lwfree(curve);
                return;
@@ -725,7 +725,7 @@ lwgeom_force3dz_recursive(uchar *serialized, uchar *optr, size_t *retsize)
        int type;
        LWPOINT *point = NULL;
        LWLINE *line = NULL;
-       LWCURVE *curve = NULL;
+       LWCIRCSTRING *curve = NULL;
        LWPOLY *poly = NULL;
        POINTARRAY newpts;
        POINTARRAY **nrings;
@@ -780,11 +780,11 @@ lwgeom_force3dz_recursive(uchar *serialized, uchar *optr, size_t *retsize)
                return;
        }
 
-       if ( type == CURVETYPE )
+       if ( type == CIRCSTRINGTYPE )
        {
-               curve = lwcurve_deserialize(serialized);
+               curve = lwcircstring_deserialize(serialized);
 
-               LWDEBUG(3, "lwgeom_force3dz_recursize: it's a curve");
+               LWDEBUG(3, "lwgeom_force3dz_recursize: it's a circularstring");
 
                TYPE_SETZM(newpts.dims, 1, 0);
                newpts.npoints = curve->points->npoints;
@@ -798,9 +798,9 @@ lwgeom_force3dz_recursive(uchar *serialized, uchar *optr, size_t *retsize)
                }
                curve->points = &newpts;
                TYPE_SETZM(curve->type, 1, 0);
-               lwcurve_serialize_buf(curve, optr, retsize);
+               lwcircstring_serialize_buf(curve, optr, retsize);
 
-               LWDEBUGF(3, "lwgeom_force3dz_recursive: it's a curve, size:%d", *retsize);
+               LWDEBUGF(3, "lwgeom_force3dz_recursive: it's a circularstring, size:%d", *retsize);
 
                return;
        }
@@ -912,7 +912,7 @@ lwgeom_force3dm_recursive(uchar *serialized, uchar *optr, size_t *retsize)
        uchar newtypefl;
        LWPOINT *point = NULL;
        LWLINE *line = NULL;
-       LWCURVE *curve = NULL;
+       LWCIRCSTRING *curve = NULL;
        LWPOLY *poly = NULL;
        POINTARRAY newpts;
        POINTARRAY **nrings;
@@ -974,11 +974,11 @@ lwgeom_force3dm_recursive(uchar *serialized, uchar *optr, size_t *retsize)
                return;
        }
 
-       if ( type == CURVETYPE )
+       if ( type == CIRCSTRINGTYPE )
        {
-               curve = lwcurve_deserialize(serialized);
+               curve = lwcircstring_deserialize(serialized);
 
-               LWDEBUGF(3, "lwgeom_force3dm_recursize: it's a curve with %d points", curve->points->npoints);
+               LWDEBUGF(3, "lwgeom_force3dm_recursize: it's a circularstring with %d points", curve->points->npoints);
 
                TYPE_SETZM(newpts.dims, 0, 1);
                newpts.npoints = curve->points->npoints;
@@ -993,7 +993,7 @@ lwgeom_force3dm_recursive(uchar *serialized, uchar *optr, size_t *retsize)
                }
                curve->points = &newpts;
                TYPE_SETZM(curve->type, 0, 1);
-               lwcurve_serialize_buf(curve, optr, retsize);
+               lwcircstring_serialize_buf(curve, optr, retsize);
                lwfree(newpts.serialized_pointlist);
                lwfree(curve);
                return;
@@ -1135,7 +1135,7 @@ lwgeom_force4d_recursive(uchar *serialized, uchar *optr, size_t *retsize)
        int type;
        LWPOINT *point = NULL;
        LWLINE *line = NULL;
-       LWCURVE *curve = NULL;
+       LWCIRCSTRING *curve = NULL;
        LWPOLY *poly = NULL;
        POINTARRAY newpts;
        POINTARRAY **nrings;
@@ -1189,9 +1189,9 @@ lwgeom_force4d_recursive(uchar *serialized, uchar *optr, size_t *retsize)
                return;
        }
 
-       if ( type == CURVETYPE )
+       if ( type == CIRCSTRINGTYPE )
        {
-               curve = lwcurve_deserialize(serialized);
+               curve = lwcircstring_deserialize(serialized);
                TYPE_SETZM(newpts.dims, 1, 1);
                newpts.npoints = curve->points->npoints;
                newpts.serialized_pointlist = lwalloc(sizeof(POINT4D)*curve->points->npoints);
@@ -1204,9 +1204,9 @@ lwgeom_force4d_recursive(uchar *serialized, uchar *optr, size_t *retsize)
                }
                curve->points = &newpts;
                TYPE_SETZM(curve->type, 1, 1);
-               lwcurve_serialize_buf(curve, optr, retsize);
+               lwcircstring_serialize_buf(curve, optr, retsize);
 
-               LWDEBUGF(3, "lwgeom_force4d_recursive: it's a curve, size:%d", *retsize);
+               LWDEBUGF(3, "lwgeom_force4d_recursive: it's a circularstring, size:%d", *retsize);
 
                return;
        }
@@ -3191,7 +3191,7 @@ lwgeom_affine_recursive(uchar *serialized,
                LWLINE *line=NULL;
                LWPOINT *point=NULL;
                LWPOLY *poly=NULL;
-               LWCURVE *curve=NULL;
+               LWCIRCSTRING *curve=NULL;
                uchar *subgeom=NULL;
 
                point = lwgeom_getpoint_inspected(inspected, i);
@@ -3233,7 +3233,7 @@ lwgeom_affine_recursive(uchar *serialized,
                        continue;
                }
 
-               curve = lwgeom_getcurve_inspected(inspected, i);
+               curve = lwgeom_getcircstring_inspected(inspected, i);
                if (curve != NULL)
                {
                        lwgeom_affine_ptarray(curve->points,
index 3d48a5c0153cdfb394a0c55ed40b0fa621e8db83..ce2d2525984087c0de91ca71340c6238cf4914f9 100644 (file)
@@ -77,7 +77,7 @@ Datum LWGEOM_isclosed_linestring(PG_FUNCTION_ARGS);
 static int32 lwgeom_numpoints_linestring_recursive(const uchar *serialized);
 static int32 lwgeom_dimension_recursive(const uchar *serialized);
 char line_is_closed(LWLINE *line);
-char curve_is_closed(LWCURVE *curve);
+char circstring_is_closed(LWCIRCSTRING *curve);
 char compound_is_closed(LWCOMPOUND *compound);
 
 /*------------------------------------------------------------------*/
@@ -132,7 +132,7 @@ Datum LWGEOM_getTYPE(PG_FUNCTION_ARGS)
                strcpy(result,"MULTIPOINT");
        else if (type == LINETYPE)
                strcpy(result,"LINESTRING");
-        else if (type == CURVETYPE)
+        else if (type == CIRCSTRINGTYPE)
                 strcpy(result,"CIRCULARSTRING");
         else if (type == COMPOUNDTYPE)
                 strcpy(result, "COMPOUNDCURVE");
@@ -277,7 +277,7 @@ Datum LWGEOM_geometryn_collection(PG_FUNCTION_ARGS)
        /* elog(NOTICE, "GeometryN called"); */
 
        /* call is valid on multi* geoms only */
-       if (type==POINTTYPE || type==LINETYPE || type==CURVETYPE ||
+       if (type==POINTTYPE || type==LINETYPE || type==CIRCSTRINGTYPE ||
                 type==COMPOUNDTYPE || type==POLYGONTYPE || type==CURVEPOLYTYPE)
        {
                /* elog(NOTICE, "geometryn: geom is of type %d, requires >=4", type); */
@@ -342,7 +342,7 @@ lwgeom_dimension_recursive(const uchar *serialized)
                if ( type == POINTTYPE ) dims = 0;
                else if ( type == MULTIPOINTTYPE ) dims=0;
                else if ( type == LINETYPE ) dims=1;
-                else if ( type == CURVETYPE ) dims=1;
+                else if ( type == CIRCSTRINGTYPE ) dims=1;
                 else if ( type == COMPOUNDTYPE ) dims=1;
                else if ( type == MULTILINETYPE ) dims=1;
                 else if ( type == MULTICURVETYPE ) dims=1;
@@ -622,7 +622,7 @@ Datum LWGEOM_pointn_linestring(PG_FUNCTION_ARGS)
        int32 wanted_index;
        LWGEOM_INSPECTED *inspected;
        LWLINE *line = NULL;
-        LWCURVE *curve = NULL;
+        LWCIRCSTRING *curve = NULL;
         LWGEOM *tmp = NULL;
        POINTARRAY *pts;
        LWPOINT *point;
@@ -649,7 +649,7 @@ Datum LWGEOM_pointn_linestring(PG_FUNCTION_ARGS)
                {
                        tmp = lwgeom_getgeom_inspected(inspected, i);
                        if (lwgeom_getType(tmp->type) == LINETYPE ||
-                                lwgeom_getType(tmp->type) == CURVETYPE) 
+                                lwgeom_getType(tmp->type) == CIRCSTRINGTYPE) 
                             break;
                }
 
@@ -658,9 +658,9 @@ Datum LWGEOM_pointn_linestring(PG_FUNCTION_ARGS)
                        PG_FREE_IF_COPY(geom, 0);
                        PG_RETURN_NULL();
                }
-                if(lwgeom_getType(tmp->type) == CURVETYPE)
+                if(lwgeom_getType(tmp->type) == CIRCSTRINGTYPE)
                 {
-                        curve = (LWCURVE *)tmp;
+                        curve = (LWCIRCSTRING *)tmp;
                         if(wanted_index > curve->points->npoints)
                         {
                                 lwinspected_release(inspected);
@@ -1155,11 +1155,11 @@ char line_is_closed(LWLINE *line)
        return 1;
 }
 
-char curve_is_closed(LWCURVE *curve)
+char circstring_is_closed(LWCIRCSTRING *curve)
 {
         POINT3DZ sp, ep;
 
-        LWDEBUG(2, "curve_is_closed called.");
+        LWDEBUG(2, "circstring_is_closed called.");
 
         getPoint3dz_p(curve->points, 0, &sp);
         getPoint3dz_p(curve->points, curve->points->npoints-1, &ep);
@@ -1187,7 +1187,7 @@ char compound_is_closed(LWCOMPOUND *compound)
         }
         else 
         {
-                getPoint3dz_p(((LWCURVE *)tmp)->points, 0, &sp);
+                getPoint3dz_p(((LWCIRCSTRING *)tmp)->points, 0, &sp);
         }
 
         tmp = compound->geoms[compound->ngeoms - 1];
@@ -1197,7 +1197,7 @@ char compound_is_closed(LWCOMPOUND *compound)
         }
         else
         {
-                getPoint3dz_p(((LWCURVE *)tmp)->points, ((LWCURVE *)tmp)->points->npoints - 1, &ep);
+                getPoint3dz_p(((LWCIRCSTRING *)tmp)->points, ((LWCIRCSTRING *)tmp)->points->npoints - 1, &ep);
         }
 
         if(sp.x != ep.x) return 0;
@@ -1258,8 +1258,8 @@ Datum LWGEOM_isclosed_linestring(PG_FUNCTION_ARGS)
                         PG_FREE_IF_COPY(geom, 0);
                         PG_RETURN_BOOL(FALSE);
                 }
-                else if(lwgeom_getType(sub->type) == CURVETYPE &&
-                        !curve_is_closed((LWCURVE *)sub))
+                else if(lwgeom_getType(sub->type) == CIRCSTRINGTYPE &&
+                        !circstring_is_closed((LWCIRCSTRING *)sub))
                 {
                         lwgeom_release(sub);
                         lwinspected_release(inspected);
index 5cb9d14e1da11faef482727a93b8f632eadd5ed9..ae671e4f18ff88025d4d8573358447d580ab0e12 100644 (file)
@@ -662,7 +662,7 @@ lwgeom_transform_recursive(uchar *geom, PJ *inpj, PJ *outpj)
                LWLINE *line=NULL;
                LWPOINT *point=NULL;
                LWPOLY *poly=NULL;
-               LWCURVE *curve=NULL;
+               LWCIRCSTRING *curve=NULL;
                POINT4D p;
                uchar *subgeom=NULL;
 
@@ -708,7 +708,7 @@ lwgeom_transform_recursive(uchar *geom, PJ *inpj, PJ *outpj)
                        continue;
                }
 
-               curve = lwgeom_getcurve_inspected(inspected, j);
+               curve = lwgeom_getcircstring_inspected(inspected, j);
                if (curve != NULL)
                {
                        POINTARRAY *pts = curve->points;