Java Doc for AbstractCS.java in  » GIS » GeoTools-2.4.1 » org » geotools » referencing » cs » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.referencing.cs 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.geotools.referencing.AbstractIdentifiedObject
   org.geotools.referencing.cs.AbstractCS

All known Subclasses:   org.geotools.referencing.cs.DefaultCompoundCS,  org.geotools.referencing.cs.DefaultUserDefinedCS,  org.geotools.referencing.cs.DefaultEllipsoidalCS,  org.geotools.referencing.cs.DefaultSphericalCS,  org.geotools.referencing.cs.DefaultCylindricalCS,  org.geotools.referencing.cs.DefaultVerticalCS,  org.geotools.referencing.cs.DefaultTimeCS,  org.geotools.referencing.cs.DefaultLinearCS,  org.geotools.referencing.cs.DefaultPolarCS,  org.geotools.referencing.cs.DefaultAffineCS,
AbstractCS
public class AbstractCS extends AbstractIdentifiedObject implements CoordinateSystem(Code)
The set of coordinate system axes that spans a given coordinate space. A coordinate system (CS) is derived from a set of (mathematical) rules for specifying how coordinates in a given space are to be assigned to points. The coordinate values in a coordinate tuple shall be recorded in the order in which the coordinate system axes are recorded, whenever those coordinates use a coordinate reference system that uses this coordinate system.

This class is conceptually abstract, even if it is technically possible to instantiate it. Typical applications should create instances of the most specific subclass with Default prefix instead. An exception to this rule may occurs when it is not possible to identify the exact type. For example it is not possible to infer the exact coordinate system from Well Known Text is some cases (e.g. in a LOCAL_CS element). In such exceptional situation, a plain AbstractCS object may be instantiated.
since:
   2.1
version:
   $Id: AbstractCS.java 25485 2007-05-11 19:12:35Z desruisseaux $
author:
   Martin Desruisseaux
See Also:   DefaultCoordinateSystemAxis
See Also:   javax.units.Unit
See Also:   org.geotools.referencing.datum.AbstractDatum
See Also:   org.geotools.referencing.crs.AbstractCRS




Constructor Summary
public  AbstractCS(CoordinateSystem cs)
     Constructs a new coordinate system with the same values than the specified one. This copy constructor provides a way to wrap an arbitrary implementation into a Geotools one or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API.
public  AbstractCS(String name, CoordinateSystemAxis[] axis)
     Constructs a coordinate system from a name.
public  AbstractCS(Map properties, CoordinateSystemAxis[] axis)
     Constructs a coordinate system from a set of properties.

Method Summary
final  booleanaxisColinearWith(CoordinateSystem userCS)
     Returns true if every axis in the specified userCS are colinear with axis in this coordinate system.
final  CoordinateSystemAxis[]axisUsingUnit(Unit unit)
     Returns all axis in the specified unit.
final  booleandirectionColinearWith(CoordinateSystem userCS)
     Compares directions only, without consideration for the axis name.
public  Measuredistance(double[] coord1, double[] coord2)
     Computes the distance between two points.
final  voidensureDimensionMatch(String name, double[] coordinates)
     Convenience method for checking object dimension validity.
public  booleanequals(AbstractIdentifiedObject object, boolean compareMetadata)
     Compares the specified object with this coordinate system for equality.
Parameters:
  object - The object to compare to this .
Parameters:
  compareMetadata - true for performing a strict comparaison, or false for comparing only properties relevant to transformations.
protected  StringformatWKT(Formatter formatter)
     Format the inner part of a Well Known Text (WKT) element.
public  CoordinateSystemAxisgetAxis(int dimension)
     Returns the axis for this coordinate system at the specified dimension.
Parameters:
  dimension - The zero based index of axis.
public  intgetDimension()
     Returns the dimension of the coordinate system.
final  UnitgetDistanceUnit()
     Suggests an unit for measuring distances in this coordinate system.
