org.geotools.geometry
Class JTS

java.lang.Object
  extended byorg.geotools.geometry.JTS

Deprecated. This class moved to the org.geotools.geometry.jts package. We hope to keep JTS dependencies in their own package, in order to use other packages for a partial (if accepted by the communauty) ISO 19107 implementation in a future Geotools release.

public final class JTS
extends java.lang.Object

JTS Geometry utility methods, bringing geotools to JTS.

Offers geotools based services such as reprojection.

Responsibilities:

Since:
0.6.0
Version:
$Id: JTS.java 17701 2006-01-23 00:00:51Z desruisseaux $
Author:
Jody Garnett

Nested Class Summary
static class JTS.ReferencedEnvelope
          Deprecated. Moved to ReferencedEnvelope.
 
Method Summary
static JTS.ReferencedEnvelope create(com.vividsolutions.jts.geom.Envelope env, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
          Deprecated. ReferencedEnvelope provides more constructors, and not all of them are listed in this factory.
static GeometryCoordinateSequenceTransformer createGeometryTransformer()
          Deprecated. Creates a GeometryCoordinateSequenceTransformer.
static GeometryCoordinateSequenceTransformer createPreciseGeometryTransformer(double flatness)
          Deprecated. Creates a GeometryCoordinateSequenceTransformer.
static com.vividsolutions.jts.geom.Envelope empty()
          Deprecated. JTS 1.5 source code inspection show that already invokes Envelope.setToNull(), so this method actually seems to add overhead.
static com.vividsolutions.jts.geom.Geometry preciseTransform(com.vividsolutions.jts.geom.Geometry geom, double flatness, org.opengis.referencing.operation.MathTransform transform)
          Deprecated. Transforms the geometry using the Precise transformer.
static com.vividsolutions.jts.geom.Envelope toGeographic(com.vividsolutions.jts.geom.Envelope env, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
          Deprecated. This method suffers from the same precision problem than transform(Envelope,MathTransform). Consider using JTS.toGeographic(com.vividsolutions.jts.geom.Envelope, org.opengis.referencing.crs.CoordinateReferenceSystem) instead.
static com.vividsolutions.jts.geom.Coordinate transform(com.vividsolutions.jts.geom.Coordinate source, com.vividsolutions.jts.geom.Coordinate dest, org.opengis.referencing.operation.MathTransform transform)
          Deprecated. Transforms the coordinate using the provided math transform.
static com.vividsolutions.jts.geom.Envelope transform(com.vividsolutions.jts.geom.Envelope envelope, org.opengis.referencing.operation.MathTransform transform)
          Deprecated. This implementation gives unaccurate results for transformations more complicated than scales and translations. It should transform at least the four corners (it currently transforms only 2 corners), preferably more. Consider using JTS.transform(Envelope,MathTransform) instead, which transform a densified envelope.
static com.vividsolutions.jts.geom.Envelope transform(com.vividsolutions.jts.geom.Envelope envelope, org.opengis.referencing.operation.MathTransform transform, int npoints)
          Deprecated. JTS should provides a slightly more efficient implementation.
static com.vividsolutions.jts.geom.Geometry transform(com.vividsolutions.jts.geom.Geometry geom, org.opengis.referencing.operation.MathTransform transform)
          Deprecated. Transforms the geometry using the default transformer.
static JTS.ReferencedEnvelope transform(JTS.ReferencedEnvelope envelope, org.opengis.referencing.crs.CoordinateReferenceSystem crs, boolean lenient)
          Deprecated. Moved to ReferencedEnvelope.transform(org.opengis.referencing.crs.CoordinateReferenceSystem, boolean), as a class member.
static void xform(org.opengis.referencing.operation.MathTransform mt, double[] src, double[] dest, int dimensions)
          Deprecated. Like a transform but eXtreme!
static void xform(org.opengis.referencing.operation.MathTransform mt, double[] src, double[] dest, int dimensions, float failureThreshold)
          Deprecated. This implementation do not copies last coordinate correctly transformed as the javadoc said. Consider using JTS instead.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

empty

public static com.vividsolutions.jts.geom.Envelope empty()
Deprecated. JTS 1.5 source code inspection show that already invokes Envelope.setToNull(), so this method actually seems to add overhead.

Returns a new, empty envelope.


create

public static JTS.ReferencedEnvelope create(com.vividsolutions.jts.geom.Envelope env,
                                            org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Deprecated. ReferencedEnvelope provides more constructors, and not all of them are listed in this factory.

Creates a new envelope with the specified coordinate reference system.


transform

public static com.vividsolutions.jts.geom.Envelope transform(com.vividsolutions.jts.geom.Envelope envelope,
                                                             org.opengis.referencing.operation.MathTransform transform,
                                                             int npoints)
                                                      throws org.opengis.referencing.operation.TransformException
Deprecated. JTS should provides a slightly more efficient implementation.

Transforms the Envelope using the specified MathTransform. The envelope is densified (extra points put around the outside edge) to provide a 'better' new envelope for high deformed situations.

Parameters:
envelope - the envelope to transform.
transform - the transform to use.
npoints - densification of each side of the rectange.
Returns:
the transformed envelope.
Throws:
org.opengis.referencing.operation.TransformException - if a coordinate can't be transformed.

xform

public static void xform(org.opengis.referencing.operation.MathTransform mt,
                         double[] src,
                         double[] dest,
                         int dimensions)
                  throws org.opengis.referencing.operation.TransformException
Deprecated. 
Like a transform but eXtreme! Transforms an array of coordinate using the provided math transform. Each Coordinate is transformed seperately. In case of a transform exception then the new value of the coordinate is the last coordinate correctly transformed.

Parameters:
mt - The math transform to apply.
src - The source coordinates.
dest - The destination array for transformed coordinates.
Throws:
org.opengis.referencing.operation.TransformException - if this method failed to transform any of the points.

xform

public static void xform(org.opengis.referencing.operation.MathTransform mt,
                         double[] src,
                         double[] dest,
                         int dimensions,
                         float failureThreshold)
                  throws org.opengis.referencing.operation.TransformException
Deprecated. This implementation do not copies last coordinate correctly transformed as the javadoc said. Consider using JTS instead.

Like a transform but eXtreme! Transforms an array of coordinate using the provided math transform. Each Coordinate is transformed seperately. In case of a transform exception then the new value of the coordinate is the last coordinate correctly transformed.

Parameters:
mt - The math transform to apply.
src - The source coordinates.
dest - The destination array for transformed coordinates.
failureThreshold - Ignored for now.
Throws:
org.opengis.referencing.operation.TransformException - if this method failed to transform any of the points.

transform

public static com.vividsolutions.jts.geom.Envelope transform(com.vividsolutions.jts.geom.Envelope envelope,
                                                             org.opengis.referencing.operation.MathTransform transform)
                                                      throws org.opengis.referencing.operation.TransformException
Deprecated. This implementation gives unaccurate results for transformations more complicated than scales and translations. It should transform at least the four corners (it currently transforms only 2 corners), preferably more. Consider using JTS.transform(Envelope,MathTransform) instead, which transform a densified envelope.

Transforms the Envelope using the specified MathTransform.

Parameters:
envelope - the envelope to transform.
transform - the transform to use.
Returns:
the transformed Envelope
Throws:
org.opengis.referencing.operation.TransformException - if at least one coordinate can't be transformed.

transform

public static JTS.ReferencedEnvelope transform(JTS.ReferencedEnvelope envelope,
                                               org.opengis.referencing.crs.CoordinateReferenceSystem crs,
                                               boolean lenient)
                                        throws org.opengis.referencing.operation.TransformException,
                                               org.opengis.referencing.operation.OperationNotFoundException,
                                               java.util.NoSuchElementException,
                                               org.opengis.referencing.FactoryException
Deprecated. Moved to ReferencedEnvelope.transform(org.opengis.referencing.crs.CoordinateReferenceSystem, boolean), as a class member.

Transforms the referenced envelope using the specified coordinate reference system.

Parameters:
envelope - the envelope to transform.
crs - The target coordinate reference system.
lenient - if datum shift should be applied even if there is insuffisient information. Otherwise (if ), an exception is thrown in such case.
Returns:
the transformed Envelope
Throws:
org.opengis.referencing.operation.TransformException - if at least one coordinate can't be transformed.
org.opengis.referencing.operation.OperationNotFoundException
java.util.NoSuchElementException
org.opengis.referencing.FactoryException

createGeometryTransformer

public static GeometryCoordinateSequenceTransformer createGeometryTransformer()
Deprecated. 
Creates a GeometryCoordinateSequenceTransformer. This basic transformer transforms the vertices and assumes that the underlying data structure is an array of Coordinate objects.


createPreciseGeometryTransformer

public static GeometryCoordinateSequenceTransformer createPreciseGeometryTransformer(double flatness)
Deprecated. 
Creates a GeometryCoordinateSequenceTransformer. This transformer is more accurate than the basic geometry transformer. It assumes that the underlying data structure is an array of Coordinate objects.

Parameters:
flatness - The error in the transform is linked to the "flattening", the higher the flattening, the bigger the error, but also, the lesser the number of points that will be used to represent the resulting coordinate sequence.

transform

public static com.vividsolutions.jts.geom.Geometry transform(com.vividsolutions.jts.geom.Geometry geom,
                                                             org.opengis.referencing.operation.MathTransform transform)
                                                      throws org.opengis.spatialschema.geometry.MismatchedDimensionException,
                                                             org.opengis.referencing.operation.TransformException
Deprecated. 
Transforms the geometry using the default transformer.

Parameters:
geom - The geom to transform
transform - the transform to use during the transformation.
Returns:
the transformed geometry. It will be a new geometry.
Throws:
org.opengis.spatialschema.geometry.MismatchedDimensionException - if the geometry doesn't have the expected dimension for the specified transform.
org.opengis.referencing.operation.TransformException - if a point can't be transformed.

preciseTransform

public static com.vividsolutions.jts.geom.Geometry preciseTransform(com.vividsolutions.jts.geom.Geometry geom,
                                                                    double flatness,
                                                                    org.opengis.referencing.operation.MathTransform transform)
                                                             throws org.opengis.spatialschema.geometry.MismatchedDimensionException,
                                                                    org.opengis.referencing.operation.TransformException
Deprecated. 
Transforms the geometry using the Precise transformer.

Parameters:
geom - The geom to transform
flatness - the "flatness" of the new geometry. Higher is more accurate but has more vertices.
transform - the transform to use during the transformation.
Returns:
the transformed geometry. It will be a new geometry.
Throws:
org.opengis.spatialschema.geometry.MismatchedDimensionException - if the geometry doesn't have the expected dimension for the specified transform.
org.opengis.referencing.operation.TransformException - if a point can't be transformed.

transform

public static com.vividsolutions.jts.geom.Coordinate transform(com.vividsolutions.jts.geom.Coordinate source,
                                                               com.vividsolutions.jts.geom.Coordinate dest,
                                                               org.opengis.referencing.operation.MathTransform transform)
                                                        throws org.opengis.referencing.operation.TransformException
Deprecated. 
Transforms the coordinate using the provided math transform.

Parameters:
source - the source coordinate that will be transformed
dest - the coordinate that will be set. May be null or the source coordinate (or new coordinate of course).
Returns:
the destination coordinate if not null or a new Coordinate.
Throws:
org.opengis.referencing.operation.TransformException - if the coordinate can't be transformed.

toGeographic

public static com.vividsolutions.jts.geom.Envelope toGeographic(com.vividsolutions.jts.geom.Envelope env,
                                                                org.opengis.referencing.crs.CoordinateReferenceSystem crs)
                                                         throws org.opengis.referencing.operation.OperationNotFoundException,
                                                                java.util.NoSuchElementException,
                                                                org.opengis.referencing.FactoryException,
                                                                org.opengis.referencing.operation.TransformException
Deprecated. This method suffers from the same precision problem than transform(Envelope,MathTransform). Consider using JTS.toGeographic(com.vividsolutions.jts.geom.Envelope, org.opengis.referencing.crs.CoordinateReferenceSystem) instead.

Transforms the envelope from its current crs to WGS84 coordinate system.

Parameters:
env - The envelope to transform.
crs - The CRS the envelope is currently in.
Returns:
The envelope transformed to be in WGS84 CRS.
Throws:
org.opengis.referencing.operation.OperationNotFoundException
java.util.NoSuchElementException
org.opengis.referencing.FactoryException
org.opengis.referencing.operation.TransformException


Copyright © GeoTools. All Rights Reserved.