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


org.geotools.coverage.AbstractCoverage
   org.geotools.coverage.CoverageStack

CoverageStack
public class CoverageStack extends AbstractCoverage (Code)
Wraps a stack of as an extra dimension. For example this class can wraps an array of org.geotools.coverage.grid.GridCoverage2D on the same geographic area, but where each GridCoverage2D is for a different date. This CoverageStack manages the two-dimensional coverages as if the whole set was a huge three-dimensional coverage.

Each in the stack usually covers the same , but this is not a requirement. However, they must use the same . For performance reason, the later condition will not be checked except at construction time if the CRS is provided in the envelope, and at evaluation time if Java assertion are enabled. If the CRS of coverage elements is uncertain, consider wrapping them in a TransformedCoverage object.

Coverage elements are often two-dimensional, but this is not a requirement. This stack will simply append one more dimension to the coverage element's CRS dimensions. Coverage elements may be other CoverateStack objects, thus allowing construction of coverages with four or more dimensions.

GridCoverage2D objects tend to be big. In order to keep memory usage raisonable, this implementation doesn't requires all GridCoverage objects at once. Instead, it requires an array of Element objects, which will load the coverage content only when first needed. This CoverageStack implementation remember the last coverage elements used; it will not trig new data loading as long as consecutive calls to evaluate(...) methods require the same coverage elements. Apart from this very simple caching mechanism, caching is the responsability of Element implementations. Note that this simple caching mechanism is suffisient if evaluate(...) methods are invoked with increasing z values.

Each coverage element is expected to extends over a range of z values (the new dimensions appended by this CoverageStack ). If an evaluate(...) method is invoked with a z value not falling in the middle of a coverage element, a linear interpolation is applied.

Note: This implementation is thread-safe.
since:
   2.1
version:
   $Id: CoverageStack.java 27862 2007-11-12 19:51:19Z desruisseaux $
author:
   Martin Desruisseaux


Inner Class :public static interface Element
Inner Class :public static class Adapter implements Element

Field Summary
final public  intzDimension
     The dimension of the z ordinate (the last value in coordinate points).

Constructor Summary
public  CoverageStack(CharSequence name, Collection coverages)
     Constructs a new coverage stack with all the supplied elements.
public  CoverageStack(CharSequence name, CoordinateReferenceSystem crs, Collection elements)
     Constructs a new coverage stack with all the supplied elements.
protected  CoverageStack(CharSequence name, CoverageStack source)
     Constructs a new coverage using the same elements than the specified coverage stack.

Method Summary
public  voidaddIIOReadProgressListener(IIOReadProgressListener listener)
     Adds an IIOReadProgressListener to the list of registered progress listeners.
public  voidaddIIOReadWarningListener(IIOReadWarningListener listener)
     Adds an IIOReadWarningListener to the list of registered warning listeners.
public synchronized  ListcoveragesAt(double z)
     Returns the coverages to be used for the specified z value.
public  Objectevaluate(DirectPosition coord)
     Returns a sequence of values for a given point in the coverage.
public synchronized  boolean[]evaluate(DirectPosition coord, boolean[] dest)
     Returns a sequence of boolean values for a given point in the coverage.
Parameters:
  coord - The coordinate point where to evaluate.
Parameters:
  dest - An array in which to store values, or null to create a new array.
public synchronized  byte[]evaluate(DirectPosition coord, byte[] dest)
     Returns a sequence of byte values for a given point in the coverage.
Parameters:
  coord - The coordinate point where to evaluate.
Parameters:
  dest - An array in which to store values, or null to create a new array.
public synchronized  int[]evaluate(DirectPosition coord, int[] dest)
     Returns a sequence of integer values for a given point in the coverage.
Parameters:
  coord - The coordinate point where to evaluate.
Parameters:
  dest - An array in which to store values, or null to create a new array.
public synchronized  float[]evaluate(DirectPosition coord, float[] dest)
     Returns a sequence of float values for a given point in the coverage.
Parameters:
  coord - The coordinate point where to evaluate.
Parameters:
  dest - An array in which to store values, or null to create a new array.
