Discussion:
[Geotools-devel] Can't create GeodeticCalculator with Generic_2D
Ian Mayo
2017-07-17 10:19:01 UTC
Permalink
Hi all,
I have a requirement to handle points in a relative metres domain -
like a CAD drawing.

I've found [1] the generic-2d CRS, which seems just like what I need.
But, when I try to create a GeodeticCalculator for this CRS the
constructor throws "Argument "ellipsoid" should not be null."

This appears to get thrown because CRS.getEllipsoid(crs) is returning null.

Do I need to include some other .jar file in order to support the
Generic_2D CRS?

Thanks,
Ian


[1]. http://docs.geotools.org/stable/userguide/library/referencing/crs.html#generic-2d
andrea antonello
2017-07-19 05:51:36 UTC
Permalink
Hi Ian,
Post by Ian Mayo
I have a requirement to handle points in a relative metres domain -
like a CAD drawing.
I've found [1] the generic-2d CRS, which seems just like what I need.
But, when I try to create a GeodeticCalculator for this CRS the
constructor throws "Argument "ellipsoid" should not be null."
This appears to get thrown because CRS.getEllipsoid(crs) is returning null.
Do I need to include some other .jar file in order to support the
Generic_2D CRS?
I am not sure I understand this right. You have a cartesian plane,
right? The GeodeticCalculator works on an ellipsoid, which a cartesian
plane doesn't have. To cite the javadoc of the generic_2d: "This CRS
is usefull as a kind of wildcard when no CRS were explicitly
specified."

Related to your problem, isn't translating/scaling through and
affinetransform enough to do your conversions?

Ciao,
Andrea
Post by Ian Mayo
Thanks,
Ian
[1]. http://docs.geotools.org/stable/userguide/library/referencing/crs.html#generic-2d
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoTools-Devel mailing list
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Loading...