[postgis-commits] svn - r3428 - in trunk: cunit liblwgeom lwgeom

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Tue Dec 16 21:28:54 PST 2008


Author: pramsey
Date: 2008-12-16 21:28:54 -0800 (Tue, 16 Dec 2008)
New Revision: 3428

Modified:
   trunk/cunit/cu_algorithm.c
   trunk/cunit/cu_algorithm.h
   trunk/cunit/cu_tester.c
   trunk/liblwgeom/lwalgorithm.c
   trunk/liblwgeom/lwalgorithm.h
   trunk/lwgeom/lwgeom_functions_analytic.c
Log:
Revisison per MCA and (c) headers.


Modified: trunk/cunit/cu_algorithm.c
===================================================================
--- trunk/cunit/cu_algorithm.c	2008-12-17 00:22:26 UTC (rev 3427)
+++ trunk/cunit/cu_algorithm.c	2008-12-17 05:28:54 UTC (rev 3428)
@@ -1,3 +1,14 @@
+/**********************************************************************
+ * $Id$
+ *
+ * PostGIS - Spatial Types for PostgreSQL
+ * http://postgis.refractions.net
+ * Copyright 2008 Paul Ramsey
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU General Public Licence. See the COPYING file.
+ * 
+ **********************************************************************/
 
 #include "cu_algorithm.h"
 

Modified: trunk/cunit/cu_algorithm.h
===================================================================
--- trunk/cunit/cu_algorithm.h	2008-12-17 00:22:26 UTC (rev 3427)
+++ trunk/cunit/cu_algorithm.h	2008-12-17 05:28:54 UTC (rev 3428)
@@ -1,3 +1,15 @@
+/**********************************************************************
+ * $Id$
+ *
+ * PostGIS - Spatial Types for PostgreSQL
+ * http://postgis.refractions.net
+ * Copyright 2008 Paul Ramsey
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU General Public Licence. See the COPYING file.
+ * 
+ **********************************************************************/
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>

Modified: trunk/cunit/cu_tester.c
===================================================================
--- trunk/cunit/cu_tester.c	2008-12-17 00:22:26 UTC (rev 3427)
+++ trunk/cunit/cu_tester.c	2008-12-17 05:28:54 UTC (rev 3428)
@@ -1,3 +1,14 @@
+/**********************************************************************
+ * $Id$
+ *
+ * PostGIS - Spatial Types for PostgreSQL
+ * http://postgis.refractions.net
+ * Copyright 2008 Paul Ramsey
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU General Public Licence. See the COPYING file.
+ * 
+ **********************************************************************/
 
 #include <stdio.h>
 #include <string.h>
@@ -19,12 +30,8 @@
 }
 
 void lwgeom_init_allocators(void) {
-        /* liblwgeom callback - install PostgreSQL handlers */
-        lwalloc_var = malloc;
-        lwrealloc_var = realloc;
-        lwfree_var = free;
-        lwerror_var = default_errorreporter;
-        lwnotice_var = default_noticereporter;
+        /* liblwgeom callback - install default handlers */
+        lwgeom_install_default_allocators();
 }
 
 /*

Modified: trunk/liblwgeom/lwalgorithm.c
===================================================================
--- trunk/liblwgeom/lwalgorithm.c	2008-12-17 00:22:26 UTC (rev 3427)
+++ trunk/liblwgeom/lwalgorithm.c	2008-12-17 05:28:54 UTC (rev 3428)
@@ -1,3 +1,15 @@
+/**********************************************************************
+ * $Id$
+ *
+ * PostGIS - Spatial Types for PostgreSQL
+ * http://postgis.refractions.net
+ * Copyright 2008 Paul Ramsey
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU General Public Licence. See the COPYING file.
+ * 
+ **********************************************************************/
+
 #include "lwalgorithm.h"
 
 /*
@@ -7,12 +19,12 @@
 ** Return > 0.0 if point Q is right of segment P
 ** Return = 0.0 if point Q in on segment P
 */
-double segmentSide(POINT2D *p1, POINT2D *p2, POINT2D *q)
+double lw_segment_side(POINT2D *p1, POINT2D *p2, POINT2D *q)
 {
 	return ( (q->x - p1->x) * (p2->y - p1->y) - (p2->x - p1->x) * (q->y - p1->y) );
 }
 
