Mercurial > dive4elements > gnv-client
comparison 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 |
comparison
equal
deleted
inserted
replaced
144:fcfa9d2de572 | 263:031ef9649cd1 |
---|---|
95 * @return an Object! (not strongly typed) | 95 * @return an Object! (not strongly typed) |
96 * @throws TechnicalException | 96 * @throws TechnicalException |
97 */ | 97 */ |
98 public Object getValue(int pPos) throws TechnicalException { | 98 public Object getValue(int pPos) throws TechnicalException { |
99 if (pPos < mObjects.length) { | 99 if (pPos < mObjects.length) { |
100 return mObjects[pPos]; | 100 |
101 Object o = mObjects[pPos]; | |
102 if (o instanceof SeShape){ | |
103 return this.getPosValue(pPos); | |
104 }else{ | |
105 return o; | |
106 } | |
101 } else { | 107 } else { |
102 throw new TechnicalException("Cannot access this field position. Size is: " + mObjects.length); | 108 throw new TechnicalException("Cannot access this field position. Size is: " + mObjects.length); |
103 } | 109 } |
104 } | 110 } |
105 | 111 |
146 * @throws TechnicalException | 152 * @throws TechnicalException |
147 * @see #getValue(int) | 153 * @see #getValue(int) |
148 */ | 154 */ |
149 public String getStringValue(int pPos) throws TechnicalException { | 155 public String getStringValue(int pPos) throws TechnicalException { |
150 try { | 156 try { |
151 return (String) getValue(pPos); | 157 Object o = this.getValue(pPos); |
158 String returnValue = null; | |
159 if (o instanceof SeShape){ | |
160 returnValue = this.getPosValue(pPos); | |
161 }else{ | |
162 returnValue = (String)o; | |
163 } | |
164 return returnValue; | |
152 } catch (ClassCastException e) { | 165 } catch (ClassCastException e) { |
153 throw new TechnicalException("Could not cast this value to the String Type. Object is of value type: " + getValue(pPos).getClass().getName()); | 166 throw new TechnicalException("Could not cast this value to the String Type. Object is of value type: " + getValue(pPos).getClass().getName()); |
154 } | 167 } |
155 } | 168 } |
156 | 169 |
227 SeShape val; | 240 SeShape val; |
228 ArrayList aList; | 241 ArrayList aList; |
229 SDEPoint mPoint[]; | 242 SDEPoint mPoint[]; |
230 double lat,lon; | 243 double lat,lon; |
231 try { | 244 try { |
232 val = (SeShape) getValue(pPos); | 245 val = (SeShape) this.mObjects[pPos]; |
233 aList = val.getAllPoints(0,false); | 246 aList = val.getAllPoints(0,false); |
234 mPoint = (SDEPoint[])aList.get(0); | 247 mPoint = (SDEPoint[])aList.get(0); |
235 lat = mPoint[0].getY(); | 248 lat = mPoint[0].getY(); |
236 lon = mPoint[0].getX(); | 249 lon = mPoint[0].getX(); |
237 String nord="N"; | 250 String nord="N"; |