#include "lwalgorithm.h"
-/*
+/**
** lw_segment_side()
**
** Return < 0.0 if point Q is left of segment P
}
if ( FP_MIN(p1_value, p2_value) > interpolation_value ||
- FP_MAX(p1_value, p2_value) < interpolation_value )
+ FP_MAX(p1_value, p2_value) < interpolation_value )
{
lwerror("Cannot interpolate to a value (%g) not between the input points (%g, %g).", interpolation_value, p1_value, p2_value);
return 0;
* If we're on a boundary and crossing from the far side,
* we also need an interpolated point. */
if ( i > 0 && ( /* Don't try to interpolate if this is the first point */
- ( ordinate_value_p > from && ordinate_value_p < to ) || /* Inside */
- ( ordinate_value_p == from && ordinate_value_q > to ) || /* Hopping from above */
- ( ordinate_value_p == to && ordinate_value_q < from ) ) ) /* Hopping from below */
+ ( ordinate_value_p > from && ordinate_value_p < to ) || /* Inside */
+ ( ordinate_value_p == from && ordinate_value_q > to ) || /* Hopping from above */
+ ( ordinate_value_p == to && ordinate_value_q < from ) ) ) /* Hopping from below */
{
double interpolation_value;
(ordinate_value_q > to) ? (interpolation_value = to) : (interpolation_value = from);
* If the last point was the near boundary, nothing to do.
* If it was the far boundary, we need an interpolated point. */
if ( from != to && (
- (ordinate_value_q == from && ordinate_value_p > from) ||
- (ordinate_value_q == to && ordinate_value_p < to) ) )
+ (ordinate_value_q == from && ordinate_value_p > from) ||
+ (ordinate_value_q == to && ordinate_value_p < to) ) )
{
double interpolation_value;
(ordinate_value_p > to) ? (interpolation_value = to) : (interpolation_value = from);
iy = hy&0x7fffffff; /* |y| */
if ((ix>0x7f800000) || /* x is nan */
- (iy>0x7f800000)) /* y is nan */
+ (iy>0x7f800000)) /* y is nan */
return x+y;
if (x==y) return y; /* x=y, return y */
if (ix==0)
#endif
LWDEBUGF(2, "getPoint3dz_p called on array of %d-dimensions / %u pts",
- TYPE_NDIMS(pa->dims), pa->npoints);
+ TYPE_NDIMS(pa->dims), pa->npoints);
/* Get a pointer to nth point offset */
ptr=getPoint_internal(pa, n);
#endif
LWDEBUGF(2, "getPoint3dm_p(%d) called on array of %d-dimensions / %u pts",
- n, TYPE_NDIMS(pa->dims), pa->npoints);
+ n, TYPE_NDIMS(pa->dims), pa->npoints);
/* Get a pointer to nth point offset and zmflag */
}
/*
- * Otherwise copy the 2d part and
+ * Otherwise copy the 2d part and
* initialize M to NO_M_VALUE
*/
memcpy(op, ptr, sizeof(POINT2D));
loc +=4;
LWDEBUGF(3, "lwgeom_inspect: geometry is a collection of %d elements",
- result->ngeometries);
+ result->ngeometries);
if ( ! result->ngeometries ) return result;
sub_geoms[t] = sub_geoms[t-1] + sub_length;
LWDEBUGF(3, "subgeom[%d] @ %p (+%d)",
- t, sub_geoms[t], sub_geoms[0]-serialized_form);
+ t, sub_geoms[t], sub_geoms[0]-serialized_form);
}
return result;
uchar *loc;
if ( (type==POINTTYPE) || (type==LINETYPE) || (type==POLYGONTYPE) ||
- (type==CIRCSTRINGTYPE) || (type==COMPOUNDTYPE) || (type==CURVEPOLYTYPE) )
+ (type==CIRCSTRINGTYPE) || (type==COMPOUNDTYPE) || (type==CURVEPOLYTYPE) )
{
return 1;
}
*/
uchar *
lwgeom_serialized_construct(int SRID, int finalType, char hasz, char hasm,
- int nsubgeometries, uchar **serialized_subs)
+ int nsubgeometries, uchar **serialized_subs)
{
uint32 *lengths;
int t;
return size;
}
-/*
+/**
* Construct the empty geometry (GEOMETRYCOLLECTION(EMPTY))
* writing it into the provided buffer.
*/
void
lwgeom_constructempty_buf(int SRID, char hasz, char hasm,
- uchar *buf, size_t *retsize)
+ uchar *buf, size_t *retsize)
{
int ngeoms = 0;
if (retsize) *retsize = lwgeom_empty_length(SRID);
}
-/*
+/**
* helper function (not for general use)
* find the size a geometry (or a sub-geometry)
* 1st geometry has geom_number = 0
return 1;
}
-/*
+/**
* Compute bounding box of a serialized LWGEOM, even if it is
* already cached. The computed BOX2DFLOAT4 is stored at
* the given location, the function returns 0 is the geometry
return 1;
}
-/*
+/**
* Don't forget to lwfree() result !
*/
BOX3D *
}
/*
- ** For items that have elements (everything except points),
+ ** For items that have elements (everything except points),
** nelems == 0 => EMPTY geometry
*/
nelems = lw_get_uint32(loc);
}
if ( ! ( type == MULTIPOINTTYPE || type == MULTILINETYPE ||
- type == MULTIPOLYGONTYPE || type == COLLECTIONTYPE ||
- type == COMPOUNDTYPE || type == CURVEPOLYTYPE ||
- type == MULTICURVETYPE || type == MULTISURFACETYPE) )
+ type == MULTIPOLYGONTYPE || type == COLLECTIONTYPE ||
+ type == COMPOUNDTYPE || type == CURVEPOLYTYPE ||
+ type == MULTICURVETYPE || type == MULTISURFACETYPE) )
{
lwnotice("compute_serialized_box3d called on unknown type %d", type);
return NULL;
void printBOX3D(BOX3D *box)
{
lwnotice("BOX3D: %g %g, %g %g", box->xmin, box->ymin,
- box->xmax, box->ymax);
+ box->xmax, box->ymax);
}
void printPA(POINTARRAY *pa)
lwnotice(" POINTARRAY%s{", mflag);
lwnotice(" ndims=%i, ptsize=%i",
- TYPE_NDIMS(pa->dims), pointArray_ptsize(pa));
+ TYPE_NDIMS(pa->dims), pointArray_ptsize(pa));
lwnotice(" npoints = %i", pa->npoints);
for (t =0; t<pa->npoints;t++)
lwnotice("type 0x%x ==> hasBBOX=%i, hasSRID=%i, ndims=%i, type=%i",(unsigned int) type, lwgeom_hasBBOX(type), lwgeom_hasSRID(type),lwgeom_ndims(type), lwgeom_getType(type));
}
-/*
+/**
* Get the SRID from the LWGEOM.
* None present => -1
*/
else return 1;
}
-/*
+/**
* Returns a BOX2DFLOAT4 that encloses b1 and b2
*
* box2d_union(NULL,A) --> A
return result;
}
-/*
+/**
* ubox may be one of the two args...
* return 1 if done something to ubox, 0 otherwise.
*/
return flags;
}
-/*
+/**
* Given a string with at least 2 chars in it, convert them to
* a byte value. No error checking done!
*/
}
-/*
+/**
* Given one byte, populate result with two byte representing
* the hex number.
*
int input_high;
int input_low;
static char outchr[]=
- {"0123456789ABCDEF"
- };
+ {"0123456789ABCDEF"
+ };
input_high = (str>>4);
input_low = (str & 0x0F);
}
-/*
+/**
* Find interpolation point I
* between point A and point B
* so that the len(AI) == len(AB)*F