Can't create GeodeticCalculator with Generic_2D

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Can't create GeodeticCalculator with Generic_2D

ian mayo
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

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't create GeodeticCalculator with Generic_2D

Andrea Antonello
Hi Ian,

> 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


>
> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Loading...