public synchronized  double[]evaluate(DirectPosition coord, double[] dest)
     Returns a sequence of double values for a given point in the coverage.
Parameters:
  coord - The coordinate point where to evaluate.
Parameters:
  dest - An array in which to store values, or null to create a new array.
public  EnvelopegetEnvelope()
     Returns the bounding box for the coverage domain in coordinate system coordinates.
public  intgetNumSampleDimensions()
     Returns the number of sample dimension in this coverage.
public  SampleDimensiongetSampleDimension(int index)
     Retrieve sample dimension information for the coverage. For a grid coverage, a sample dimension is a band.
public  booleanisInterpolationEnabled()
     Returns true if interpolation are enabled in the z value dimension.
protected  voidlogLoading(LogRecord record)
     Invoked automatically when an image is about to be loaded.
public  voidremoveIIOReadProgressListener(IIOReadProgressListener listener)
     Removes an IIOReadProgressListener from the list of registered progress listeners.
public  voidremoveIIOReadWarningListener(IIOReadWarningListener listener)
     Removes an IIOReadWarningListener from the list of registered warning listeners.
public synchronized  voidsetInterpolationEnabled(boolean flag)
     Enable or disable interpolations in the z value dimension.
public  voidsnap(DirectPosition point)
     Snaps the specified coordinate point to the coordinate of the nearest voxel available in this coverage.

Field Detail
zDimension
final public int zDimension(Code)
The dimension of the z ordinate (the last value in coordinate points). This is always the dimension minus 1.
since:
   2.3




