#1: as others have replied, JTS operates purely on a Cartesian plane. It does not perform calculations in a spherical or spheroidal space.

#2: as mentioned by others, easiest way is to modify the underlying Coordinate of a Point geometry. If you do this, you need to call geiometryChanged() to update the cached information in the Geometry (the Envelope at the moment). Be aware that of course any references to this geometry will not be aware of this change, so you will have to update them as required (e.g. JTS indexes are not aware of changes to contained geometries).

Generally it's not encouraged to modify Geometry objects, since this can lead to nasty aliasing bugs, but it's not prevented for just this reason - in some cases it's more efficient to modify geometry objects in place.

[email protected] wrote:
I'm a beginner and have two questions I couldn't find the answer in documentation:

- Is it possible to define a projection system for my calculations? Example, I want to calculate the distance in km between two points that has coordinates in latitude/longitude degrees in a given projection system for Earth.

- I made a class that represents a moving object, so I used Coordinate implement its location (that changes all the time). I wanted to use Point, but Coordinate is the best class for dynamic info. So I'm instantiating a new Geometry everytime I need to perform calculation using this objects, is that right?

Thank you.
------------------------------------------------------------------------

_______________________________________________
jts-devel mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jts-devel

--
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022

_______________________________________________
jts-devel mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jts-devel

Reply via email to