]> granicus.if.org Git - postgis/commitdiff
Anal retentive function renaming: ptarray_isclosed -> ptarray_is_closed
authorPaul Ramsey <pramsey@cleverelephant.ca>
Fri, 28 Sep 2012 21:08:29 +0000 (21:08 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Fri, 28 Sep 2012 21:08:29 +0000 (21:08 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@10339 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/liblwgeom.h.in
liblwgeom/lwcircstring.c
liblwgeom/lwgeom_geos_clean.c
liblwgeom/lwin_wkb.c
liblwgeom/lwin_wkt.c
liblwgeom/lwline.c
liblwgeom/lwpoly.c
liblwgeom/lwtriangle.c
liblwgeom/ptarray.c
postgis/lwgeom_in_gml.c
postgis/lwgeom_in_kml.c

index 767aade1a3f5b7654b86f7785dce13bf532919b3..d80b9d0a860ac8bfac5d10bd84e1bcd6275dd446 100644 (file)
@@ -852,10 +852,10 @@ extern int ptarray_remove_point(POINTARRAY *pa, int where);
 extern POINTARRAY *ptarray_addPoint(const POINTARRAY *pa, uint8_t *p, size_t pdims, uint32_t where);
 extern POINTARRAY *ptarray_removePoint(POINTARRAY *pa, uint32_t where);
 extern POINTARRAY *ptarray_merge(POINTARRAY *pa1, POINTARRAY *pa2);
-extern int ptarray_isclosed(const POINTARRAY *pa);
-extern int ptarray_isclosed2d(const POINTARRAY *pa);
-extern int ptarray_isclosed3d(const POINTARRAY *pa);
-extern int ptarray_isclosedz(const POINTARRAY *pa);
+extern int ptarray_is_closed(const POINTARRAY *pa);
+extern int ptarray_is_closed_2d(const POINTARRAY *pa);
+extern int ptarray_is_closed_3d(const POINTARRAY *pa);
+extern int ptarray_is_closed_z(const POINTARRAY *pa);
 extern void ptarray_longitude_shift(POINTARRAY *pa);
 extern void ptarray_reverse(POINTARRAY *pa);
 extern POINTARRAY* ptarray_flip_coordinates(POINTARRAY *pa);
index 86b76ee8041c013fbe4454206273cdbdd3cbd33e..41c16574fe5443716ea227547c166a0727708977 100644 (file)
@@ -255,9 +255,9 @@ int
 lwcircstring_is_closed(const LWCIRCSTRING *curve)
 {
        if (FLAGS_GET_Z(curve->flags))
-               return ptarray_isclosed3d(curve->points);
+               return ptarray_is_closed_3d(curve->points);
 
-       return ptarray_isclosed2d(curve->points);
+       return ptarray_is_closed_2d(curve->points);
 }
 
 int lwcircstring_is_empty(const LWCIRCSTRING *circ)
index f0ec20faab068b83904c1bcdc59fcbfefd28d01d..1d89a70b3d3173c0dee7a3ce392a7e7872012a6c 100644 (file)
@@ -189,7 +189,7 @@ ptarray_close2d(POINTARRAY* ring)
        POINTARRAY* newring;
 
        /* close the ring if not already closed (2d only) */
-       if ( ! ptarray_isclosed2d(ring) )
+       if ( ! ptarray_is_closed_2d(ring) )
        {
                /* close it up */
                newring = ptarray_addPoint(ring,
index 769cb2adbf6e612f3619caebb07a5ce0422a074a..1a873526f42395ebed2e7d2fb0405a30752f4c2c 100644 (file)
@@ -485,7 +485,7 @@ static LWPOLY* lwpoly_from_wkb_state(wkb_parse_state *s)
                }
 
                /* Check that first and last points are the same. */
-               if( s->check & LW_PARSER_CHECK_CLOSURE && ! ptarray_isclosed2d(pa) )
+               if( s->check & LW_PARSER_CHECK_CLOSURE && ! ptarray_is_closed_2d(pa) )
                {
                        LWDEBUGF(2, "%s must have closed rings", lwtype_name(s->lwtype));
                        lwerror("%s must have closed rings", lwtype_name(s->lwtype));
@@ -540,13 +540,13 @@ static LWTRIANGLE* lwtriangle_from_wkb_state(wkb_parse_state *s)
                return NULL;
        }
 
-       if( s->check & LW_PARSER_CHECK_CLOSURE && ! ptarray_isclosed(pa) )
+       if( s->check & LW_PARSER_CHECK_CLOSURE && ! ptarray_is_closed(pa) )
        {
                lwerror("%s must have closed rings", lwtype_name(s->lwtype));
                return NULL;
        }
 
-       if( s->check & LW_PARSER_CHECK_ZCLOSURE && ! ptarray_isclosedz(pa) )
+       if( s->check & LW_PARSER_CHECK_ZCLOSURE && ! ptarray_is_closed_z(pa) )
        {
                lwerror("%s must have closed rings", lwtype_name(s->lwtype));
                return NULL;
index c74c167095ed1353dc6acb00435595c1a917cc18..1bd74f1c871edc6f2590731045c52c15fc343e41 100644 (file)
@@ -420,7 +420,7 @@ LWGEOM* wkt_parser_triangle_new(POINTARRAY *pa, char *dimensionality)
        }       
        
        /* Triangles need closure. */   
-       if( ! ptarray_isclosed(pa) )
+       if( ! ptarray_is_closed(pa) )
        {
                ptarray_free(pa);
                SET_PARSER_ERROR(PARSER_ERROR_UNCLOSED);
@@ -486,7 +486,7 @@ LWGEOM* wkt_parser_polygon_add_ring(LWGEOM *poly, POINTARRAY *pa, char dimcheck)
        
        /* Apply check for not closed rings, if requested. */   
        if( (global_parser_result.parser_check_flags & LW_PARSER_CHECK_CLOSURE) && 
-           ! (dimcheck == 'Z' ? ptarray_isclosedz(pa) : ptarray_isclosed2d(pa)) )
+           ! (dimcheck == 'Z' ? ptarray_is_closed_z(pa) : ptarray_is_closed_2d(pa)) )
        {
                ptarray_free(pa);
                lwgeom_free(poly);
index a902ea64adcf79ee8de210cd0374bef6626923c5..c46585db9e54d6e350cfc6b249e5bdb67edd6964 100644 (file)
@@ -428,9 +428,9 @@ int
 lwline_is_closed(const LWLINE *line)
 {
        if (FLAGS_GET_Z(line->flags))
-               return ptarray_isclosed3d(line->points);
+               return ptarray_is_closed_3d(line->points);
 
-       return ptarray_isclosed2d(line->points);
+       return ptarray_is_closed_2d(line->points);
 }
 
 
index 0589744849e54466933deff0468322f96d5db06b..105fcc3d5fd15fde40b6fffd9de103cc2babee7a 100644 (file)
@@ -256,7 +256,7 @@ lwpoly_from_lwlines(const LWLINE *shell,
 
        if ( shell->points->npoints < 4 )
                lwerror("lwpoly_from_lwlines: shell must have at least 4 points");
-       if ( ! ptarray_isclosed2d(shell->points) )
+       if ( ! ptarray_is_closed_2d(shell->points) )
                lwerror("lwpoly_from_lwlines: shell must be closed");
        rings[0] = ptarray_clone_deep(shell->points);
 
@@ -269,7 +269,7 @@ lwpoly_from_lwlines(const LWLINE *shell,
 
                if ( hole->points->npoints < 4 )
                        lwerror("lwpoly_from_lwlines: holes must have at least 4 points");
-               if ( ! ptarray_isclosed2d(hole->points) )
+               if ( ! ptarray_is_closed_2d(hole->points) )
                        lwerror("lwpoly_from_lwlines: holes must be closed");
 
                rings[nrings] = ptarray_clone_deep(hole->points);
@@ -486,12 +486,12 @@ lwpoly_is_closed(const LWPOLY *poly)
        {
                if (FLAGS_GET_Z(poly->flags))
                {
-                       if ( ! ptarray_isclosed3d(poly->rings[i]) )
+                       if ( ! ptarray_is_closed_3d(poly->rings[i]) )
                                return LW_FALSE;
                }
                else
                {       
-                       if ( ! ptarray_isclosed2d(poly->rings[i]) )
+                       if ( ! ptarray_is_closed_2d(poly->rings[i]) )
                                return LW_FALSE;
                }
        }
index 22dc408b62c12990f919c595f08ce32be926570c..d36f5a98b8b4cbf7c1d8a6c8f673a9124cf86f92 100644 (file)
@@ -133,8 +133,8 @@ lwtriangle_from_lwline(const LWLINE *shell)
        if ( shell->points->npoints != 4 )
                lwerror("lwtriangle_from_lwline: shell must have exactly 4 points");
 
-       if (   (!FLAGS_GET_Z(shell->flags) && !ptarray_isclosed2d(shell->points)) ||
-               (FLAGS_GET_Z(shell->flags) && !ptarray_isclosed3d(shell->points)) )
+       if (   (!FLAGS_GET_Z(shell->flags) && !ptarray_is_closed_2d(shell->points)) ||
+               (FLAGS_GET_Z(shell->flags) && !ptarray_is_closed_3d(shell->points)) )
                lwerror("lwtriangle_from_lwline: shell must be closed");
 
        pa = ptarray_clone_deep(shell->points);
index 571f3f7db1940a7e41ec556e2ee0fbcc1a7883a3..b7a4504acf570a62435d775c184a97742e730019 100644 (file)
@@ -662,31 +662,31 @@ ptarray_clone(const POINTARRAY *in)
 * pointarray.
 */
 int
-ptarray_isclosed(const POINTARRAY *in)
+ptarray_is_closed(const POINTARRAY *in)
 {
        return 0 == memcmp(getPoint_internal(in, 0), getPoint_internal(in, in->npoints-1), ptarray_point_size(in));
 }
 
 
 int
-ptarray_isclosed2d(const POINTARRAY *in)
+ptarray_is_closed_2d(const POINTARRAY *in)
 {
        return 0 == memcmp(getPoint_internal(in, 0), getPoint_internal(in, in->npoints-1), sizeof(POINT2D));
 }
 
 int
-ptarray_isclosed3d(const POINTARRAY *in)
+ptarray_is_closed_3d(const POINTARRAY *in)
 {
        return 0 == memcmp(getPoint_internal(in, 0), getPoint_internal(in, in->npoints-1), sizeof(POINT3D));
 }
 
 int
-ptarray_isclosedz(const POINTARRAY *in)
+ptarray_is_closed_z(const POINTARRAY *in)
 {
        if ( FLAGS_GET_Z(in->flags) )
-               return ptarray_isclosed3d(in);
+               return ptarray_is_closed_3d(in);
        else
-               return ptarray_isclosed2d(in);
+               return ptarray_is_closed_2d(in);
 }
 
 
index ab0046bc34bd7b3998036fff949a932702c049c5..f40e814eac1e5d0ef91e4f2917d641d7da5e8fbe 100644 (file)
@@ -1107,8 +1107,8 @@ static LWGEOM* parse_gml_linearring(xmlNodePtr xnode, bool *hasz, int *root_srid
        ppa[0] = parse_gml_data(xnode->children, hasz, root_srid);
 
        if (ppa[0]->npoints < 4
-            || (!*hasz && !ptarray_isclosed2d(ppa[0]))
-            ||  (*hasz && !ptarray_isclosed3d(ppa[0])))
+            || (!*hasz && !ptarray_is_closed_2d(ppa[0]))
+            ||  (*hasz && !ptarray_is_closed_3d(ppa[0])))
            gml_lwerror("invalid GML representation", 42);
 
        if (srs.reverse_axis) 
@@ -1160,8 +1160,8 @@ static LWGEOM* parse_gml_polygon(xmlNodePtr xnode, bool *hasz, int *root_srid)
                        ppa[0] = parse_gml_data(xb->children, hasz, root_srid);
 
                        if (ppa[0]->npoints < 4
-                               || (!*hasz && !ptarray_isclosed2d(ppa[0]))
-                               ||  (*hasz && !ptarray_isclosed3d(ppa[0])))
+                               || (!*hasz && !ptarray_is_closed_2d(ppa[0]))
+                               ||  (*hasz && !ptarray_is_closed_3d(ppa[0])))
                                gml_lwerror("invalid GML representation", 43);
 
                        if (srs.reverse_axis) ppa[0] = ptarray_flip_coordinates(ppa[0]);
@@ -1192,8 +1192,8 @@ static LWGEOM* parse_gml_polygon(xmlNodePtr xnode, bool *hasz, int *root_srid)
                        ppa[ring] = parse_gml_data(xb->children, hasz, root_srid);
 
                        if (ppa[ring]->npoints < 4
-                               || (!*hasz && !ptarray_isclosed2d(ppa[ring]))
-                               ||  (*hasz && !ptarray_isclosed3d(ppa[ring])))
+                               || (!*hasz && !ptarray_is_closed_2d(ppa[ring]))
+                               ||  (*hasz && !ptarray_is_closed_3d(ppa[ring])))
                                gml_lwerror("invalid GML representation", 43);
 
                        if (srs.reverse_axis) ppa[ring] = ptarray_flip_coordinates(ppa[ring]);
@@ -1262,8 +1262,8 @@ static LWGEOM* parse_gml_triangle(xmlNodePtr xnode, bool *hasz, int *root_srid)
                        pa = parse_gml_data(xb->children, hasz, root_srid);
 
                        if (pa->npoints != 4
-                               || (!*hasz && !ptarray_isclosed2d(pa))
-                               ||  (*hasz && !ptarray_isclosed3d(pa)))
+                               || (!*hasz && !ptarray_is_closed_2d(pa))
+                               ||  (*hasz && !ptarray_is_closed_3d(pa)))
                                gml_lwerror("invalid GML representation", 46);
 
                        if (srs.reverse_axis) pa = ptarray_flip_coordinates(pa);
@@ -1326,8 +1326,8 @@ static LWGEOM* parse_gml_patch(xmlNodePtr xnode, bool *hasz, int *root_srid)
                        ppa[0] = parse_gml_data(xb->children, hasz, root_srid);
 
                        if (ppa[0]->npoints < 4
-                               || (!*hasz && !ptarray_isclosed2d(ppa[0]))
-                               ||  (*hasz && !ptarray_isclosed3d(ppa[0])))
+                               || (!*hasz && !ptarray_is_closed_2d(ppa[0]))
+                               ||  (*hasz && !ptarray_is_closed_3d(ppa[0])))
                                gml_lwerror("invalid GML representation", 48);
 
                        if (srs.reverse_axis)
@@ -1353,8 +1353,8 @@ static LWGEOM* parse_gml_patch(xmlNodePtr xnode, bool *hasz, int *root_srid)
                        ppa[ring] = parse_gml_data(xb->children, hasz, root_srid);
 
                        if (ppa[ring]->npoints < 4
-                               || (!*hasz && !ptarray_isclosed2d(ppa[ring]))
-                               || ( *hasz && !ptarray_isclosed3d(ppa[ring])))
+                               || (!*hasz && !ptarray_is_closed_2d(ppa[ring]))
+                               || ( *hasz && !ptarray_is_closed_3d(ppa[ring])))
                                gml_lwerror("invalid GML representation", 49);
 
                        if (srs.reverse_axis)
index 6b01f2153dbc9f4ddce5ae42a608841e3c490c10..bfedeb737837f51ea3ac1a9cb79ba9033c3005c7 100644 (file)
@@ -397,8 +397,8 @@ static LWGEOM* parse_kml_polygon(xmlNodePtr xnode, bool *hasz)
                        ppa[0] = parse_kml_coordinates(xb->children, hasz);
 
                        if (ppa[0]->npoints < 4
-                               || (!*hasz && !ptarray_isclosed2d(ppa[0]))
-                               ||  (*hasz && !ptarray_isclosed3d(ppa[0])))
+                               || (!*hasz && !ptarray_is_closed_2d(ppa[0]))
+                               ||  (*hasz && !ptarray_is_closed_3d(ppa[0])))
                                lwerror("invalid KML representation");
                }
        }
@@ -423,8 +423,8 @@ static LWGEOM* parse_kml_polygon(xmlNodePtr xnode, bool *hasz)
                        ppa[ring] = parse_kml_coordinates(xb->children, hasz);
 
                        if (ppa[ring]->npoints < 4
-                               || (!*hasz && !ptarray_isclosed2d(ppa[ring]))
-                               ||  (*hasz && !ptarray_isclosed3d(ppa[ring])))
+                               || (!*hasz && !ptarray_is_closed_2d(ppa[ring]))
+                               ||  (*hasz && !ptarray_is_closed_3d(ppa[ring])))
                                lwerror("invalid KML representation");
 
                        ring++;