On Wed, 6 Oct 2021 at 17:03, Peter Friess <pk.fri...@t-online.de> wrote:
> Sorry Ian, > > I don't get it. I create a Coordinate and pass 3 values: > enh.getX(),enh.getY(), > enh.getZ(). Why are you telling me I pass 2? I also stated I check in the > debugger the Coordinate has x, y, and z. > > The problem is that the CRS returns 2 as dimension, which is correct This is the problem!!! You should be passing in *3* then the check would pass! At no point did I suggest you passed in two. Please produce a small test case so we can all see what is happening. Ian > Peter > > > Am 06.10.2021 um 17:52 schrieb Ian Turton: > > > > On Wed, 6 Oct 2021 at 16:35, Peter Friess <pk.fri...@t-online.de> wrote: > >> Hi Ian >> >> My points have a dimension of 3, see below, or let me repeat here: >> >> gf.createPoint(new Coordinate(enh.getX(), enh.getY(), enh.getZ() >> >> My points have X,Y,Z. The problem is that the CRS returns 2 as dimension, >> which is correct >> > > No that is the problem - your points have a dimension of 3 so you should > not pass in 2 here. You could try calling > `org.geotools.geometry.jts.LiteCoordinateSequence.guessDimension(Coordinate...)` > which should return 3 for your data. > >> , but in PackedCoordinateSequence it does this check (dimension - >> measures < 2) and this measures is 1. measures comes from my Point which >> contains XYZ (I checked in the debugger) when it gets converted to >> CoordinateSequence and this CoordinateSequence returns the 1 for the >> measures >> (cs.getMeasures()). >> >> I have no clue what that measures means and why it is 1. I also do not >> understand why it is necessary to involve a CRS to get a dimension if a >> Point gets (just) cloned. >> > > measures are the M of a POINTMZ or POINTM (so yet another dimension to the > coordinate) - you should get 3-1 = 2 (x,y) and all should be well. > > Yes, it is a show stopper. What I want to try is, use jts-1.11 instead of >> jts-1.18. Not sure if that is compatible with Geotools 25.2. It is also not >> clear to me, who is responsible for jts. Is it the Geotools team, or some >> other team. >> > > It looks like it is a geotools problem, so as a first step raise an issue ( > https://osgeo-org.atlassian.net/jira/software/c/projects/GEOT) preferably > with a test case. Then either wait for a fix to come, or implement a fix or > incentivise someone to care about it for you. > > Ian > > -- > Ian Turton > > -- Ian Turton
_______________________________________________ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users