Mark Payne ha scritto:
> So far I tried the following:
>
> featureSource = ds.getFeatureSource(FEATURE_TYPE_NAME);
> DefaultQuery query = new DefaultQuery(DefaultQuery.ALL);
> Hints hints = new Hints(Hints.COORDINATE_DIMENSION, new Integer(3),
> Hints.FEATURE_2D, Boolean.FALSE);
> query.setHints(hints);
> featureCollection = featureSource.getFeatures(query);
>
> That was the kind of thing you were meaning? I tried the hints that
> seemed the most likely from the list that the Hints object provides.
> Unfortunately it doesn't seem to make a difference, I just get features
> with the X,Y components as before. Does anyone know if I'm on the right
> track, or do I need to provide a different CoordinateSequenceFactory as
> well?
The code in the stable branches will pick up the 3rd dimension
only if the crs had 3 axis:
@Override
public void encodeGeometryColumn(GeometryDescriptor gatt, int srid,
StringBuffer sql) {
CoordinateReferenceSystem crs =
gatt.getCoordinateReferenceSystem();
int dimensions = crs == null ? 2 : crs.getCoordinateSystem()
.getDimension();
sql.append("encode(");
if (dimensions > 2) {
sql.append("asEWKB(");
encodeColumnName(gatt.getLocalName(), sql);
} else {
sql.append("asBinary(");
sql.append("force_2d(");
encodeColumnName(gatt.getLocalName(), sql);
sql.append(")");
}
sql.append(",'XDR'),'base64')");
}
On trunk I've recently (two days ago?) made it use EWKB always,
which means it should pull all the ordinates, but even
that is not fully correct, as it does not respect the FORCE2D
hint.
Actually, the SQLDialect methods should be modified so that they
get the hints otherwise it's not possible to implement things
properly.
I don't have time to look into this, do you? A patch on the
code and an extension to the JDBC3DTest to check support for
FORCE2D would be most welcomed
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users