From: Sandro Santilli Date: Mon, 21 Nov 2016 15:27:19 +0000 (+0000) Subject: Remove trailing blankspaces X-Git-Tag: 2.4.0alpha~206 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71c96c3c5b6549b5b539744dbc9d30a45b88fcb7;p=postgis Remove trailing blankspaces git-svn-id: http://svn.osgeo.org/postgis/trunk@15242 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/lwgeom_api.c b/liblwgeom/lwgeom_api.c index deb1071e3..a3fe27774 100644 --- a/liblwgeom/lwgeom_api.c +++ b/liblwgeom/lwgeom_api.c @@ -503,7 +503,7 @@ const POINT3DZ* getPoint3dz_cp(const POINTARRAY *pa, int n) { if ( ! pa ) return 0; - + if ( ! FLAGS_GET_Z(pa->flags) ) { lwerror("getPoint3dz_cp: no Z coordinates in point array"); @@ -524,7 +524,7 @@ const POINT4D* getPoint4d_cp(const POINTARRAY *pa, int n) { if ( ! pa ) return 0; - + if ( ! (FLAGS_GET_Z(pa->flags) && FLAGS_GET_Z(pa->flags)) ) { lwerror("getPoint3dz_cp: no Z and M coordinates in point array"); diff --git a/liblwgeom/lwgeom_geos.c b/liblwgeom/lwgeom_geos.c index c9a7dcd20..64659dec0 100644 --- a/liblwgeom/lwgeom_geos.c +++ b/liblwgeom/lwgeom_geos.c @@ -246,7 +246,7 @@ ptarray_to_GEOSCoordSeq(const POINTARRAY *pa) GEOSCoordSeq_setX(sq, i, p2d->x); GEOSCoordSeq_setY(sq, i, p2d->y); - + if ( dims == 3 ) GEOSCoordSeq_setZ(sq, i, p3d->z); } @@ -350,17 +350,17 @@ LWGEOM2GEOS(const LWGEOM *lwgeom, int autofix) lwgeom_free(lwgeom_stroked); return g; } - + switch (lwgeom->type) { LWPOINT *lwp = NULL; LWPOLY *lwpoly = NULL; LWLINE *lwl = NULL; LWCOLLECTION *lwc = NULL; - + case POINTTYPE: lwp = (LWPOINT *)lwgeom; - + if ( lwgeom_is_empty(lwgeom) ) { g = GEOSGeom_createEmptyPolygon(); @@ -451,10 +451,10 @@ LWGEOM2GEOS(const LWGEOM *lwgeom, int autofix) for (i=0; igeoms[i]) ) continue; - + g = LWGEOM2GEOS(lwc->geoms[i], 0); if ( ! g ) { @@ -1403,7 +1403,7 @@ lwgeom_buildarea(const LWGEOM *geom) initGEOS(lwnotice, lwgeom_geos_error); geos_in = LWGEOM2GEOS(geom, 0); - + if ( 0 == geos_in ) /* exception thrown at construction */ { lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg); @@ -1496,7 +1496,7 @@ lwgeom_geos_noop(const LWGEOM* geom_in) lwgeom_geos_errmsg); } return geom_out; - + } LWGEOM* @@ -1693,13 +1693,13 @@ lwpoly_to_points(const LWPOLY *lwpoly, int npoints) lwerror("%s: only polygons supported", __func__); return NULL; } - + if (npoints == 0 || lwgeom_is_empty(lwgeom)) { return NULL; // return lwmpoint_construct_empty(lwgeom_get_srid(poly), lwgeom_has_z(poly), lwgeom_has_m(poly)); } - + if (!lwpoly->bbox) { lwgeom_calculate_gbox(lwgeom, &bbox); @@ -1718,11 +1718,11 @@ lwpoly_to_points(const LWPOLY *lwpoly, int npoints) lwerror("%s: zero area input polygon, TBD", __func__); return NULL; } - + /* Gross up our test set a bit to increase odds of getting */ /* coverage in one pass */ sample_npoints = npoints * bbox_area / area; - + /* We're going to generate points using a sample grid */ /* as described http://lin-ear-th-inking.blogspot.ca/2010/05/more-random-points-in-jts.html */ /* to try and get a more uniform "random" set of points */ @@ -1730,7 +1730,7 @@ lwpoly_to_points(const LWPOLY *lwpoly, int npoints) sample_sqrt = lround(sqrt(sample_npoints)); if (sample_sqrt == 0) sample_sqrt = 1; - + /* Calculate the grids we're going to randomize within */ if (bbox_width > bbox_height) { @@ -1744,7 +1744,7 @@ lwpoly_to_points(const LWPOLY *lwpoly, int npoints) sample_width = ceil((double)sample_npoints / (double)sample_height); sample_cell_size = bbox_height / sample_height; } - + /* Prepare the polygon for fast true/false testing */ initGEOS(lwnotice, lwgeom_geos_error); g = (GEOSGeometry *)LWGEOM2GEOS(lwgeom, 0); @@ -1754,10 +1754,10 @@ lwpoly_to_points(const LWPOLY *lwpoly, int npoints) return NULL; } gprep = GEOSPrepare(g); - + /* Get an empty multi-point ready to return */ mpt = lwmpoint_construct_empty(srid, 0, 0); - + /* Init random number generator */ srand(time(NULL)); @@ -1774,7 +1774,7 @@ lwpoly_to_points(const LWPOLY *lwpoly, int npoints) } } shuffle(cells, sample_height*sample_width, 2*sizeof(int)); - + /* Start testing points */ while (npoints_generated < npoints) { @@ -1795,7 +1795,7 @@ lwpoly_to_points(const LWPOLY *lwpoly, int npoints) gpt = GEOSGeom_createPoint(gseq); contains = GEOSPreparedIntersects(gprep, gpt); - + GEOSGeom_destroy(gpt); if (contains == 2) @@ -1815,23 +1815,23 @@ lwpoly_to_points(const LWPOLY *lwpoly, int npoints) break; } } - + /* Short-circuit check for ctrl-c occasionally */ npoints_tested++; if (npoints_tested % 10000 == 0) { LW_ON_INTERRUPT(GEOSPreparedGeom_destroy(gprep); GEOSGeom_destroy(g); return NULL); } - + if (done) break; } if (done || iterations > 100) break; } - + GEOSPreparedGeom_destroy(gprep); GEOSGeom_destroy(g); lwfree(cells); - + return mpt; } @@ -1847,19 +1847,19 @@ lwmpoly_to_points(const LWMPOLY *lwmpoly, int npoints) double area; int i; LWMPOINT *mpt = NULL; - + if (lwgeom_get_type(lwgeom) != MULTIPOLYGONTYPE) { lwerror("%s: only multipolygons supported", __func__); - return NULL; + return NULL; } if (npoints == 0 || lwgeom_is_empty(lwgeom)) { return NULL; } - + area = lwgeom_area(lwgeom); - + for (i = 0; i < lwmpoly->ngeoms; i++) { double sub_area = lwpoly_area(lwmpoly->geoms[i]); @@ -1884,7 +1884,7 @@ lwmpoly_to_points(const LWMPOLY *lwmpoly, int npoints) } } } - + return mpt; } @@ -1900,7 +1900,7 @@ lwgeom_to_points(const LWGEOM *lwgeom, int npoints) return lwpoly_to_points((LWPOLY*)lwgeom, npoints); default: lwerror("%s: unsupported geometry type '%s'", __func__, lwtype_name(lwgeom_get_type(lwgeom))); - return NULL; + return NULL; } } @@ -2028,7 +2028,7 @@ LWGEOM* lwgeom_delaunay_triangulation(const LWGEOM *lwgeom_in, double tolerance, } return lwgeom_result; - + #endif /* POSTGIS_GEOS_VERSION < 34 */ }