Пример #1
0
void printLWCIRCSTRING(LWCIRCSTRING *curve)
{
	lwnotice("LWCIRCSTRING {");
	lwnotice("    ndims = %i", (int)TYPE_NDIMS(curve->type));
	lwnotice("    SRID = %i", (int)curve->SRID);
	printPA(curve->points);
	lwnotice("}");
}
Пример #2
0
void printLWCIRCSTRING(LWCIRCSTRING *curve)
{
	lwnotice("LWCIRCSTRING {");
	lwnotice("    ndims = %i", (int)FLAGS_NDIMS(curve->flags));
	lwnotice("    srid = %i", (int)curve->srid);
	printPA(curve->points);
	lwnotice("}");
}
Пример #3
0
void printLWLINE(LWLINE *line)
{
	lwnotice("LWLINE {");
	lwnotice("    ndims = %i", (int)TYPE_NDIMS(line->type));
	lwnotice("    SRID = %i", (int)line->SRID);
	printPA(line->points);
	lwnotice("}");
}
Пример #4
0
void printLWPOINT(LWPOINT *point)
{
	lwnotice("LWPOINT {");
	lwnotice("    ndims = %i", (int)FLAGS_NDIMS(point->flags));
	lwnotice("    BBOX = %i", FLAGS_GET_BBOX(point->flags) ? 1 : 0 );
	lwnotice("    SRID = %i", (int)point->srid);
	printPA(point->point);
	lwnotice("}");
}
Пример #5
0
void printLWPOINT(LWPOINT *point)
{
	lwnotice("LWPOINT {");
	lwnotice("    ndims = %i", (int)TYPE_NDIMS(point->type));
	lwnotice("    BBOX = %i", TYPE_HASBBOX(point->type) ? 1 : 0 );
	lwnotice("    SRID = %i", (int)point->SRID);
	printPA(point->point);
	lwnotice("}");
}
Пример #6
0
void printLWTRIANGLE(LWTRIANGLE *triangle)
{
	if (triangle->type != TRIANGLETYPE)
                lwerror("printLWTRIANGLE called with something else than a Triangle");

	lwnotice("LWTRIANGLE {");
	lwnotice("    ndims = %i", (int)FLAGS_NDIMS(triangle->flags));
	lwnotice("    SRID = %i", (int)triangle->srid);
	printPA(triangle->points);
	lwnotice("}");
}
Пример #7
0
void printLWPOLY(LWPOLY *poly)
{
	int t;
	lwnotice("LWPOLY {");
	lwnotice("    ndims = %i", (int)FLAGS_NDIMS(poly->flags));
	lwnotice("    SRID = %i", (int)poly->srid);
	lwnotice("    nrings = %i", (int)poly->nrings);
	for (t=0; t<poly->nrings; t++)
	{
		lwnotice("    RING # %i :",t);
		printPA(poly->rings[t]);
	}
	lwnotice("}");
}
Пример #8
0
void printLWTIN(LWTIN *tin)
{
	int i;
	LWTRIANGLE *triangle;

	if (tin->type != TINTYPE)
		lwerror("printLWTIN called with something else than a TIN");

	lwnotice("LWTIN {");
	lwnotice("    ndims = %i", (int)FLAGS_NDIMS(tin->flags));
	lwnotice("    SRID = %i", (int)tin->srid);
	lwnotice("    ngeoms = %i", (int)tin->ngeoms);

	for (i=0; i<tin->ngeoms; i++)
	{
		triangle = (LWTRIANGLE *) tin->geoms[i];
		printPA(triangle->points);
	}
	lwnotice("}");
}
Пример #9
0
void printLWPSURFACE(LWPSURFACE *psurf)
{
	int i, j;
	LWPOLY *patch;

	if (psurf->type != POLYHEDRALSURFACETYPE)
		lwerror("printLWPSURFACE called with something else than a POLYHEDRALSURFACE");

	lwnotice("LWPSURFACE {");
	lwnotice("    ndims = %i", (int)FLAGS_NDIMS(psurf->flags));
	lwnotice("    SRID = %i", (int)psurf->srid);
	lwnotice("    ngeoms = %i", (int)psurf->ngeoms);

	for (i=0; i<psurf->ngeoms; i++)
	{
		patch = (LWPOLY *) psurf->geoms[i];
		for (j=0; j<patch->nrings; j++)
		{
			lwnotice("    RING # %i :",j);
			printPA(patch->rings[j]);
		}
	}
	lwnotice("}");
}
Пример #10
0
/*
 * Print a TGEOM struct
 * Debug purpose only
 */
