001 //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/tags/2.1/src/org/deegree/model/crs/IGeoTransformer.java $ 002 /*---------------- FILE HEADER ------------------------------------------ 003 004 This file is part of deegree. 005 Copyright (C) 2001-2007 by: 006 EXSE, Department of Geography, University of Bonn 007 http://www.giub.uni-bonn.de/deegree/ 008 lat/lon GmbH 009 http://www.lat-lon.de 010 011 This library is free software; you can redistribute it and/or 012 modify it under the terms of the GNU Lesser General Public 013 License as published by the Free Software Foundation; either 014 version 2.1 of the License, or (at your option) any later version. 015 016 This library is distributed in the hope that it will be useful, 017 but WITHOUT ANY WARRANTY; without even the implied warranty of 018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 019 Lesser General Public License for more details. 020 021 You should have received a copy of the GNU Lesser General Public 022 License along with this library; if not, write to the Free Software 023 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 024 025 Contact: 026 027 Andreas Poth 028 lat/lon GmbH 029 Aennchenstr. 19 030 53177 Bonn 031 Germany 032 E-Mail: poth@lat-lon.de 033 034 Prof. Dr. Klaus Greve 035 Department of Geography 036 University of Bonn 037 Meckenheimer Allee 166 038 53115 Bonn 039 Germany 040 E-Mail: greve@giub.uni-bonn.de 041 042 ---------------------------------------------------------------------------*/ 043 package org.deegree.model.crs; 044 045 import javax.media.jai.Interpolation; 046 047 import org.deegree.model.coverage.grid.AbstractGridCoverage; 048 import org.deegree.model.coverage.grid.GridCoverage; 049 import org.deegree.model.feature.Feature; 050 import org.deegree.model.feature.FeatureCollection; 051 import org.deegree.model.spatialschema.Envelope; 052 import org.deegree.model.spatialschema.Geometry; 053 import org.deegree.model.spatialschema.GeometryException; 054 055 /** 056 * 057 * 058 * 059 * @version $Revision: 7744 $ 060 * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a> 061 * @author last edited by: $Author: jwanhoff $ 062 * 063 * @version 1.0. $Revision: 7744 $, $Date: 2007-07-10 13:18:16 +0200 (Di, 10 Jul 2007) $ 064 * 065 * @since 2.0 066 */ 067 public interface IGeoTransformer { 068 069 /** 070 * transforms the coodinates of a deegree geometry to the target coordinate reference system. 071 */ 072 public abstract Geometry transform( Geometry geo ) 073 throws CRSTransformationException, CRSException; 074 075 /** 076 * transfroms a <tt>Envelope</tt> to the target crs of the <tt>GeoTransformer</tt> instance 077 * 078 * @param envelope 079 * @param sourceCRS 080 * CRS of the envelope 081 * @return 082 * @throws CRSTransformationException 083 * @throws CRSException 084 */ 085 public abstract Envelope transform( Envelope envelope, String sourceCRS ) 086 throws CRSTransformationException, CRSException; 087 088 /** 089 * transfroms a <tt>Envelope</tt> to the target crs of the <tt>GeoTransformer</tt> instance 090 * 091 * @param envelope 092 * @param sourceCRS 093 * CRS of the envelope 094 * @return 095 * @throws CRSTransformationException 096 * @throws CRSException 097 */ 098 public abstract Envelope transform( Envelope envelope, 099 org.deegree.model.crs.CoordinateSystem sourceCRS ) 100 throws CRSTransformationException, CRSException; 101 102 /** 103 * transforms all geometries contained within the passed 104 * 105 * @see FeatureCollection into the target CRS of a GeoTransformer instance 106 * 107 * @param fc 108 * @return the transformed geometries in the Featurecollection 109 * @throws GeometryException 110 * @throws CRSTransformationException 111 */ 112 public abstract FeatureCollection transform( FeatureCollection fc ) 113 throws CRSTransformationException, CRSException, GeometryException; 114 115 /** 116 * transforms all geometries contained within the passed 117 * 118 * @see Feature into the target CRS of a GeoTransformer instance 119 * 120 * @param feature 121 * @return the transformed geometries in the given Feauture. 122 * @throws GeometryException 123 * @throws CRSTransformationException 124 */ 125 public abstract Feature transform( Feature feature ) 126 throws CRSTransformationException, CRSException, GeometryException; 127 128 /** 129 * transforms a GridCoverage into another coordinate reference system. 130 * 131 * @param coverage 132 * grid coverage to transform 133 * @param refPointsGridSize 134 * size of the grid used to calculate polynoms coefficients. E.g. 2 -≶ 4 points, 3 135 * -≶ 9 points ...<br> 136 * Must be ≶= 2. Accuracy of coefficients increase with size of the grid. Speed 137 * decreases with size of the grid. 138 * @param degree 139 * The degree of the polynomial is supplied as an argument. 140 * @param interpolation 141 * interpolation method for warping the passed coverage. Can be <code>null</code>. 142 * In this case 'Nearest Neighbor' will be used as default 143 * @return 144 */ 145 public abstract GridCoverage transform( AbstractGridCoverage coverage, int refPointsGridSize, 146 int degree, Interpolation interpolation ) 147 throws CRSTransformationException, CRSException; 148 149 }