diff geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/Row.java @ 263:031ef9649cd1

Added SFS-Support to ArcSDE-Query-Part geo-backend/trunk@210 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 13 Oct 2009 08:57:19 +0000
parents 110e3ac1b7d2
children 71b2f263f036
line wrap: on
line diff
--- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/Row.java	Wed Oct 07 10:26:33 2009 +0000
+++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/Row.java	Tue Oct 13 08:57:19 2009 +0000
@@ -97,7 +97,13 @@
      */
     public Object getValue(int pPos) throws TechnicalException {
         if (pPos < mObjects.length) {
-            return mObjects[pPos];
+            
+            Object o =  mObjects[pPos];
+            if (o instanceof SeShape){
+                return this.getPosValue(pPos);
+            }else{
+                return o;
+            }
         } else {
             throw new TechnicalException("Cannot access this field position. Size is: " + mObjects.length);
         }
@@ -148,7 +154,14 @@
      */
     public String getStringValue(int pPos) throws TechnicalException {
         try {
-            return (String) getValue(pPos);
+            Object o = this.getValue(pPos);
+            String returnValue = null;
+            if (o instanceof SeShape){
+                returnValue = this.getPosValue(pPos);
+            }else{
+                returnValue = (String)o;
+            }
+            return returnValue;
         } catch (ClassCastException e) {
             throw new TechnicalException("Could not cast this value to the String Type. Object is of value type: " + getValue(pPos).getClass().getName());
         }
@@ -229,7 +242,7 @@
     	SDEPoint mPoint[];
     	double lat,lon;
     	try {
-    		val = (SeShape) getValue(pPos);
+    		val = (SeShape) this.mObjects[pPos];
     		aList = val.getAllPoints(0,false);
     		mPoint = (SDEPoint[])aList.get(0);
     		lat = mPoint[0].getY();

http://dive4elements.wald.intevation.org