Mercurial > dive4elements > gnv-client
diff geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java @ 884:12f88239fb33
Updated Javadocs to the Listed Classes.
Also done some Codecleanup and removed unused Methods from the Code.
geo-backend/trunk@842 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Fri, 26 Mar 2010 15:23:03 +0000 |
parents | 9bcc423d8d76 |
children | 8b442223741c |
line wrap: on
line diff
--- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java Fri Mar 26 11:07:01 2010 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java Fri Mar 26 15:23:03 2010 +0000 @@ -1,29 +1,13 @@ /** - * Title: ArcSDEUtils, $Header: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/datasources/sde/ArcSDEUtils.java,v 1.7 2007/11/28 14:05:39 blume Exp $ - * Source: $Source: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/datasources/sde/ArcSDEUtils.java,v $ - * created by: Stefan Blume (blume) - * erstellt am: 21.11.2007 - * Copyright: con terra GmbH, 2005 - * - * modified by: $Author: blume $ - * modified on: $Date: 2007/11/28 14:05:39 $ - * Version: $Revision: 1.7 $ - * TAG: $Name: $ - * locked from: $Locker: $ - * CVS State: $State: Exp $ - * Project: $ProjectName$ + * */ package de.intevation.gnv.geobackend.sde.datasources; -import java.util.Vector; - import org.apache.log4j.Logger; import com.esri.sde.sdk.client.SDEPoint; -import com.esri.sde.sdk.client.SeColumnDefinition; import com.esri.sde.sdk.client.SeError; import com.esri.sde.sdk.client.SeException; -import com.esri.sde.sdk.client.SeTable; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.LineString; @@ -32,15 +16,9 @@ /** * The class <code>ArcSDEUtils</code> fulfills the following purposes: - * <ol> - * <li></li> - * </ol> * * @author blume - * @version 1.0 - * @serial 1.0 - * @see - * @since 21.11.2007 08:20:40 + * @author Tim Englich <tim.englich@intevation.de> */ public class ArcSDEUtils { @@ -49,76 +27,10 @@ */ private static Logger sLogger = Logger.getLogger(ArcSDEUtils.class); - public void displayStats(SeTable.SeTableStats tableStats) { - - sLogger.debug("\n--> Table Statistics\n"); - if (tableStats != null) { - - sLogger.debug("Average - " + tableStats.getAverage()); - sLogger.debug("No of rows - " + tableStats.getCount()); - sLogger.debug("Maximum Value - " + tableStats.getMax()); - sLogger.debug("Minimum Value - " + tableStats.getMin()); - sLogger.debug("No of distinct values - " - + tableStats.getNumDistinct()); - sLogger.debug("Standard Deviation - " + tableStats.getStdDev()); - - sLogger.debug("Distinct type - " - + ArcSDEUtils.resolveType(tableStats - .getDistinctType())); - - int[] distinctFreq = tableStats.getDistinctValueFrequencies(); - Vector distinctValues = tableStats.getDistinctValues(); - sLogger.debug("Distinct values & their frequencies : "); - for (int i = 0; i < distinctFreq.length; i++) - sLogger.debug(distinctValues.elementAt(i) + " - " - + distinctFreq[i]); - }// End if - - }// End displayStats - /** - * Takes an integer corresponding to an ArcSDE data type and returns a - * string description of the type. - * - * @param type - * SDE data type bit-mask. + * Prints an SEEsception into the Logger of this Class + * @param exception */ - public static String resolveType(int type) { - - String typeName = "Invalid Type"; - switch (type) { - - case SeColumnDefinition.TYPE_SMALLINT: - typeName = "Small Int"; - break; - case SeColumnDefinition.TYPE_INTEGER: - typeName = "Int"; - break; - case SeColumnDefinition.TYPE_FLOAT: - typeName = "Float"; - break; - case SeColumnDefinition.TYPE_DOUBLE: - typeName = "Double"; - break; - case SeColumnDefinition.TYPE_STRING: - typeName = "String"; - break; - case SeColumnDefinition.TYPE_BLOB: - typeName = "Blob"; - break; - case SeColumnDefinition.TYPE_DATE: - typeName = "Date"; - break; - case SeColumnDefinition.TYPE_SHAPE: - typeName = "Shape"; - break; - case SeColumnDefinition.TYPE_RASTER: - typeName = "Raster"; - break; - } - return typeName; - }// End method resolveType - public static void printError(SeException exception) { SeError error = exception.getSeError(); @@ -140,8 +52,14 @@ sLogger.debug(exception); - }// End printError + } + /** + * Generate an SDEPoint-Array from a given Geometry. + * This Method did not put the Holes to the Array. + * @param g The Geometry which should be converted. + * @return an SDEPoint-Array from a given Ggeometry. + */ public SDEPoint[] createPoints(Geometry g) { sLogger.debug("createPoints()"); Coordinate[] coords = null; @@ -154,7 +72,7 @@ }else{ coords = g.getCoordinates(); } - + if (coords != null){ SDEPoint[] lSDEPoints = new SDEPoint[coords.length]; for (int i = 0; i < coords.length; i++) { @@ -164,6 +82,5 @@ }else{ return null; } - } }