]> granicus.if.org Git - postgis/commitdiff
changes to area()
authorDavid Blasby <dblasby@gmail.com>
Thu, 10 Apr 2003 19:16:43 +0000 (19:16 +0000)
committerDavid Blasby <dblasby@gmail.com>
Thu, 10 Apr 2003 19:16:43 +0000 (19:16 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@270 b70326c6-7e19-0410-871a-916f4a2858ee

postgis_fn.c
postgis_geos.c

index 7621f2c5971d7e0547b35c57fa68f077e84a173e..62f5c3ef04e9b8fc1e3e6ec5d3bb140ecc00a17f 100644 (file)
@@ -185,21 +185,22 @@ double polygon_area2d_old(POLYGON3D *poly1)
        pts1 = (POINT3D *) ( (char *)&(poly1->npoints[poly1->nrings] )  );
        pts1 = (POINT3D *) MAXALIGN(pts1);
 
-
+//elog(NOTICE,"in polygon_area2d_old");
        
        pt_offset = 0; //index to first point in ring
        for (ring = 0; ring < poly1->nrings; ring++)
        {
                ringarea = 0.0;
                
-               for (i=0;i<(poly1->npoints[ring]);i++) 
-               { 
-                       j = (i+1) % (poly1->npoints[ring]);
+               for (i=0;i<(poly1->npoints[ring]-1);i++) 
+       { 
+               //      j = (i+1) % (poly1->npoints[ring]);
+                       j = i+1;
                        ringarea  += pts1[pt_offset+ i].x * pts1[pt_offset+j].y - pts1[pt_offset+ i].y * pts1[pt_offset+j].x; 
                } 
 
                ringarea  /= 2.0; 
-
+//elog(NOTICE," ring 1 has area %lf",ringarea);
                ringarea  = fabs(ringarea );
                if (ring != 0)  //outer
                        ringarea  = -1.0*ringarea ; // its a hole
index 5db499745d24092ab4ea5df8793ae4177bd0c2c5..166bac902ebe17fe34fea861783e444f2f8eb985 100644 (file)
@@ -1,55 +1,4 @@
-/*
-drop function geos_thing(geometry,geometry);
-CREATE FUNCTION relate(geometry,geometry)
-   RETURNS text
-   AS '/data1/Refractions/Projects/PostGIS/work_dave/postgis/libpostgis.so.0.7','relate_full'
-   LANGUAGE 'c' with (isstrict);
-
-CREATE FUNCTION relate(geometry,geometry,text)
-   RETURNS boolean
-   AS '/data1/Refractions/Projects/PostGIS/work_dave/postgis/libpostgis.so.0.7','relate_pattern'
-   LANGUAGE 'c' with (isstrict);
-
-CREATE FUNCTION disjoint(geometry,geometry)
-   RETURNS boolean
-   AS '/data1/Refractions/Projects/PostGIS/work_dave/postgis/libpostgis.so.0.7'
-   LANGUAGE 'c' with (isstrict);
-
-CREATE FUNCTION touches(geometry,geometry)
-   RETURNS boolean
-   AS '/data1/Refractions/Projects/PostGIS/work_dave/postgis/libpostgis.so.0.7'
-   LANGUAGE 'c' with (isstrict);
-
-CREATE FUNCTION intersects(geometry,geometry)
-   RETURNS boolean
-   AS '/data1/Refractions/Projects/PostGIS/work_dave/postgis/libpostgis.so.0.7'
-   LANGUAGE 'c' with (isstrict);
-
-CREATE FUNCTION crosses(geometry,geometry)
-   RETURNS boolean
-   AS '/data1/Refractions/Projects/PostGIS/work_dave/postgis/libpostgis.so.0.7'
-   LANGUAGE 'c' with (isstrict);
-
-CREATE FUNCTION within(geometry,geometry)
-   RETURNS boolean
-   AS '/data1/Refractions/Projects/PostGIS/work_dave/postgis/libpostgis.so.0.7'
-   LANGUAGE 'c' with (isstrict);
-
-CREATE FUNCTION contains(geometry,geometry)
-   RETURNS boolean
-   AS '/data1/Refractions/Projects/PostGIS/work_dave/postgis/libpostgis.so.0.7'
-   LANGUAGE 'c' with (isstrict);
-
-CREATE FUNCTION overlaps(geometry,geometry)
-   RETURNS boolean
-   AS '/data1/Refractions/Projects/PostGIS/work_dave/postgis/libpostgis.so.0.7'
-   LANGUAGE 'c' with (isstrict);
-
-  CREATE FUNCTION isvalid(geometry)
-   RETURNS boolean
-   AS '/data1/Refractions/Projects/PostGIS/work_dave/postgis/libpostgis.so.0.7'
-   LANGUAGE 'c' with (isstrict);
-*/
+
 
 //--------------------------------------------------------------------------
 //