Java Doc for GridToEnvelopeMapper.java in  » GIS » GeoTools-2.4.1 » org » geotools » referencing » operation » builder » 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.operation.builder 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.geotools.referencing.operation.builder.GridToEnvelopeMapper

GridToEnvelopeMapper
public class GridToEnvelopeMapper (Code)
A helper class for building n-dimensional mapping to . The affine transform will be computed automatically from the information specified by the GridToEnvelopeMapper.setGridRange setGridRange and GridToEnvelopeMapper.setEnvelope setEnvelope methods, which are mandatory. All other setter methods are optional hints about the affine transform to be created. This builder is convenient when the following conditions are meet:

  • Pixels coordinates (usually (x,y) integer values inside the rectangle specified by the grid range) are expressed in some known at compile time. This is often the case. For example the CRS attached to BufferedImage has always ( , ) axis, with the origin (0,0) in the upper left corner, and row values increasing down.

  • "Real world" coordinates (inside the envelope) are expressed in arbitrary horizontal coordinate reference system. Axis directions may be ( , ), or ( , ), etc..

In such case (and assuming that the image's CRS has the same characteristics than the BufferedImage 's CRS described above):

  • GridToEnvelopeMapper.setSwapXY swapXY shall be set to true if the "real world" axis order is ( , ) instead of ( , ). This axis swapping is necessary for mapping the ( , ) axis order associated to the image CRS.

  • In addition, the "real world" axis directions shall be reversed (by invoking (dimension)) if their direction is AxisDirection.WEST WEST (x axis) or AxisDirection.NORTH NORTH (y axis), in order to get them oriented toward the AxisDirection.EASTEAST or AxisDirection.SOUTH SOUTH direction respectively. The later may seems unatural, but it reflects the fact that row values are increasing down in an BufferedImage 's CRS.


since:
   2.3
version:
   $Id: GridToEnvelopeMapper.java 25778 2007-06-08 08:46:34Z desruisseaux $
author:
   Martin Desruisseaux


Field Summary
final public static  intREVERSE_AXIS
     A bit mask for the GridToEnvelopeMapper.setReverseAxis reverseAxis property.
final public static  intSWAP_XY
     A bit mask for the GridToEnvelopeMapper.setSwapXY swapXY property.

Constructor Summary
public  GridToEnvelopeMapper()
     Creates a new instance of GridToEnvelopeMapper .
public  GridToEnvelopeMapper(GridRange gridRange, Envelope userRange)
     Creates a new instance for the specified grid range and envelope.
Parameters:
  gridRange - The valid coordinate range of a grid coverage.
Parameters:
  userRange - The corresponding coordinate range in user coordinate.

Method Summary
public  AffineTransformcreateAffineTransform()
     Returns the math transform as a two-dimensional affine transform.
public  MathTransformcreateTransform()
     Creates a math transform using the information provided by setter methods.
public  EnvelopegetEnvelope()
     Returns the envelope.
public  GridRangegetGridRange()
     Returns the grid range.
public  PixelInCellgetGridType()
     Returns whatever the grid range maps or .
public  boolean[]getReverseAxis()
     Returns which (if any) axis in user space (not grid space) should have their direction reversed.
public  booleangetSwapXY()
     Returns true if the two first axis should be interchanged.
public  booleanisAutomatic(int mask)
     Returns true if all properties designed by the specified bit mask will be computed automatically.
public  voidreverseAxis(int dimension)
     Reverses a single axis in user space.
public  voidsetAutomatic(int mask)
     Set all properties designed by the specified bit mask as automatic.
public  voidsetEnvelope(Envelope envelope)
     Set the envelope.
public  voidsetGridRange(GridRange gridRange)
     Set the grid range.
public  voidsetGridType(PixelInCell gridType)
     Set whatever the grid range maps or .
public  voidsetReverseAxis(boolean[] reverse)
     Set which (if any) axis in user space (not grid space) should have their direction reversed.
public  voidsetSwapXY(boolean swapXY)
     Tells if the two first axis should be interchanged.
public static  booleanswapXY(CoordinateSystem cs)
     Applies heuristic rules in order to determine if the two first axis should be interchanged.

Field Detail
REVERSE_AXIS
final public static int REVERSE_AXIS(Code)
A bit mask for the GridToEnvelopeMapper.setReverseAxis reverseAxis property.
See Also:   GridToEnvelopeMapper.isAutomatic
See Also:   GridToEnvelopeMapper.setAutomatic



SWAP_XY
final public static int SWAP_XY(Code)
A bit mask for the GridToEnvelopeMapper.setSwapXY swapXY property.
See Also:   GridToEnvelopeMapper.isAutomatic
See Also:   GridToEnvelopeMapper.setAutomatic




Constructor Detail
GridToEnvelopeMapper
public GridToEnvelopeMapper()(Code)
Creates a new instance of GridToEnvelopeMapper .



