[postgis-tickets] r15242 - Remove trailing blankspaces
Sandro Santilli
strk at kbt.io
Mon Nov 21 07:27:19 PST 2016
Author: strk
Date: 2016-11-21 07:27:19 -0800 (Mon, 21 Nov 2016)
New Revision: 15242
Modified:
trunk/liblwgeom/lwgeom_api.c
trunk/liblwgeom/lwgeom_geos.c
Log:
Remove trailing blankspaces
Modified: trunk/liblwgeom/lwgeom_api.c
===================================================================
--- trunk/liblwgeom/lwgeom_api.c 2016-11-21 15:27:12 UTC (rev 15241)
+++ trunk/liblwgeom/lwgeom_api.c 2016-11-21 15:27:19 UTC (rev 15242)
@@ -503,7 +503,7 @@
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 @@
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");
Modified: trunk/liblwgeom/lwgeom_geos.c
===================================================================
--- trunk/liblwgeom/lwgeom_geos.c 2016-11-21 15:27:12 UTC (rev 15241)
+++ trunk/liblwgeom/lwgeom_geos.c 2016-11-21 15:27:19 UTC (rev 15242)
@@ -246,7 +246,7 @@
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 @@
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 @@
for (i=0; i<ngeoms; ++i)
{
GEOSGeometry* g;
-
+
if( lwgeom_is_empty(lwc->geoms[i]) )
continue;
-
+
g = LWGEOM2GEOS(lwc->geoms[i], 0);
if ( ! g )
{
@@ -1403,7 +1403,7 @@
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_errmsg);
}
return geom_out;
-
+
}
LWGEOM*
@@ -1693,13 +1693,13 @@
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 @@
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 @@
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 @@
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 @@
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 @@
}
}
shuffle(cells, sample_height*sample_width, 2*sizeof(int));
-
+
/* Start testing points */
while (npoints_generated < npoints)
{
@@ -1795,7 +1795,7 @@
gpt = GEOSGeom_createPoint(gseq);
contains = GEOSPreparedIntersects(gprep, gpt);
-
+
GEOSGeom_destroy(gpt);
if (contains == 2)
@@ -1815,23 +1815,23 @@
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 @@
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 @@
}
}
}
-
+
return mpt;
}
@@ -1900,7 +1900,7 @@
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 @@
}
return lwgeom_result;
-
+
#endif /* POSTGIS_GEOS_VERSION < 34 */
}
More information about the postgis-tickets
mailing list