public  inthashCode()
     Returns a hash value for this coordinate system. The hash code value.
protected  booleanisCompatibleDirection(AxisDirection direction)
     Returns true if the specified axis direction is allowed for this coordinate system.
protected  booleanisCompatibleUnit(AxisDirection direction, Unit unit)
     Returns true is the specified unit is legal for the specified axis direction. This method is invoked at construction time for checking units compatibility.
static  Mapname(int key)
     Creates a name for the predefined constants in subclasses.
public static  CoordinateSystemstandard(CoordinateSystem cs)
     Returns a coordinate system with "standard" axis order and units. Most of the time, this method returns one of the predefined constants with axis in (longitude,latitude) or (X,Y) order, and units in degrees or metres.
public static  MatrixswapAndScaleAxis(CoordinateSystem sourceCS, CoordinateSystem targetCS)
     Returns an affine transform between two coordinate systems.


Constructor Detail
AbstractCS
public AbstractCS(CoordinateSystem cs)(Code)
Constructs a new coordinate system with the same values than the specified one. This copy constructor provides a way to wrap an arbitrary implementation into a Geotools one or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API. This constructor performs a shallow copy, i.e. the properties are not cloned.
since:
   2.2



AbstractCS
public AbstractCS(String name, CoordinateSystemAxis[] axis)(Code)
Constructs a coordinate system from a name.
Parameters:
  name - The coordinate system name.
Parameters:
  axis - The set of axis.



AbstractCS
public AbstractCS(Map properties, CoordinateSystemAxis[] axis)(Code)
Constructs a coordinate system from a set of properties. The properties map is given unchanged to the .
Parameters:
  properties - Set of properties. Should contains at least "name".
Parameters:
  axis - The set of axis.




Method Detail
axisColinearWith
final boolean axisColinearWith(CoordinateSystem userCS)(Code)
Returns true if every axis in the specified userCS are colinear with axis in this coordinate system. The comparaison is insensitive to axis order and units. What matter is axis names (because they are fixed by ISO 19111 specification) and directions.

If this method returns true , then there is good chances that this CS can be used together with userCS as arguments to AbstractCS.swapAndScaleAxis swapAndScaleAxis .

This method should not be public because current implementation is not fully consistent for every pair of CS. It tries to check the opposite direction in addition of the usual one, but only a few pre-defined axis declare their opposite. This method should be okay when invoked on pre-defined CS declared in this package. PredefinedCS uses this method only that way.




axisUsingUnit
final CoordinateSystemAxis[] axisUsingUnit(Unit unit) throws IllegalArgumentException(Code)
Returns all axis in the specified unit. This method is used for implementation of usingUnit methods in subclasses.
Parameters:
  unit - The unit for the new axis. New axis using the specified unit, or null if current axis fits.
throws:
  IllegalArgumentException - If the specified unit is incompatible with the expected one.
See Also:   DefaultCartesianCS.usingUnit
See Also:   DefaultEllipsoidalCS.usingUnit



directionColinearWith
final boolean directionColinearWith(CoordinateSystem userCS)(Code)
Compares directions only, without consideration for the axis name.



distance
public Measure distance(double[] coord1, double[] coord2) throws UnsupportedOperationException, MismatchedDimensionException(Code)
Computes the distance between two points. This method is not available for all coordinate systems. For example, doesn't have suffisient information.
Parameters:
  coord1 - Coordinates of the first point.
Parameters:
  coord2 - Coordinates of the second point. The distance between coord1 and coord2 .
throws:
  UnsupportedOperationException - if this coordinate system can't compute distances.
throws:
  MismatchedDimensionException - if a coordinate doesn't have the expected dimension.



ensureDimensionMatch
final void ensureDimensionMatch(String name, double[] coordinates) throws MismatchedDimensionException(Code)
Convenience method for checking object dimension validity.
Parameters:
  name - The name of the argument to check.
