001: /*
002: * This file is part of the GeOxygene project source files.
003: *
004: * GeOxygene aims at providing an open framework which implements OGC/ISO specifications for
005: * the development and deployment of geographic (GIS) applications. It is a open source
006: * contribution of the COGIT laboratory at the Institut Géographique National (the French
007: * National Mapping Agency).
008: *
009: * See: http://oxygene-project.sourceforge.net
010: *
011: * Copyright (C) 2005 Institut Géographique National
012: *
013: * This library is free software; you can redistribute it and/or modify it under the terms
014: * of the GNU Lesser General Public License as published by the Free Software Foundation;
015: * either version 2.1 of the License, or any later version.
016: *
017: * This library is distributed in the hope that it will be useful, but WITHOUT ANY
018: * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
019: * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
020: *
021: * You should have received a copy of the GNU Lesser General Public License along with
022: * this library (see file LICENSE if present); if not, write to the Free Software
023: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
024: *
025: */
026:
027: package fr.ign.cogit.geoxygene.datatools.oracle;
028:
029: import fr.ign.cogit.geoxygene.datatools.Geodatabase;
030: import fr.ign.cogit.geoxygene.spatial.coordgeom.DirectPosition;
031: import fr.ign.cogit.geoxygene.spatial.coordgeom.GM_Envelope;
032: import fr.ign.cogit.geoxygene.spatial.geomprim.GM_Point;
033: import fr.ign.cogit.geoxygene.spatial.geomroot.GM_Object;
034: import fr.ign.cogit.geoxygene.util.algo.GeomAlgorithms;
035:
036: /**
037: * Appel des methodes Oracle sur des GM_Object.
038: *
039: * @author Thierry Badard, Arnaud Braun & Christophe Pele
040: * @version 1.1
041: *
042: */
043:
044: public class OracleAlgorithms implements GeomAlgorithms {
045:
046: Geodatabase data;
047: double tolerance;
048:
049: public OracleAlgorithms(Geodatabase db, double tol) {
050: data = db;
051: tolerance = tol;
052: }
053:
054: public GM_Object bufferAgregat(GM_Object geom, double radius) {
055: return OracleSpatialQuery.bufferAgregat(data, tolerance,
056: radius, geom);
057: }
058:
059: public GM_Object buffer(GM_Object geom, double radius) {
060: return OracleSpatialQuery.buffer(data, tolerance, radius, geom);
061: }
062:
063: public GM_Object buffer10(GM_Object geOxyGeom) {
064: return OracleSpatialQuery.bufferAgregat(data, tolerance, 10,
065: geOxyGeom);
066: }
067:
068: public GM_Object convexHull(GM_Object geom) {
069: return OracleSpatialQuery.convexHull(data, tolerance, geom);
070: }
071:
072: public GM_Object centroid(GM_Object geom) {
073: return new GM_Point(OracleSpatialQuery.centroid(data,
074: tolerance, geom));
075: }
076:
077: public DirectPosition representativePoint(GM_Object geom) {
078: return OracleSpatialQuery.representativePoint(data, tolerance,
079: geom);
080: }
081:
082: public GM_Envelope envelope(GM_Object geom) {
083: return OracleSpatialQuery.mbr(data, geom);
084: }
085:
086: public GM_Object difference(GM_Object g1, GM_Object g2) {
087: return OracleSpatialQuery.difference(data, tolerance, g1, g2);
088: }
089:
090: public GM_Object intersection(GM_Object g1, GM_Object g2) {
091: return OracleSpatialQuery.intersection(data, tolerance, g1, g2);
092: }
093:
094: public GM_Object union(GM_Object g1, GM_Object g2) {
095: return OracleSpatialQuery.union(data, tolerance, g1, g2);
096: }
097:
098: public GM_Object symDifference(GM_Object g1, GM_Object g2) {
099: return OracleSpatialQuery.symmetricDifference(data, tolerance,
100: g1, g2);
101: }
102:
103: public boolean contains(GM_Object g1, GM_Object g2) {
104: return OracleSpatialQuery.contains(data, tolerance, g1, g2);
105: }
106:
107: public boolean contains(GM_Object g, DirectPosition P) {
108: return OracleSpatialQuery.contains(data, tolerance, g, P);
109: }
110:
111: public boolean intersects(GM_Object g1, GM_Object g2) {
112: return OracleSpatialQuery.intersects(data, tolerance, g1, g2);
113: }
114:
115: public boolean equals(GM_Object g1, GM_Object g2) {
116: return OracleSpatialQuery.equals(data, tolerance, g1, g2);
117: }
118:
119: public boolean isSimple(GM_Object geom) {
120: return OracleSpatialQuery.isSimple(geom);
121: }
122:
123: public double area(GM_Object geom) {
124: return OracleSpatialQuery.area(geom);
125: }
126:
127: public double length(GM_Object geom) {
128: return OracleSpatialQuery.length(geom);
129: }
130:
131: public double distance(GM_Object g1, GM_Object g2) {
132: return OracleSpatialQuery.distance(data, tolerance, g1, g2);
133: }
134:
135: } // class
|