I did some investigating. The error is thrown here
// create a target CS so that the dimensions not contemplated in the
source CS
// are copied over (think Z or M with a 2d CRS)
int targetCSDim = targetDim + (sequence.getDimension() - sourceDim);
CoordinateSequence result = csFactory.create(sequence.size(),
targetCSDim);
see
https://github.com/geotools/geotools/blob/master/modules/library/api/src/main/java/org/geotools/geometry/jts/DefaultCoordinateSequenceTransformer.java#L90
`targetCSDim` is 4 because:
1. `sequence.getDimension()` delegates to its default implementation
`CoordinateArraySequence` which always returns 3, regardless of its content.
2. `sourceDim` is 2
3. `targetDim' is 3
4. 3 + 3 - 2 = 4
`csFactory.create` delegates to `CoordinateArraySequenceFactory` which does
the following check
if (dimension > 3)
throw new IllegalArgumentException("dimension must be <= 3");
Am I using the API wrong?
--
View this message in context:
http://osgeo-org.1560.n6.nabble.com/Exception-transforming-a-WGS84-coordinate-into-geocentric-cartesian-coordinate-tp4976925p4976962.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
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-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users