Parameters:
  coordinates - The coordinate array to check.
throws:
  MismatchedDimensionException - if the coordinate doesn't have the expected dimension.



equals
public boolean equals(AbstractIdentifiedObject object, boolean compareMetadata)(Code)
Compares the specified object with this coordinate system for equality.
Parameters:
  object - The object to compare to this .
Parameters:
  compareMetadata - true for performing a strict comparaison, or false for comparing only properties relevant to transformations. true if both objects are equal.



formatWKT
protected String formatWKT(Formatter formatter)(Code)
Format the inner part of a Well Known Text (WKT) element. Note that WKT is not yet defined for coordinate system. Current implementation list the axis contained in this CS.
Parameters:
  formatter - The formatter to use. The WKT element name. Current implementation default to the class name.



getAxis
public CoordinateSystemAxis getAxis(int dimension) throws IndexOutOfBoundsException(Code)
Returns the axis for this coordinate system at the specified dimension.
Parameters:
  dimension - The zero based index of axis. The axis at the specified dimension.
throws:
  IndexOutOfBoundsException - if dimension is out of bounds.



getDimension
public int getDimension()(Code)
Returns the dimension of the coordinate system. This is the number of axis.



getDistanceUnit
final Unit getDistanceUnit() throws ConversionException(Code)
Suggests an unit for measuring distances in this coordinate system. The default implementation scans all , ignoring angular ones (this also implies ignoring ones). If more than one non-angular unit is found, the default implementation returns the "largest" one (e.g. kilometers instead of meters). Suggested distance unit.
throws:
  ConversionException - if some non-angular units are incompatibles.



hashCode
public int hashCode()(Code)
Returns a hash value for this coordinate system. The hash code value. This value doesn't need to be the samein past or future versions of this class.



isCompatibleDirection
protected boolean isCompatibleDirection(AxisDirection direction)(Code)
Returns true if the specified axis direction is allowed for this coordinate system. This method is invoked at construction time for checking argument validity. The default implementation returns true for all axis directions. Subclasses will overrides this method in order to put more restrictions on allowed axis directions.



isCompatibleUnit
protected boolean isCompatibleUnit(AxisDirection direction, Unit unit)(Code)
Returns true is the specified unit is legal for the specified axis direction. This method is invoked at construction time for checking units compatibility. The default implementation returns true in all cases. Subclasses can override this method and check for compatibility with or units.
since:
   2.2



name
static Map name(int key)(Code)
Creates a name for the predefined constants in subclasses. The name is an unlocalized String object. However, since this method is used for creation of convenience objects only (not for objects created from an "official" database), the "unlocalized" name is actually choosen according the user's locale at class initialization time. The same name is also added in a localizable form as an alias. Since the AbstractCS.nameMatches convenience method checks the alias, it still possible to consider two objects are equivalent even if their names were formatted in different locales.



standard
public static CoordinateSystem standard(CoordinateSystem cs) throws IllegalArgumentException(Code)
Returns a coordinate system with "standard" axis order and units. Most of the time, this method returns one of the predefined constants with axis in (longitude,latitude) or (X,Y) order, and units in degrees or metres. In some particular cases like , this method may create a new instance on the fly. In every cases this method attempts to return a right-handed coordinate system, but this is not garanteed.

This method is typically used together with AbstractCS.swapAndScaleAxis swapAndScaleAxis for the creation of a transformation step before some . Example:

 Matrix step1 = swapAndScaleAxis(sourceCS, standard(sourceCS));
 Matrix step2 = ... some transform operating on standard axis ...
 Matrix step3 = swapAndScaleAxis(standard(targetCS), targetCS);
 
A rational for standard axis order and units is explained in the Axis units and direction section in the .
Parameters:
  cs - The coordinate system. A constant similar to the specified cs with "standard" axis.
