On Wed, Aug 8, 2012 at 3:43 PM, Niels Charlier <ni...@scitus.be> wrote:

> Okay,
>
> The proposal has been updated and a new patch has been uploaded :)
>

Thanks Niels,
looked at the patch, seems like a solid improvement.

One part that still makes me wonder is this one:

diff --git
a/modules/library/api/src/main/java/org/geotools/geometry/jts/JTS.java
b/modules/library/api/src/main/java/org/geotools/geometry/jts/JTS.java
index 692b66c..e045d04 100644
--- a/modules/library/api/src/main/java/org/geotools/geometry/jts/JTS.java
+++ b/modules/library/api/src/main/java/org/geotools/geometry/jts/JTS.java
@@ -176,7 +176,8 @@ public final class JTS {
         ensureNonNull("sourceEnvelope", sourceEnvelope);
         ensureNonNull("transform", transform);

-        if ((transform.getSourceDimensions() != 2) ||
(transform.getTargetDimensions() != 2)) {
+        if (transform.getSourceDimensions() !=
transform.getTargetDimensions() ||
+            transform.getSourceDimensions() < 2){
             throw new
MismatchedDimensionException(Errors.format(ErrorKeys.BAD_TRANSFORM_$1,
                     Classes.getShortClassName(transform)));
         }
@@ -219,7 +220,7 @@ public final class JTS {

         return targetEnvelope;
     }
-
+

There is a mix of things that confuse me a bit here:
* the method in the transformation is purely 2D anyways, you won't get
  a 3D envelope out of it (it samples the 2D perimeter of the original
bounds
  to make an accurate transformation)
* it may be legit to transform a 3D bbox into a 2D one, because maybe you
  are integrating it with some 2D data, the proper way to go from 3D to 2D
  should be a MathTransform.

The other one is the following, in BBOX3DImpl:

+    public Expression getExpression2() {
+     // in this case, the 3D BBOX falls back to regular 2D bbox behaviour
(until there is more support for 3D geometries)
+     // 3DBBOX must be run as a post-filter in order to support the third
coordinate.
+
+        Coordinate[] coords = new Coordinate[5];
+        coords[0] = new Coordinate(envelope.getMinX(), envelope.getMinY());
+        coords[1] = new Coordinate(envelope.getMinX(), envelope.getMaxY());
+        coords[2] = new Coordinate(envelope.getMaxX(), envelope.getMaxY());
+        coords[3] = new Coordinate(envelope.getMaxX(), envelope.getMinY());
+        coords[4] = new Coordinate(envelope.getMinX(), envelope.getMinY());
+
+        LinearRing ring = null;
+
+        GeometryFactory gfac = new GeometryFactory();
+        try {
+            ring = gfac.createLinearRing(coords);
+        } catch (TopologyException tex) {
+            throw new IllegalFilterException(tex.toString());
+        }
+
+        Polygon polygon = gfac.createPolygon(ring, null);
+        if (envelope instanceof ReferencedEnvelope3D) {
+            ReferencedEnvelope3D refEnv = (ReferencedEnvelope3D) envelope;
+            polygon.setUserData(refEnv.getCoordinateReferenceSystem());
+        }
+
+        return factory.literal(polygon);
+    }

Makes sense, but makes me wonder at the same time, what happens if you
return a 3D geometry instead? I guess you had something break?

In general, given your experience with your proposal, what would you say
are the
missing bits/steps to work on (outside of this proposal) to make 3D data
and queries
really work?

Cheers
Andrea

-- 
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:   +39 0584 962313
mob:   +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to