// // ogc-geometry.idl // // Geometry definitions from the OpenGIS Simple Features // Specification for CORBA. // // // Taken from the PDF document _OpenGIS(R) Simple Features // Specification For CORBA_, Revision 1.1, dated June 2, 1999. // // Separated major sections into separate files in order to support // greater flexibility in the use of the module. // // Minor modifications made to restore readability after extraction // from the PDF document and to satisfy the TAO 1.4.6 IDL compiler. // // The aforementioned specification contains the following copyright // claims: // // Copyright 1997, 1998, 1999 Bentley Systems, Inc. // Copyright 1997, 1998, 1999 Environmental Systems Research Institute // Copyright 1997, 1998, 1999 Genasys II, Inc. // Copyright 1997, 1998, 1999 Oracle Corporation // Copyright 1997, 1998, 1999 University of California, Los Angeles. // Copyright 1997, 1998, 1999 Sun Microsystems, Inc. // // See the aforementioned specification for disclaimers and more // information. // // // Chuck Taylor, September 20, 2005. // // #ifndef _OGIS_GEOMETRY_IDL_ #define _OGIS_GEOMETRY_IDL_ #include "ogis-struct.idl" module OGIS { //---------------------------------------------------------------------- // Forward declarations of interfaces //---------------------------------------------------------------------- interface SpatialReferenceSystem; //---------------------------------------------------------------------- // Geometry interface //---------------------------------------------------------------------- interface Geometry { exception WKBNotImplemented {}; enum EgenhoferElement { Empty, NotEmpty, NoTest }; struct EgenhoferOperator { EgenhoferElement elements[3][3]; }; readonly attribute short dimension; // dimension of the geometry // - not the coordinate system readonly attribute Envelope range_envelope; // minBoundBox in abstract // spec readonly attribute SpatialReferenceSystem spatial_reference_system; // geometric characteristics boolean is_empty(); boolean is_simple(); boolean is_closed(); // constructive operators Geometry copy(); Geometry boundary(); Geometry buffer (in double distance); Geometry convex_hull(); // WKS operators WKSGeometry export(); // export geometry to WKS OctetSeq export_WKBGeometry() // export geometry to WKB raises (WKBNotImplemented); // relational operators boolean equals (in Geometry other); boolean touches (in Geometry other); boolean contains (in Geometry other); boolean within (in Geometry other); boolean disjoint (in Geometry other); boolean crosses (in Geometry other); boolean overlaps (in Geometry other); boolean intersects (in Geometry other); boolean relate (in Geometry other, in EgenhoferOperator operator); // metric operators double distance (in Geometry other); // set operators Geometry intersection (in Geometry other); Geometry union_op(in Geometry other); Geometry difference (in Geometry other); Geometry symmetric_difference (in Geometry other); void destroy(); }; //---------------------------------------------------------------------- // GeometryFactory interface //---------------------------------------------------------------------- interface GeometryFactory { exception InvalidWKS {string why;}; exception InvalidWKB {string why;}; exception WKBNotImplemented {}; Geometry create(in Geometry existing); Geometry create_from_WKS(in SpatialReferenceSystem srs, in WKSGeometry geo) raises (InvalidWKS); Geometry create_from_WKB(in SpatialReferenceSystem srs,in OctetSeq geo) raises (InvalidWKB, WKBNotImplemented); }; interface GeometryCollection; interface GeometryIterator; //---------------------------------------------------------------------- // GeometryCollection interface //---------------------------------------------------------------------- interface GeometryCollection : Geometry { exception IteratorInvalid {}; exception PositionInvalid {}; exception GeometryInvalid {}; readonly attribute long number_elements; // these operations allowing for arbitrary collections void add_element (in Geometry element) raises (GeometryInvalid); void merge (in GeometryCollection elements) raises (GeometryInvalid); void insert_element_at (in Geometry element, in GeometryIterator where) raises (GeometryInvalid, IteratorInvalid); void replace_element_at (in Geometry element, in GeometryIterator where) raises (GeometryInvalid, IteratorInvalid, PositionInvalid); void remove_element_at (in GeometryIterator where) raises (IteratorInvalid, PositionInvalid); void remove_all_elements (); // retrieve a geometry from a collection Geometry retrieve_element_at (in GeometryIterator where) raises (IteratorInvalid, PositionInvalid); // create an iterator over the collection GeometryIterator create_iterator(); }; //---------------------------------------------------------------------- // GeometryIterator interface //---------------------------------------------------------------------- interface GeometryIterator { exception IteratorInvalid {}; exception PositionInvalid {}; Geometry next () raises (IteratorInvalid, PositionInvalid); void reset() raises (IteratorInvalid); boolean more(); void destroy(); }; //---------------------------------------------------------------------- // Point interface //---------------------------------------------------------------------- interface Point : Geometry { attribute WKSPoint coordinates; }; //---------------------------------------------------------------------- // PointFactory interface //---------------------------------------------------------------------- interface PointFactory : GeometryFactory { exception InvalidWKSPoint {}; exception InvalidWKBPoint {}; Point create_from_Point(in Point existing); Point create_from_WKSPoint(in SpatialReferenceSystem srs, in WKSPoint geo) raises (InvalidWKSPoint); Point create_from_WKBPoint(in SpatialReferenceSystem srs, in OctetSeq geo) raises (InvalidWKBPoint, WKBNotImplemented); }; //---------------------------------------------------------------------- // MultiPoint interface //---------------------------------------------------------------------- interface MultiPoint : GeometryCollection { }; //---------------------------------------------------------------------- // MultiPointFactory interface //---------------------------------------------------------------------- interface MultiPointFactory : GeometryFactory { exception InvalidWKSMultiPoint {}; exception InvalidWKBMultiPoint {}; MultiPoint create_from_MultiPoint(in MultiPoint existing); MultiPoint create_from_WKSMultiPoint(in SpatialReferenceSystem srs, in WKSPointSeq geo) raises (InvalidWKSMultiPoint); MultiPoint create_from_WKBMultiPoint(in SpatialReferenceSystem srs, in OctetSeq geo) raises (InvalidWKBMultiPoint,WKBNotImplemented); }; //---------------------------------------------------------------------- // Curve interface //---------------------------------------------------------------------- interface Curve : Geometry { exception OutOfDomain {}; readonly attribute double length; readonly attribute Point start_point; readonly attribute Point end_point; readonly attribute WKSPoint start_point_as_WKS; readonly attribute WKSPoint end_point_as_WKS; boolean is_planar(); Point value (in double r) raises (OutOfDomain); WKSPoint value_as_WKS (in double r) raises (OutOfDomain); }; //---------------------------------------------------------------------- // LineString interface //---------------------------------------------------------------------- interface LineString : Curve { exception InvalidIndex{}; exception MinimumPoints{}; readonly attribute long num_points; Point get_point_by_index (in long index) raises (InvalidIndex); WKSPoint get_point_by_index_as_WKS (in long index) raises (InvalidIndex); void set_point_by_index (in WKSPoint new_point, in long index) raises (InvalidIndex); void set_point_by_index_with_WKS (in WKSPoint new_point, in long index) raises (InvalidIndex); void insert_point_by_index (in Point new_point, in long index) raises (InvalidIndex); void insert_point_by_index_with_WKS (in WKSPoint new_point, in long index) raises (InvalidIndex); void append_point (in Point new_point); void append_point_with_WKS (in WKSPoint new_point); void delete_point_by_index (in long index) raises (InvalidIndex, MinimumPoints); }; //---------------------------------------------------------------------- // LineStringFactory interface //---------------------------------------------------------------------- interface LineStringFactory : GeometryFactory { exception InvalidWKSLineString {}; exception InvalidWKBLineString {}; LineString create_from_LineString(in LineString existing); LineString create_from_WKSLineString (in SpatialReferenceSystem srs, in WKSLineString geo) raises (InvalidWKSLineString); LineString create_from_WKBLineString(in SpatialReferenceSystem srs, in OctetSeq geo) raises (InvalidWKBLineString,WKBNotImplemented); }; //---------------------------------------------------------------------- // Ring interface //---------------------------------------------------------------------- interface Ring : Curve { }; //---------------------------------------------------------------------- // LinearRing interface //---------------------------------------------------------------------- interface LinearRing : Ring, LineString { }; //---------------------------------------------------------------------- // MultiCurve interface //---------------------------------------------------------------------- interface MultiCurve : GeometryCollection { readonly attribute double length; }; //---------------------------------------------------------------------- // MultiLineString interface //---------------------------------------------------------------------- interface MultiLineString : MultiCurve { }; //---------------------------------------------------------------------- // MultiLineStringFactory interface //---------------------------------------------------------------------- interface MultiLineStringFactory : GeometryFactory { exception InvalidWKSMultiLineString {}; exception InvalidWKBMultiLineString {}; MultiLineString create_from_MultiLineString( in MultiLineString existing); MultiLineString create_from_WKSMultiLineString( in SpatialReferenceSystem srs, in WKSLineStringSeq geo) raises (InvalidWKSMultiLineString); MultiLineString create_from_WKBMultiLineString( in SpatialReferenceSystem srs, in OctetSeq geo) raises (InvalidWKBMultiLineString,WKBNotImplemented); }; //---------------------------------------------------------------------- // Surface interface //---------------------------------------------------------------------- interface Surface : Geometry { readonly attribute double area; readonly attribute Point centroid; readonly attribute WKSPoint centroid_as_WKS; readonly attribute Point point_on_surface; readonly attribute WKSPoint point_on_surface_as_WKS; boolean is_planar(); }; //---------------------------------------------------------------------- // Polygon interface //---------------------------------------------------------------------- interface Polygon : Surface { readonly attribute Ring exterior_ring; readonly attribute WKSGeometry exterior_ring_as_WKS; readonly attribute MultiCurve interior_rings; readonly attribute WKSGeometry interior_rings_as_WKS; }; //---------------------------------------------------------------------- // LinearPolygon interface //---------------------------------------------------------------------- interface LinearPolygon : Polygon { }; //---------------------------------------------------------------------- // LinearPolygonFactory interface //---------------------------------------------------------------------- interface LinearPolygonFactory : GeometryFactory { exception InvalidWKSLinearPolygon {}; exception InvalidWKBLinearPolygon {}; LinearPolygon create_from_LinearPolygon(in LinearPolygon existing); LinearPolygon create_from_WKSLinearPolygon( in SpatialReferenceSystem srs, in WKSLinearPolygon geo) raises (InvalidWKSLinearPolygon); LinearPolygon create_from_WKBLinearPolygon( in SpatialReferenceSystem srs, in OctetSeq geo) raises (InvalidWKBLinearPolygon,WKBNotImplemented); }; //---------------------------------------------------------------------- // MultiSurface interface //---------------------------------------------------------------------- interface MultiSurface : GeometryCollection { readonly attribute double area; }; //---------------------------------------------------------------------- // MultiPolygon interface //---------------------------------------------------------------------- interface MultiPolygon : MultiSurface { }; //---------------------------------------------------------------------- // MultiLinearPolygon interface //---------------------------------------------------------------------- interface MultiLinearPolygon : MultiPolygon { }; //---------------------------------------------------------------------- // MultiLinearPolygon interface //---------------------------------------------------------------------- interface MultiLinearPolygonFactory : GeometryFactory { exception InvalidWKSMultiLinearPolygon {}; exception InvalidWKBMultiLinearPolygon {}; MultiLinearPolygon create_from_MultiLinearPolygon( in MultiLinearPolygon existing); MultiLinearPolygon create_from_WKSMultiLinearPolygon( in SpatialReferenceSystem srs, in WKSLinearPolygonSeq geo) raises (InvalidWKSMultiLinearPolygon); MultiLinearPolygon create_from_WKBMultiLinearPolygon( in SpatialReferenceSystem srs, in OctetSeq geo) raises (InvalidWKBMultiLinearPolygon); }; }; // End OGIS Module #endif // _OGIS_GEOMETRY_IDL_