1

I'm using Geotools, and I need to convert coordinates between 2D and 3D coordinate reference systems. I recognize that there's no universally-correct way to do this: 2D -> 3D means "making up" a Z coordinate, and 3D -> 2D means losing information. But, is there some way to teach Geotools that, in my particular context, I want to use a specific transformation. E.g.:

+-----+                 +-----+
|     | --- Z = 15 ---> |     |
| 2D  |                 |  3D |
|     | <-- drop Z ---- |     |
+-----+                 +-----+

I know I can transform any particular coordinate manually this way, but I'd like to integrate it so this Just Works. e.g. I can do CRS.findMathTranform(a, b) and if a is convertible to my 2D CRS, and my 3D CRS is convertible to b, it works.

2
  • Was my answer acceptable? Do you mind letting us know by “accepting” it (i.e., click the ✔ check) and “upvoting” (click the Λ arrow)? Cheers.
    – Martin F
    May 9, 2015 at 3:33
  • I appreciate the help, but in this case it didn't really solve the problem. Thanks, though! Jun 2, 2015 at 18:52

1 Answer 1

1

I can speak to "coordinate transformation" issue, but not to any Geotools detail.

When transforming between 2D and 3D coordinates, the two systems are often either known to be or assumed to be parallel. Thus, there should be no problem: assign or drop your Z values as needed.

(Maybe you already know that and need the Geotools details that i cannot provide.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.