Constructor Detail
CoverageStack
public CoverageStack(CharSequence name, Collection coverages) throws IOException(Code)
Constructs a new coverage stack with all the supplied elements. All coverages must uses the same coordinate reference system. Additionnaly, all coverages must specify their z value in the last dimension of their envelope. The example below constructs two dimensional grid coverages (to be given as the coverages argument) for the same area, but at different times:
 GridCoverageFactory     factory = ...;
 CoordinateReferenceSystem crs2D = ...;  // Yours horizontal CRS.
 TemporalCRS             timeCRS = ...;  // Yours CRS for time measurement.
 CoordinateReferenceSystem crs3D = new CompoundCRS(crs3D, timeCRS);
 List<Coverage> coverages = new ArrayList<Coverage>();
 GeneralEnvelope envelope = new GeneralEnvelope(3); // A 3-dimensional envelope.
 envelope.setRange(...);                            // Set the horizontal part.
 for (int i=0; i<...; i++) {
 envelope.setRange(2, startTime, endTime);
 coverages.add(factory.create(..., crs, envelope, ...);
 }
 
This convenience constructor wraps all coverage intos a Adapter Adapter object. Users with a significant amount of data are encouraged to uses the constructor expecting Element Element objects instead, in order to provides their own implementation loading data only when needed.
Parameters:
  name - The name for this coverage.
Parameters:
  coverages - All Coverage elements for this stack.
throws:
  IOException - if an I/O operation was required and failed.



CoverageStack
public CoverageStack(CharSequence name, CoordinateReferenceSystem crs, Collection elements) throws IOException(Code)
Constructs a new coverage stack with all the supplied elements.
Parameters:
  name - The name for this coverage.
Parameters:
  crs - The coordinate reference system for this coverage.
Parameters:
  elements - All coverage Element Elements for this stack.
throws:
  IOException - if an I/O operation was required and failed.



CoverageStack
protected CoverageStack(CharSequence name, CoverageStack source)(Code)
Constructs a new coverage using the same elements than the specified coverage stack.




Method Detail
addIIOReadProgressListener
public void addIIOReadProgressListener(IIOReadProgressListener listener)(Code)
Adds an IIOReadProgressListener to the list of registered progress listeners.



addIIOReadWarningListener
public void addIIOReadWarningListener(IIOReadWarningListener listener)(Code)
Adds an IIOReadWarningListener to the list of registered warning listeners.



coveragesAt
public synchronized List coveragesAt(double z)(Code)
Returns the coverages to be used for the specified z value. Special cases:

  • If there is no coverage available for the specified z value, returns an .
  • If there is only one coverage available, or if the specified z value falls exactly in the middle of the (i.e. no interpolation are needed), or if , then this method returns a .
  • Otherwise, this method returns a list containing at least 2 coverages, one before and one after the specified z value.

Parameters:
  z - The z value for the coverages to be returned. The coverages for the specified values. May contains 0, 1 or 2 elements.
since:
   2.3



evaluate
public Object evaluate(DirectPosition coord) throws CannotEvaluateException(Code)
Returns a sequence of values for a given point in the coverage. The default implementation delegates to the CoverageStack.evaluate(DirectPosition,double[]) method.
Parameters:
  coord - The coordinate point where to evaluate. The value at the specified point.
throws:
  PointOutsideCoverageException - if coord is outside coverage.
throws:
  CannotEvaluateException - if the computation failed for some other reason.



evaluate
public synchronized boolean[] evaluate(DirectPosition coord, boolean[] dest) throws CannotEvaluateException(Code)
Returns a sequence of boolean values for a given point in the coverage.
Parameters:
  coord - The coordinate point where to evaluate.
Parameters:
  dest - An array in which to store values, or null to create a new array. The dest array, or a newly created array if dest was null.
throws:
  PointOutsideCoverageException - if coord is outside coverage.
throws:
  CannotEvaluateException - if the computation failed for some other reason.



evaluate
public synchronized byte[] evaluate(DirectPosition coord, byte[] dest) throws CannotEvaluateException(Code)
Returns a sequence of byte values for a given point in the coverage.
Parameters:
  coord - The coordinate point where to evaluate.
Parameters:
  dest - An array in which to store values, or null to create a new array. The dest array, or a newly created array if dest was null.
throws:
  PointOutsideCoverageException - if coord is outside coverage.
throws:
  CannotEvaluateException - if the computation failed for some other reason.



evaluate
public synchronized int[] evaluate(DirectPosition coord, int[] dest) throws CannotEvaluateException(Code)
Returns a sequence of integer values for a given point in the coverage.
Parameters:
  coord - The coordinate point where to evaluate.
Parameters:
  dest - An array in which to store values, or null to create a new array. The dest array, or a newly created array if dest was null.
throws:
  PointOutsideCoverageException - if coord is outside coverage.
throws:
  CannotEvaluateException - if the computation failed for some other reason.



evaluate
public synchronized float[] evaluate(DirectPosition coord, float[] dest) throws CannotEvaluateException(Code)
Returns a sequence of float values for a given point in the coverage.
Parameters:
  coord - The coordinate point where to evaluate.
Parameters:
  dest - An array in which to store values, or null to create a new array. The dest array, or a newly created array if dest was null.
throws:
  PointOutsideCoverageException - if coord is outside coverage.
throws:
  CannotEvaluateException - if the computation failed for some other reason.



evaluate
public synchronized double[] evaluate(DirectPosition coord, double[] dest) throws CannotEvaluateException(Code)
Returns a sequence of double values for a given point in the coverage.
Parameters:
  coord - The coordinate point where to evaluate.
Parameters:
  dest - An array in which to store values, or null to create a new array. The dest array, or a newly created array if dest was null.
throws:
  PointOutsideCoverageException - if coord is outside coverage.
throws:
  CannotEvaluateException - if the computation failed for some other reason.



getEnvelope
public Envelope getEnvelope()(Code)
Returns the bounding box for the coverage domain in coordinate system coordinates.



getNumSampleDimensions
public int getNumSampleDimensions()(Code)
Returns the number of sample dimension in this coverage.



getSampleDimension
public SampleDimension getSampleDimension(int index)(Code)
Retrieve sample dimension information for the coverage. For a grid coverage, a sample dimension is a band. The sample dimension information include such things as description, data type of the value (bit, byte, integer...), the no data values, minimum and maximum values and a color table if one is associated with the dimension.



isInterpolationEnabled
public boolean isInterpolationEnabled()(Code)
Returns true if interpolation are enabled in the z value dimension. Interpolations are enabled by default.



logLoading
protected void logLoading(LogRecord record)(Code)
Invoked automatically when an image is about to be loaded. The default implementation logs the message in the "org.geotools.coverage" logger. Subclasses can override this method if they wants a different logging.
Parameters:
  record - The log record. The message contains information about the images to load.



removeIIOReadProgressListener
public void removeIIOReadProgressListener(IIOReadProgressListener listener)(Code)
Removes an IIOReadProgressListener from the list of registered progress listeners.



removeIIOReadWarningListener
public void removeIIOReadWarningListener(IIOReadWarningListener listener)(Code)
Removes an IIOReadWarningListener from the list of registered warning listeners.



setInterpolationEnabled
public synchronized void setInterpolationEnabled(boolean flag)(Code)
Enable or disable interpolations in the z value dimension.



snap
public void snap(DirectPosition point) throws IOException(Code)
Snaps the specified coordinate point to the coordinate of the nearest voxel available in this coverage. First, this method locate the at or near the last ordinate value (the z value). If no coverage is available at the specified z value, then the nearest one is selected. Next, this method locate the pixel under the point coordinate in the coverage element. The point is then set to the pixel center coordinate and to the z value of the selected coverage element. Consequently, calling any evaluate(...) method with snapped coordinates will returns non-interpolated values.
Parameters:
  point - The point to snap.
throws:
  IOException - if an I/O operation was required but failed.



Fields inherited from org.geotools.coverage.AbstractCoverage
final protected CoordinateReferenceSystem crs(Code)(Java Doc)

Methods inherited from org.geotools.coverage.AbstractCoverage
public boolean dispose(boolean force)(Code)(Java Doc)
public void dispose()(Code)(Java Doc)
public Set evaluate(DirectPosition coord, Set list)(Code)(Java Doc)
public boolean[] evaluate(DirectPosition coord, boolean[] dest) throws CannotEvaluateException(Code)(Java Doc)
public byte[] evaluate(DirectPosition coord, byte[] dest) throws CannotEvaluateException(Code)(Java Doc)
public int[] evaluate(DirectPosition coord, int[] dest) throws CannotEvaluateException(Code)(Java Doc)
public float[] evaluate(DirectPosition coord, float[] dest) throws CannotEvaluateException(Code)(Java Doc)
public double[] evaluate(DirectPosition coord, double[] dest) throws CannotEvaluateException(Code)(Java Doc)
public Set evaluateInverse(Record v)(Code)(Java Doc)
public List find(DirectPosition p, int limit)(Code)(Java Doc)
public GeometryValuePair find(DirectPosition p)(Code)(Java Doc)
public CommonPointRule getCommonPointRule()(Code)(Java Doc)
public CoordinateReferenceSystem getCoordinateReferenceSystem()(Code)(Java Doc)
final public int getDimension()(Code)(Java Doc)
public InternationalString[] getDimensionNames()(Code)(Java Doc)
final public String[] getDimensionNames(Locale locale)(Code)(Java Doc)
public Set getDomainElements()(Code)(Java Doc)
public Set getDomainExtents()(Code)(Java Doc)
public Envelope getEnvelope()(Code)(Java Doc)
public Locale getLocale()(Code)(Java Doc)
public String[] getMetadataNames()(Code)(Java Doc)
public String getMetadataValue(String name) throws MetadataNameNotFoundException(Code)(Java Doc)
public InternationalString getName()(Code)(Java Doc)
public Set getRangeElements()(Code)(Java Doc)
public RecordType getRangeType()(Code)(Java Doc)
public RenderableImage getRenderableImage(int xAxis, int yAxis)(Code)(Java Doc)
public List getSources()(Code)(Java Doc)
public Set list()(Code)(Java Doc)
public Set select(Geometry arg0, Period arg1)(Code)(Java Doc)
public void show(int xAxis, int yAxis)(Code)(Java Doc)
public void show(String title, int xAxis, int yAxis)(Code)(Java Doc)
public void show(String title)(Code)(Java Doc)
public void show()(Code)(Java Doc)
public String toString()(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.