|
53 | 53 | * @author Thomas Darimont
|
54 | 54 | * @author Oliver Gierke
|
55 | 55 | * @author Christoph Strobl
|
| 56 | + * @author Thiago Diniz da Silveira |
56 | 57 | * @since 1.5
|
57 | 58 | */
|
58 | 59 | abstract class GeoConverters {
|
@@ -120,8 +121,11 @@ public Point convert(DBObject source) {
|
120 | 121 | if (source.containsField("type")) {
|
121 | 122 | return DbObjectToGeoJsonPointConverter.INSTANCE.convert(source);
|
122 | 123 | }
|
| 124 | + |
| 125 | + Number x = (Number) source.get("x"); |
| 126 | + Number y = (Number) source.get("y"); |
123 | 127 |
|
124 |
| - return new Point((Double) source.get("x"), (Double) source.get("y")); |
| 128 | + return new Point(x.doubleValue(), y.doubleValue()); |
125 | 129 | }
|
126 | 130 | }
|
127 | 131 |
|
@@ -255,7 +259,8 @@ public Circle convert(DBObject source) {
|
255 | 259 | }
|
256 | 260 |
|
257 | 261 | DBObject center = (DBObject) source.get("center");
|
258 |
| - Double radius = (Double) source.get("radius"); |
| 262 | + Number radiusNumber = (Number) source.get("radius"); |
| 263 | + Double radius = radiusNumber.doubleValue(); |
259 | 264 |
|
260 | 265 | Distance distance = new Distance(radius);
|
261 | 266 |
|
@@ -326,7 +331,9 @@ public Sphere convert(DBObject source) {
|
326 | 331 | }
|
327 | 332 |
|
328 | 333 | DBObject center = (DBObject) source.get("center");
|
329 |
| - Double radius = (Double) source.get("radius"); |
| 334 | + Number radiusNumber = (Number) source.get("radius"); |
| 335 | + Double radius = radiusNumber.doubleValue(); |
| 336 | + |
330 | 337 |
|
331 | 338 | Distance distance = new Distance(radius);
|
332 | 339 |
|
|
0 commit comments