-int segmentEnvelopeIntersects(POINT2D *p1, POINT2D *p2, POINT2D *q1, POINT2D *q2) {
+int lw_segment_envelope_intersects(POINT2D *p1, POINT2D *p2, POINT2D *q1, POINT2D *q2) {
 	double minq=LW_MIN(q1->x,q2->x);
 	double maxq=LW_MAX(q1->x,q2->x);
 	double minp=LW_MIN(p1->x,p2->x);
@@ -44,7 +56,7 @@
 **	SEG_TOUCH_LEFT = 4, 
 **	SEG_TOUCH_RIGHT = 5
 */
-int segmentIntersects(POINT2D *p1, POINT2D *p2, POINT2D *q1, POINT2D *q2) {
+int lw_segment_intersects(POINT2D *p1, POINT2D *p2, POINT2D *q1, POINT2D *q2) {
 	
 	double pq1, pq2, qp1, qp2;
 	
@@ -115,7 +127,7 @@
 **   LINE_TOUCH_RIGHT = 4
 **
 */
-int lineCrossingDirection(LWLINE *l1, LWLINE *l2) {
+int lwline_crossing_direction(LWLINE *l1, LWLINE *l2) {
 	
 	int i = 0, j = 0, rv = 0;
 	POINT2D *p1;
@@ -144,8 +156,8 @@
 	if( pa1->npoints < 2 || pa2->npoints < 2 ) 
 		return LINE_NO_CROSS;
 
-	LWDEBUGF(5, "lineCrossingDirection: l1 = %s", lwgeom_to_ewkt((LWGEOM*)l1,0));
-	LWDEBUGF(5, "lineCrossingDirection: l2 = %s", lwgeom_to_ewkt((LWGEOM*)l2,0));
+	LWDEBUGF(4, "lineCrossingDirection: l1 = %s", lwgeom_to_ewkt((LWGEOM*)l1,0));
+	LWDEBUGF(4, "lineCrossingDirection: l2 = %s", lwgeom_to_ewkt((LWGEOM*)l2,0));
 
 	for ( i = 1; i < pa2->npoints; i++ ) {
 		
@@ -157,7 +169,7 @@
 			rv = getPoint2d_p(pa1, j-1, p1);
 			rv = getPoint2d_p(pa1, j, p2);
 			
-			LWDEBUGF(5, "lineCrossingDirection: i=%d, j=%d", i, j);
+			LWDEBUGF(4, "lineCrossingDirection: i=%d, j=%d", i, j);
 			
 			this_cross = segmentIntersects(p1, p2, q1, q2);
 		
@@ -220,13 +232,13 @@
 			** TODO Handle co-linear cases. 
 			*/
 
- 			LWDEBUGF(5, "lineCrossingDirection: this_cross=%d, vertex_touch=%d, vertex_touch_type=%d", this_cross, vertex_touch, vertex_touch_type);
+ 			LWDEBUGF(4, "lineCrossingDirection: this_cross=%d, vertex_touch=%d, vertex_touch_type=%d", this_cross, vertex_touch, vertex_touch_type);
 				
 		}
 		
 	}
 
-	LWDEBUGF(5, "first_cross=%d, final_cross=%d, cross_left=%d, cross_right=%d", first_cross, final_cross, cross_left, cross_right);
+	LWDEBUGF(4, "first_cross=%d, final_cross=%d, cross_left=%d, cross_right=%d", first_cross, final_cross, cross_left, cross_right);
 
 	lwfree(p1);
 	lwfree(p2);

Modified: trunk/liblwgeom/lwalgorithm.h
===================================================================
--- trunk/liblwgeom/lwalgorithm.h	2008-12-17 00:22:26 UTC (rev 3427)
+++ trunk/liblwgeom/lwalgorithm.h	2008-12-17 05:28:54 UTC (rev 3428)
@@ -1,3 +1,15 @@
+/**********************************************************************
+ * $Id$
+ *
+ * PostGIS - Spatial Types for PostgreSQL
+ * http://postgis.refractions.net
+ * Copyright 2008 Paul Ramsey
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU General Public Licence. See the COPYING file.
+ * 
+ **********************************************************************/
+
 #include "liblwgeom.h"
 
 enum CG_SEGMENT_INTERSECTION_TYPE { 
@@ -10,9 +22,9 @@
 	SEG_TOUCH_RIGHT = 5
 };
 
-double segmentSide(POINT2D *p1, POINT2D *p2, POINT2D *q);
-int segmentIntersects(POINT2D *p1, POINT2D *p2, POINT2D *q1, POINT2D *q2);
-int segmentEnvelopeIntersects(POINT2D *p1, POINT2D *p2, POINT2D *q1, POINT2D *q2);
+double lw_segment_side(POINT2D *p1, POINT2D *p2, POINT2D *q);
+int lw_segment_intersects(POINT2D *p1, POINT2D *p2, POINT2D *q1, POINT2D *q2);
+int lw_segment_envelope_intersects(POINT2D *p1, POINT2D *p2, POINT2D *q1, POINT2D *q2);
 
 
 enum CG_LINE_CROSS_TYPE {
@@ -25,4 +37,4 @@
 	LINE_MULTICROSS_END_SAME_FIRST_RIGHT = 3
 };
 
-int lineCrossingDirection(LWLINE *l1, LWLINE *l2);
+int lwline_crossing_direction(LWLINE *l1, LWLINE *l2);

Modified: trunk/lwgeom/lwgeom_functions_analytic.c
===================================================================
--- trunk/lwgeom/lwgeom_functions_analytic.c	2008-12-17 00:22:26 UTC (rev 3427)
+++ trunk/lwgeom/lwgeom_functions_analytic.c	2008-12-17 05:28:54 UTC (rev 3428)
@@ -984,7 +984,7 @@
 	l1 = lwline_deserialize(SERIALIZED_FORM(geom1));
 	l2 = lwline_deserialize(SERIALIZED_FORM(geom2));
 
-	rv = lineCrossingDirection(l1, l2);
+	rv = lw_line_crossing_direction(l1, l2);
 	
 	PG_FREE_IF_COPY(geom1, 0);
 	PG_FREE_IF_COPY(geom2, 0);	



More information about the postgis-commits mailing list