void
printTGEOM(TGEOM *tgeom)
{
	int i,j;

	assert(tgeom);

	printf("TGEOM:\n");
	printf(" - type %i, %s\n", tgeom->type, lwtype_name(tgeom->type));
	printf(" - srid %i\n", tgeom->srid);
	printf(" - nedges %i\n", tgeom->nedges);
	printf(" - nfaces %i\n", tgeom->nfaces);
	printf("  => EDGES:\n");

	for (i=1 ; i <= tgeom->nedges ; i++)
	{
		if      (FLAGS_NDIMS(tgeom->flags) == 2)
			printf("   [%i] (%lf,%lf) -> (%lf,%lf)\n", i,
			       tgeom->edges[i]->s->x,
			       tgeom->edges[i]->s->y,
			       tgeom->edges[i]->e->x,
			       tgeom->edges[i]->e->y);
		else if (FLAGS_NDIMS(tgeom->flags) == 3)
			printf("   [%i] (%lf,%lf,%lf) -> (%lf,%lf,%lf)\n", i,
			       tgeom->edges[i]->s->x,
			       tgeom->edges[i]->s->y,
			       tgeom->edges[i]->s->z,
			       tgeom->edges[i]->e->x,
			       tgeom->edges[i]->e->y,
			       tgeom->edges[i]->e->z);
		else
			printf("   [%i] (%lf,%lf,%lf,%lf) -> (%lf,%lf,%lf,%lf)\n", i,
			       tgeom->edges[i]->s->x,
			       tgeom->edges[i]->s->y,
			       tgeom->edges[i]->s->z,
			       tgeom->edges[i]->s->m,
			       tgeom->edges[i]->e->x,
			       tgeom->edges[i]->e->y,
			       tgeom->edges[i]->e->z,
			       tgeom->edges[i]->e->m);
	}

	for (i=0 ; i < tgeom->nfaces ; i++)
	{
		printf("  => FACE [%i] nedges:%i nrings:%i\n", i,
		       tgeom->faces[i]->nedges, tgeom->faces[i]->nrings);

		for (j=0 ; j < tgeom->faces[i]->nedges ; j++)
		{
			int edge = tgeom->faces[i]->edges[j];
			printf("    -> EDGES [%i]{%i} ", j, edge);

			if (FLAGS_NDIMS(tgeom->flags) == 2)
			{
				if (tgeom->faces[i]->edges[j] > 0)
					printf("(%lf,%lf) -> (%lf,%lf)\n",
					       tgeom->edges[edge]->s->x,
					       tgeom->edges[edge]->s->y,
					       tgeom->edges[edge]->e->x,
					       tgeom->edges[edge]->e->y);
				else
					printf("(%lf,%lf) -> (%lf,%lf)\n",
					       tgeom->edges[-edge]->e->x,
					       tgeom->edges[-edge]->e->y,
					       tgeom->edges[-edge]->s->x,
					       tgeom->edges[-edge]->s->y);
			}
			else if (FLAGS_NDIMS(tgeom->flags) == 3)
			{
				if (tgeom->faces[i]->edges[j] > 0)
					printf("(%lf,%lf,%lf -> %lf,%lf,%lf)\n",
					       tgeom->edges[edge]->s->x,
					       tgeom->edges[edge]->s->y,
					       tgeom->edges[edge]->s->z,
					       tgeom->edges[edge]->e->x,
					       tgeom->edges[edge]->e->y,
					       tgeom->edges[edge]->e->z);
				else
					printf("(%lf,%lf,%lf -> %lf,%lf,%lf)\n",
					       tgeom->edges[-edge]->e->x,
					       tgeom->edges[-edge]->e->y,
					       tgeom->edges[-edge]->e->z,
					       tgeom->edges[-edge]->s->x,
					       tgeom->edges[-edge]->s->y,
					       tgeom->edges[-edge]->s->z);
			}
			else if (FLAGS_NDIMS(tgeom->flags) == 4)
			{
				if (tgeom->faces[i]->edges[j] > 0)
					printf("(%lf,%lf,%lf,%lf -> %lf,%lf,%lf,%lf)\n",
					       tgeom->edges[edge]->s->x,
					       tgeom->edges[edge]->s->y,
					       tgeom->edges[edge]->s->z,
					       tgeom->edges[edge]->s->m,
					       tgeom->edges[edge]->e->x,
					       tgeom->edges[edge]->e->y,
					       tgeom->edges[edge]->e->z,
					       tgeom->edges[edge]->e->m);
				else
					printf("(%lf,%lf,%lf,%lf -> %lf,%lf,%lf,%lf)\n",
					       tgeom->edges[-edge]->e->x,
					       tgeom->edges[-edge]->e->y,
					       tgeom->edges[-edge]->e->z,
					       tgeom->edges[-edge]->e->m,
					       tgeom->edges[-edge]->s->x,
					       tgeom->edges[-edge]->s->y,
					       tgeom->edges[-edge]->s->z,
					       tgeom->edges[-edge]->s->m);
			}
		}

		for (j=0 ; j < tgeom->faces[i]->nrings ; j++)
		{
			printf("    - Ring[%i/%i]", j, tgeom->faces[i]->nrings);
			printPA(tgeom->faces[i]->rings[j]);
		}
	}
}