[geos-commits] r3171 - in trunk: include/geos/geom src/geom

svn_geos at osgeo.org svn_geos at osgeo.org
Wed Feb 2 12:41:29 EST 2011


Author: strk
Date: 2011-02-02 09:41:29 -0800 (Wed, 02 Feb 2011)
New Revision: 3171

Added:
   trunk/include/geos/geom/Lineal.h
   trunk/include/geos/geom/Polygonal.h
   trunk/include/geos/geom/Puntal.h
Modified:
   trunk/include/geos/geom/LineString.h
   trunk/include/geos/geom/Makefile.am
   trunk/include/geos/geom/MultiLineString.h
   trunk/include/geos/geom/MultiLineString.inl
   trunk/include/geos/geom/MultiPoint.h
   trunk/include/geos/geom/MultiPolygon.h
   trunk/include/geos/geom/Point.h
   trunk/include/geos/geom/Polygon.h
   trunk/src/geom/LineString.cpp
   trunk/src/geom/MultiLineString.cpp
   trunk/src/geom/MultiPoint.cpp
   trunk/src/geom/MultiPolygon.cpp
   trunk/src/geom/Point.cpp
   trunk/src/geom/Polygon.cpp
Log:
Add Puntal, Lineal and Polygonal "interfaces"

Modified: trunk/include/geos/geom/LineString.h
===================================================================
--- trunk/include/geos/geom/LineString.h	2011-01-27 18:01:29 UTC (rev 3170)
+++ trunk/include/geos/geom/LineString.h	2011-02-02 17:41:29 UTC (rev 3171)
@@ -4,6 +4,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2011 Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
  * Copyright (C) 2005 2006 Refractions Research Inc.
  *
@@ -14,7 +15,7 @@
  *
  **********************************************************************
  *
- * Last port: geom/LineString.java rev. 1.46
+ * Last port: geom/LineString.java r320 (JTS-1.12)
  *
  **********************************************************************/
 
@@ -24,6 +25,7 @@
 #include <geos/export.h>
 #include <geos/platform.h> // do we need this ?
 #include <geos/geom/Geometry.h> // for inheritance
+#include <geos/geom/Lineal.h> // for inheritance
 #include <geos/geom/CoordinateSequence.h> // for proper use of auto_ptr<>
 #include <geos/geom/Envelope.h> // for proper use of auto_ptr<>
 #include <geos/geom/Dimension.h> // for Dimension::DimensionType