GridToEnvelopeMapper
public GridToEnvelopeMapper(GridRange gridRange, Envelope userRange) throws MismatchedDimensionException(Code)
Creates a new instance for the specified grid range and envelope.
Parameters:
  gridRange - The valid coordinate range of a grid coverage.
Parameters:
  userRange - The corresponding coordinate range in user coordinate. This envelope mustcontains entirely all pixels, i.e. the envelope's upper left corner mustcoincide with the upper left corner of the first pixel and the envelope'slower right corner must coincide with the lower right corner of the lastpixel.
throws:
  MismatchedDimensionException - if the grid range and the envelope doesn't haveconsistent dimensions.




Method Detail
createAffineTransform
public AffineTransform createAffineTransform() throws IllegalStateException(Code)
Returns the math transform as a two-dimensional affine transform.
throws:
  IllegalStateException - if the math transform is not of the appropriate type.



createTransform
public MathTransform createTransform() throws IllegalStateException(Code)
Creates a math transform using the information provided by setter methods.
throws:
  IllegalStateException - if the grid range or the envelope were not set.



getEnvelope
public Envelope getEnvelope() throws IllegalStateException(Code)
Returns the envelope. For performance reason, this method do not clone the envelope. So the returned object should not be modified.
throws:
  IllegalStateException - if the envelope has not yet been defined.



getGridRange
public GridRange getGridRange() throws IllegalStateException(Code)
Returns the grid range.
throws:
  IllegalStateException - if the grid range has not yet been defined.



getGridType
public PixelInCell getGridType()(Code)
Returns whatever the grid range maps or .



getReverseAxis
public boolean[] getReverseAxis()(Code)
Returns which (if any) axis in user space (not grid space) should have their direction reversed. If ( ) returns true (which is the default), then this method make the following assumptions:

  • Axis should be reverted if needed in order to point toward their " " direction.
  • An exception to the above rule is the second axis in grid space, which is assumed to be the y axis on output device (usually the screen). This axis is reversed again in order to match the bottom direction often used with such devices.
The reversal state of each axis, or null if unspecified.For performance reason, this method do not clone the returned array.



getSwapXY
public boolean getSwapXY()(Code)
Returns true if the two first axis should be interchanged. If ( ) returns true (which is the default), then this method make the following assumptions:
  • Axis order in the grid range matches exactly axis order in the envelope, except for the special case described in the next point. In other words, if axis order in the underlying image is (column, row) (which is the case for a majority of images), then the envelope should probably have a (longitude, latitude) or (easting, northing) axis order.

  • An exception to the above rule applies for CRS using exactly the following axis order: ( AxisDirection.NORTH NORTH | AxisDirection.SOUTH SOUTH , AxisDirection.EAST EAST | AxisDirection.WEST WEST ). An example of such CRS is EPSG:4326 . In this particular case, this method will returns true , thus suggesting to interchange the (y,x) axis for such CRS.




isAutomatic
public boolean isAutomatic(int mask)(Code)
Returns true if all properties designed by the specified bit mask will be computed automatically.
Parameters:
  mask - Any combinaison of GridToEnvelopeMapper.REVERSE_AXIS or GridToEnvelopeMapper.SWAP_XY.



reverseAxis
public void reverseAxis(int dimension)(Code)
Reverses a single axis in user space. Invoking this methods n time is equivalent to creating a boolean reverse array of the appropriate length, setting reverse[dimension] = true for the n axis to be reversed, and invoke (reverse).



setAutomatic
public void setAutomatic(int mask)(Code)
Set all properties designed by the specified bit mask as automatic. Their value will be computed automatically by the corresponding methods (e.g. GridToEnvelopeMapper.getReverseAxis , GridToEnvelopeMapper.getSwapXY ). By default, all properties are automatic.
Parameters:
  mask - Any combinaison of GridToEnvelopeMapper.REVERSE_AXIS or GridToEnvelopeMapper.SWAP_XY.



setEnvelope
public void setEnvelope(Envelope envelope)(Code)
Set the envelope. This method do not clone the specified envelope, so it should not be modified after this method has been invoked.



setGridRange
public void setGridRange(GridRange gridRange)(Code)
Set the grid range.



setGridType
public void setGridType(PixelInCell gridType)(Code)
Set whatever the grid range maps or .



setReverseAxis
public void setReverseAxis(boolean[] reverse)(Code)
Set which (if any) axis in user space (not grid space) should have their direction reversed. Invoking this method force ( ) to false .
Parameters:
  reverse - The reversal state of each axis. A null value means toreverse no axis. For performance reason, this method do not clone thesupplied array.



setSwapXY
public void setSwapXY(boolean swapXY)(Code)
Tells if the two first axis should be interchanged. Invoking this method force ( ) to false .



swapXY
public static boolean swapXY(CoordinateSystem cs)(Code)
Applies heuristic rules in order to determine if the two first axis should be interchanged.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.