throws:
  IllegalArgumentException - if the specified coordinate system is unknow to this method.
since:
   2.2



swapAndScaleAxis
public static Matrix swapAndScaleAxis(CoordinateSystem sourceCS, CoordinateSystem targetCS) throws IllegalArgumentException, ConversionException(Code)
Returns an affine transform between two coordinate systems. Only units and axis order (e.g. transforming from ( , ) to ( , are taken in account.

Example: If coordinates in sourceCS are (x,y) pairs in metres and coordinates in targetCS are (-y,x) pairs in centimetres, then the transformation can be performed as below:

[-y(cm)] [ 0 -100 0 ] [x(m)] [ x(cm)] = [ 100 0 0 ] [y(m)] [ 1 ] [ 0 0 1 ] [1 ]

Parameters:
  sourceCS - The source coordinate system.
Parameters:
  targetCS - The target coordinate system. The conversion from sourceCS to targetCS asan affine transform. Only axis direction and units are taken in account.
throws:
  IllegalArgumentException - if axis doesn't matches, or the CS doesn't have thesame geometry.
throws:
  ConversionException - if the unit conversion is non-linear.



Fields inherited from org.geotools.referencing.AbstractIdentifiedObject
final public static GenericName[] EMPTY_ALIAS_ARRAY(Code)(Java Doc)
final public static ReferenceIdentifier[] EMPTY_IDENTIFIER_ARRAY(Code)(Java Doc)
final public static Comparator IDENTIFIER_COMPARATOR(Code)(Java Doc)
final public static Comparator NAME_COMPARATOR(Code)(Java Doc)
final public static Comparator REMARKS_COMPARATOR(Code)(Java Doc)

Methods inherited from org.geotools.referencing.AbstractIdentifiedObject
protected static Set asSet(Object[] array)(Code)(Java Doc)
protected static void ensureAngularUnit(Unit unit) throws IllegalArgumentException(Code)(Java Doc)
protected static void ensureLinearUnit(Unit unit) throws IllegalArgumentException(Code)(Java Doc)
protected static void ensureNonNull(String name, Object object) throws IllegalArgumentException(Code)(Java Doc)
protected static void ensureNonNull(String name, Object[] array, int index) throws IllegalArgumentException(Code)(Java Doc)
protected static void ensureTimeUnit(Unit unit) throws IllegalArgumentException(Code)(Java Doc)
final public boolean equals(Object object)(Code)(Java Doc)
public boolean equals(AbstractIdentifiedObject object, boolean compareMetadata)(Code)(Java Doc)
protected static boolean equals(IdentifiedObject object1, IdentifiedObject object2, boolean compareMetadata)(Code)(Java Doc)
protected static boolean equals(IdentifiedObject[] array1, IdentifiedObject[] array2, boolean compareMetadata)(Code)(Java Doc)
protected static boolean equals(Collection collection1, Collection collection2, boolean compareMetadata)(Code)(Java Doc)
public Collection getAlias()(Code)(Java Doc)
public ReferenceIdentifier getIdentifier(Citation authority)(Code)(Java Doc)
public static ReferenceIdentifier getIdentifier(IdentifiedObject info, Citation authority)(Code)(Java Doc)
public Set getIdentifiers()(Code)(Java Doc)
public ReferenceIdentifier getName()(Code)(Java Doc)
public String getName(Citation authority)(Code)(Java Doc)
public static String getName(IdentifiedObject info, Citation authority)(Code)(Java Doc)
public static Map getProperties(IdentifiedObject info)(Code)(Java Doc)
public static Map getProperties(IdentifiedObject info, Citation authority)(Code)(Java Doc)
public InternationalString getRemarks()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public boolean nameMatches(String name)(Code)(Java Doc)
public static boolean nameMatches(IdentifiedObject object, String name)(Code)(Java Doc)
public static boolean nameMatches(IdentifiedObject o1, IdentifiedObject o2)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.