@@ -51,10 +53,22 @@
 namespace geom { // geos::geom
 
 /**
- * \class LineString geom.h geos.h
- * \brief Basic implementation of LineString.
+ *  Models an OGC-style <code>LineString</code>.
+ *
+ *  A LineString consists of a sequence of two or more vertices,
+ *  along with all points along the linearly-interpolated curves
+ *  (line segments) between each
+ *  pair of consecutive vertices.
+ *  Consecutive vertices may be equal.
+ *  The line segments in the line may intersect each other (in other words,
+ *  the linestring may "curl back" in itself and self-intersect.
+ *  Linestrings with exactly two identical points are invalid.
+ *  
+ *  A linestring must have either 0 or 2 or more points.
+ *  If these conditions are not met, the constructors throw
+ *  an {@link IllegalArgumentException}
  */
-class GEOS_DLL LineString: public Geometry {
+class GEOS_DLL LineString: public Geometry, public Lineal {
 
 public:
 

Copied: trunk/include/geos/geom/Lineal.h (from rev 3170, trunk/include/geos/geom/MultiLineString.inl)
===================================================================
--- trunk/include/geos/geom/Lineal.h	                        (rev 0)
+++ trunk/include/geos/geom/Lineal.h	2011-02-02 17:41:29 UTC (rev 3171)
@@ -0,0 +1,35 @@
+/**********************************************************************
+ * $Id$
+ *
+ * GEOS - Geometry Engine Open Source
+ * http://geos.refractions.net
+ *
+ * Copyright (C) 2011  Sandro Santilli <strk at keybit.net>
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU Lesser General Public Licence as published
+ * by the Free Software Foundation. 
+ * See the COPYING file for more information.
+ *
+ **********************************************************************
+ *
+ * Last port: geom/Lineal.java r320 (JTS-1.12)
+ *
+ **********************************************************************/
+
+#ifndef GEOS_GEOM_LINEAL_H
+#define GEOS_GEOM_LINEAL_H
+
+namespace geos {
+namespace geom { // geos::geom
+
+/**
+ * Identifies {@link Geometry} subclasses which
+ * are 1-dimensional and with components which are {@link LineString}s.
+ */
+class Lineal {};
+
+} // namespace geos::geom
+} // namespace geos
+
+#endif // ndef GEOS_GEOM_LINEAL_H

Modified: trunk/include/geos/geom/Makefile.am
===================================================================
--- trunk/include/geos/geom/Makefile.am	2011-01-27 18:01:29 UTC (rev 3170)
+++ trunk/include/geos/geom/Makefile.am	2011-02-02 17:41:29 UTC (rev 3171)
@@ -49,4 +49,7 @@
     Polygon.h \
     PrecisionModel.h \
     PrecisionModel.inl \
-    Triangle.h
+    Triangle.h \
+    Puntal.h \
+    Lineal.h \
+    Polygonal.h

Modified: trunk/include/geos/geom/MultiLineString.h
===================================================================
--- trunk/include/geos/geom/MultiLineString.h	2011-01-27 18:01:29 UTC (rev 3170)
+++ trunk/include/geos/geom/MultiLineString.h	2011-02-02 17:41:29 UTC (rev 3171)
@@ -4,6 +4,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2011 Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
  * Copyright (C) 2005 2006 Refractions Research Inc.
  *
@@ -14,7 +15,7 @@
  *
  **********************************************************************
  *
- * Last port: geom/MultiLineString.java rev. 1.40
+ * Last port: geom/MultiLineString.java r320 (JTS-1.12)
  *
  **********************************************************************/
 
@@ -23,7 +24,7 @@
 
 #include <geos/export.h>
 #include <geos/geom/GeometryCollection.h> // for inheritance
-//#include <geos/platform.h> 
+#include <geos/geom/Lineal.h> // for inheritance
 #include <geos/geom/Dimension.h>
 
 #include <string>
@@ -42,8 +43,8 @@
 namespace geos {
 namespace geom { // geos::geom
 
-/// Basic implementation of MultiLineString objects.
-class GEOS_DLL MultiLineString: public GeometryCollection {
+/// Models a collection of (@link LineString}s.
+class GEOS_DLL MultiLineString: public GeometryCollection, public Lineal {
 
 public:
 

Modified: trunk/include/geos/geom/MultiLineString.inl
===================================================================
--- trunk/include/geos/geom/MultiLineString.inl	2011-01-27 18:01:29 UTC (rev 3170)
+++ trunk/include/geos/geom/MultiLineString.inl	2011-02-02 17:41:29 UTC (rev 3171)
@@ -4,6 +4,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2011 Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2005-2006 Refractions Research Inc.
  *
  * This is free software; you can redistribute and/or modify it under
@@ -13,7 +14,7 @@
  *
  **********************************************************************
  *
- * Last port: geom/MultiLineString.java rev. 1.40
+ * Last port: geom/MultiLineString.java r320 (JTS-1.12)
  *
  **********************************************************************/
 

Modified: trunk/include/geos/geom/MultiPoint.h
===================================================================
--- trunk/include/geos/geom/MultiPoint.h	2011-01-27 18:01:29 UTC (rev 3170)
+++ trunk/include/geos/geom/MultiPoint.h	2011-02-02 17:41:29 UTC (rev 3171)
@@ -4,6 +4,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2011 Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
  * Copyright (C) 2005 2006 Refractions Research Inc.
  *
@@ -14,7 +15,7 @@
  *
  **********************************************************************
  *
- * Last port: geom/MultiPoint.java rev. 1.30
+ * Last port: geom/MultiPoint.java r320 (JTS-1.12)
  *
  **********************************************************************/
 
@@ -23,7 +24,8 @@
 
 #include <geos/export.h>
 #include <geos/platform.h>
-#include <geos/geom/GeometryCollection.h>
+#include <geos/geom/GeometryCollection.h> // for inheritance
+#include <geos/geom/Puntal.h> // for inheritance
 #include <geos/geom/Dimension.h> // for Dimension::DimensionType
 
 #include <geos/inline.h>
@@ -42,10 +44,12 @@
 namespace geom { // geos::geom
 
 /**
- * \class MultiPoint geom.h geos.h
- * \brief  Models a collection of Point objects.
+ * Models a collection of Point objects.
+ *
+ * Any collection of Points is a valid MultiPoint.
  */
-class GEOS_DLL MultiPoint: public GeometryCollection {
+class GEOS_DLL MultiPoint: public GeometryCollection, public Puntal
+{
 
 public:
 

Modified: trunk/include/geos/geom/MultiPolygon.h
===================================================================
--- trunk/include/geos/geom/MultiPolygon.h	2011-01-27 18:01:29 UTC (rev 3170)
+++ trunk/include/geos/geom/MultiPolygon.h	2011-02-02 17:41:29 UTC (rev 3171)
@@ -4,6 +4,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2011 Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
  * Copyright (C) 2005 2006 Refractions Research Inc.
  *
@@ -14,7 +15,7 @@
  *
  **********************************************************************
  *
- * Last port: geom/MultiPolygon.java rev 1.34
+ * Last port: geom/MultiPolygon.java r320 (JTS-1.12)
  *
  **********************************************************************/
 
@@ -25,7 +26,8 @@
 #include <string>
 #include <vector>
 #include <geos/platform.h>
-#include <geos/geom/GeometryCollection.h>
+#include <geos/geom/GeometryCollection.h> // for inheritance
+#include <geos/geom/Polygonal.h> // for inheritance
 #include <geos/geom/Dimension.h> // for Dimension::DimensionType
 
 #include <geos/inline.h>
@@ -43,8 +45,15 @@
 namespace geos {
 namespace geom { // geos::geom
 
-/// Basic implementation of <code>MultiPolygon</code>.
-class GEOS_DLL MultiPolygon: public GeometryCollection
+/// Models a collection of {@link Polygon}s.
+//
+/// As per the OGC SFS specification,
+/// the Polygons in a MultiPolygon may not overlap,
+/// and may only touch at single points.
+/// This allows the topological point-set semantics
+/// to be well-defined.
+///
+class GEOS_DLL MultiPolygon: public GeometryCollection, public Polygonal
 {
 
 public:

Modified: trunk/include/geos/geom/Point.h
===================================================================
--- trunk/include/geos/geom/Point.h	2011-01-27 18:01:29 UTC (rev 3170)
+++ trunk/include/geos/geom/Point.h	2011-02-02 17:41:29 UTC (rev 3171)
@@ -4,6 +4,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2011 Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
  * Copyright (C) 2005 2006 Refractions Research Inc.
  *
@@ -14,7 +15,7 @@
  *
  **********************************************************************
  *
- * Last port: geom/Point.java rev. 1.37 (JTS-1.10)
+ * Last port: geom/Point.java r320 (JTS-1.12)
  *
  **********************************************************************/
 
@@ -23,7 +24,8 @@
 
 #include <geos/export.h>
 #include <geos/platform.h>
-#include <geos/geom/Geometry.h>
+#include <geos/geom/Geometry.h> // for inheritance
+#include <geos/geom/Puntal.h> // for inheritance
 #include <geos/geom/CoordinateSequence.h> // for proper use of auto_ptr<>
 #include <geos/geom/Envelope.h> // for proper use of auto_ptr<>
 #include <geos/geom/Dimension.h> // for Dimension::DimensionType
@@ -55,12 +57,15 @@
 namespace geom { // geos::geom
 
 /**
- * \class Point geom.h geos.h
- * \brief Basic implementation of Point.
+ * Implementation of Point.
+ *
+ * A Point is valid iff:
+ * 
+ * - the coordinate which defines it is a valid coordinate
+ *   (i.e does not have an NaN X or Y ordinate)
+ *
  */
-class GEOS_DLL Point : public Geometry 
-
-	// NOTE: in JTS Point implements Puntual
+class GEOS_DLL Point : public Geometry, public Puntal 
 {
 
 public:
@@ -87,7 +92,6 @@
 	size_t getNumPoints() const;
 	bool isEmpty() const;
 	bool isSimple() const;
-	//bool isValid() const;
 
 	/// Returns point dimension (0)
 	Dimension::DimensionType getDimension() const;

Modified: trunk/include/geos/geom/Polygon.h
===================================================================
--- trunk/include/geos/geom/Polygon.h	2011-01-27 18:01:29 UTC (rev 3170)
+++ trunk/include/geos/geom/Polygon.h	2011-02-02 17:41:29 UTC (rev 3171)
@@ -4,6 +4,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2011 Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2005 2006 Refractions Research Inc.
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
  *
@@ -14,7 +15,7 @@
  *
  **********************************************************************
  *
- * Last port: geom/Polygon.java rev. 1.50
+ * Last port: geom/Polygon.java r320 (JTS-1.12)
  *
  **********************************************************************/
 
@@ -25,7 +26,8 @@
 #include <string>
 #include <vector>
 #include <geos/platform.h>
-#include <geos/geom/Geometry.h>
+#include <geos/geom/Geometry.h> // for inheritance
+#include <geos/geom/Polygonal.h> // for inheritance
 #include <geos/geom/Envelope.h> // for proper use of auto_ptr<>
 #include <geos/geom/Dimension.h> // for Dimension::DimensionType
 
@@ -62,7 +64,8 @@
  *  Specification for SQL</A> .
  *
  */
-class GEOS_DLL Polygon: public Geometry{
+class GEOS_DLL Polygon: public Geometry, public Polygonal
+{
 
 public:
 
@@ -190,10 +193,6 @@
 } // namespace geos::geom
 } // namespace geos
 
-//#ifdef GEOS_INLINE
-//# include "geos/geom/Polygon.inl"
-//#endif
-
 #endif // ndef GEOS_GEOM_POLYGON_H
 
 /**********************************************************************

Copied: trunk/include/geos/geom/Polygonal.h (from rev 3170, trunk/include/geos/geom/MultiLineString.inl)
===================================================================
--- trunk/include/geos/geom/Polygonal.h	                        (rev 0)
+++ trunk/include/geos/geom/Polygonal.h	2011-02-02 17:41:29 UTC (rev 3171)
@@ -0,0 +1,35 @@
+/**********************************************************************
+ * $Id$
+ *
+ * GEOS - Geometry Engine Open Source
+ * http://geos.refractions.net
+ *
+ * Copyright (C) 2011  Sandro Santilli <strk at keybit.net>
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU Lesser General Public Licence as published
+ * by the Free Software Foundation. 
+ * See the COPYING file for more information.
+ *
+ **********************************************************************
+ *
+ * Last port: geom/Polygonal.java r320 (JTS-1.12)
+ *
+ **********************************************************************/
+
+#ifndef GEOS_GEOM_POLYGONAL_H
+#define GEOS_GEOM_POLYGONAL_H
+
+namespace geos {
+namespace geom { // geos::geom
+
+/**
+ * Identifies {@link Geometry} subclasses which
+ * are 2-dimensional and with components which are {@link Polygon}s.
+ */
+class Polygonal {};
+
+} // namespace geos::geom
+} // namespace geos
+
+#endif // ndef GEOS_GEOM_POLYGONAL_H

Copied: trunk/include/geos/geom/Puntal.h (from rev 3170, trunk/include/geos/geom/MultiLineString.inl)
===================================================================
--- trunk/include/geos/geom/Puntal.h	                        (rev 0)
+++ trunk/include/geos/geom/Puntal.h	2011-02-02 17:41:29 UTC (rev 3171)
@@ -0,0 +1,35 @@
+/**********************************************************************
+ * $Id$
+ *
+ * GEOS - Geometry Engine Open Source
+ * http://geos.refractions.net
+ *
+ * Copyright (C) 2011  Sandro Santilli <strk at keybit.net>
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU Lesser General Public Licence as published
+ * by the Free Software Foundation. 
+ * See the COPYING file for more information.
+ *
+ **********************************************************************
+ *
+ * Last port: geom/Puntal.java r320 (JTS-1.12)
+ *
+ **********************************************************************/
+
+#ifndef GEOS_GEOM_PUNTAL_H
+#define GEOS_GEOM_PUNTAL_H
+
+namespace geos {
+namespace geom { // geos::geom
+
+/**
+ * Identifies {@link Geometry} subclasses which
+ * are 0-dimensional and with components which are {@link Point}s.
+ */
+class Puntal {};
+
+} // namespace geos::geom
+} // namespace geos
+
+#endif // ndef GEOS_GEOM_PUNTAL_H

Modified: trunk/src/geom/LineString.cpp
===================================================================
--- trunk/src/geom/LineString.cpp	2011-01-27 18:01:29 UTC (rev 3170)
+++ trunk/src/geom/LineString.cpp	2011-02-02 17:41:29 UTC (rev 3171)
@@ -4,6 +4,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2011 Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2005-2006 Refractions Research Inc.
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
  *
@@ -14,7 +15,7 @@
  *
  **********************************************************************
  *
- * Last port: geom/LineString.java rev. 1.46
+ * Last port: geom/LineString.java r320 (JTS-1.12)
  *
  **********************************************************************/
 

Modified: trunk/src/geom/MultiLineString.cpp
===================================================================
--- trunk/src/geom/MultiLineString.cpp	2011-01-27 18:01:29 UTC (rev 3170)
+++ trunk/src/geom/MultiLineString.cpp	2011-02-02 17:41:29 UTC (rev 3171)
@@ -4,6 +4,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2011 Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2005-2006 Refractions Research Inc.
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
  *
@@ -14,7 +15,7 @@
  *
  **********************************************************************
  *
- * Last port: geom/MultiLineString.java rev. 1.40
+ * Last port: geom/MultiLineString.java r320 (JTS-1.12)
  *
  **********************************************************************/
 

Modified: trunk/src/geom/MultiPoint.cpp
===================================================================
--- trunk/src/geom/MultiPoint.cpp	2011-01-27 18:01:29 UTC (rev 3170)
+++ trunk/src/geom/MultiPoint.cpp	2011-02-02 17:41:29 UTC (rev 3171)
@@ -4,6 +4,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2011 Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2005-2006 Refractions Research Inc.
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
  *
@@ -14,7 +15,7 @@
  *
  **********************************************************************
  *
- * Last port: geom/MultiPoint.java rev. 1.30
+ * Last port: geom/MultiPoint.java r320 (JTS-1.12)
  *
  **********************************************************************/
 

Modified: trunk/src/geom/MultiPolygon.cpp
===================================================================
--- trunk/src/geom/MultiPolygon.cpp	2011-01-27 18:01:29 UTC (rev 3170)
+++ trunk/src/geom/MultiPolygon.cpp	2011-02-02 17:41:29 UTC (rev 3171)
@@ -4,6 +4,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2011 Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
  *
  * This is free software; you can redistribute and/or modify it under
@@ -13,7 +14,7 @@
  *
  **********************************************************************
  *
- * Last port: geom/MultiPolygon.java rev 1.34
+ * Last port: geom/MultiPolygon.java r320 (JTS-1.12)
  *
  **********************************************************************/
 

Modified: trunk/src/geom/Point.cpp
===================================================================
--- trunk/src/geom/Point.cpp	2011-01-27 18:01:29 UTC (rev 3170)
+++ trunk/src/geom/Point.cpp	2011-02-02 17:41:29 UTC (rev 3171)
@@ -4,6 +4,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2011 Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
  * Copyright (C) 2005 2006 Refractions Research Inc.
  *
@@ -14,7 +15,7 @@
  *
  **********************************************************************
  *
- * Last port: geom/Point.java rev. 1.37 (JTS-1.10)
+ * Last port: geom/Point.java r320 (JTS-1.12)
  *
  **********************************************************************/
 
@@ -90,8 +91,6 @@
 	return true;
 }
 
-//bool Point::isValid() const {return true;}
-
 Dimension::DimensionType
 Point::getDimension() const
 {

Modified: trunk/src/geom/Polygon.cpp
===================================================================
--- trunk/src/geom/Polygon.cpp	2011-01-27 18:01:29 UTC (rev 3170)
+++ trunk/src/geom/Polygon.cpp	2011-02-02 17:41:29 UTC (rev 3171)
@@ -4,6 +4,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2011 Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2005-2006 Refractions Research Inc.
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
  *
@@ -14,7 +15,7 @@
  *
  **********************************************************************
  *
- * Last port: geom/Polygon.java rev. 1.50
+ * Last port: geom/Polygon.java r320 (JTS-1.12)
  *
  **********************************************************************/
 



More information about the geos-commits mailing list