📄 textrecordimagereader.html
字号:
<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/Reader.html" title="class or interface in java.io"><CODE>Reader</CODE></A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/InputStream.html" title="class or interface in java.io"><CODE>InputStream</CODE></A> or <A HREF="http://java.sun.com/j2se/1.4/docs/api/javax/imageio/stream/ImageInputStream.html" title="class or interface in javax.imageio.stream"><CODE>ImageInputStream</CODE></A>.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/geotools/image/io/TextImageReader.html#setInput(java.lang.Object, boolean, boolean)">setInput</A></CODE> in class <CODE><A HREF="../../../../org/geotools/image/io/TextImageReader.html" title="class in org.geotools.image.io">TextImageReader</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>input</CODE> - The input object to use for future decoding.<DD><CODE>seekForwardOnly</CODE> - If , images and metadata may only be read in ascending order from this input source.<DD><CODE>ignoreMetadata</CODE> - If , metadata may be ignored during reads.</DL></DD></DL><HR><A NAME="getNumBands(int)"><!-- --></A><H3>getNumBands</H3><PRE>public int <B>getNumBands</B>(int imageIndex) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Returns the number of bands available for the specified image.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/geotools/image/io/SimpleImageReader.html#getNumBands(int)">getNumBands</A></CODE> in class <CODE><A HREF="../../../../org/geotools/image/io/SimpleImageReader.html" title="class in org.geotools.image.io">SimpleImageReader</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>imageIndex</CODE> - The image index.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if an error occurs reading the information from the input source.</DL></DD></DL><HR><A NAME="getWidth(int)"><!-- --></A><H3>getWidth</H3><PRE>public int <B>getWidth</B>(int imageIndex) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Returns the width in pixels of the given image within the input source.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>imageIndex</CODE> - the index of the image to be queried.<DT><B>Returns:</B><DD>Image width.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - If an error occurs reading the width information from the input source.</DL></DD></DL><HR><A NAME="getHeight(int)"><!-- --></A><H3>getHeight</H3><PRE>public int <B>getHeight</B>(int imageIndex) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Returns the height in pixels of the given image within the input source.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>imageIndex</CODE> - the index of the image to be queried.<DT><B>Returns:</B><DD>Image height.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - If an error occurs reading the height information from the input source.</DL></DD></DL><HR><A NAME="getLogicalBounds(int)"><!-- --></A><H3>getLogicalBounds</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/awt/geom/Rectangle2D.html" title="class or interface in java.awt.geom">Rectangle2D</A> <B>getLogicalBounds</B>(int imageIndex) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Returns the smallest bounding box containing the full image in user coordinates. The default implementation search for minimum and maximum values in <var>x</var> and <var>y</var> columns (as returned by <A HREF="../../../../org/geotools/image/io/TextRecordImageReader.html#getColumnX(int)"><CODE>getColumnX(int)</CODE></A> and <A HREF="../../../../org/geotools/image/io/TextRecordImageReader.html#getColumnY(int)"><CODE>getColumnY(int)</CODE></A>) and returns a rectangle containing <code>(xmin-dx/2, ymin-dy/2)</code>) and <code>(xmax+dx/2, ymax+dy/2)</code>) points, where <var>dx</var> and <var>dy</var> are grid cell width and height (i.e. the smallest interval between <var>x</var> and <var>y</var> values).<P><DD><DL><DT><B>Parameters:</B><DD><CODE>imageIndex</CODE> - the index of the image to be queried.<DT><B>Returns:</B><DD>Image bounds in user coordinates.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - If an error occurs reading the width information from the input source.</DL></DD></DL><HR><A NAME="getTransform(int)"><!-- --></A><H3>getTransform</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/awt/geom/AffineTransform.html" title="class or interface in java.awt.geom">AffineTransform</A> <B>getTransform</B>(int imageIndex) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Returns an <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/awt/geom/AffineTransform.html" title="class or interface in java.awt.geom"><CODE>AffineTransform</CODE></A> for transforming pixel coordinates to logical coordinates. Pixel coordinates are usually integer values with (0,0) at the image's upper-left corner, while logical coordinates are floating point values at the pixel's upper-left corner. The later is consistent with <a href="http://java.sun.com/products/java-media/jai/">Java Advanced Imaging</a> convention. In order to get logical values at the pixel center, a translation must be apply once as below: <blockquote><pre> AffineTransform tr = getTransform(imageIndex); tr.translate(0.5, 0.5); </pre></blockquote> The default implementation computes the affine transform from <A HREF="../../../../org/geotools/image/io/TextRecordImageReader.html#getLogicalBounds(int)"><CODE>getLogicalBounds(int)</CODE></A>, <A HREF="../../../../org/geotools/image/io/TextRecordImageReader.html#getWidth(int)"><CODE>getWidth(int)</CODE></A> and <A HREF="../../../../org/geotools/image/io/TextRecordImageReader.html#getHeight(int)"><CODE>getHeight(int)</CODE></A>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>imageIndex</CODE> - the index of the image to be queried.<DT><B>Returns:</B><DD>A transform mapping pixel coordinates to logical coordinates.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if an I/O operation failed.</DL></DD></DL><HR><A NAME="getExpectedRange(int, int)"><!-- --></A><H3>getExpectedRange</H3><PRE>public <A HREF="http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/util/Range.html" title="class or interface in javax.media.jai.util">Range</A> <B>getExpectedRange</B>(int imageIndex, int band) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Returns the range of values for the specified band.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/geotools/image/io/SimpleImageReader.html#getExpectedRange(int, int)">getExpectedRange</A></CODE> in class <CODE><A HREF="../../../../org/geotools/image/io/SimpleImageReader.html" title="class in org.geotools.image.io">SimpleImageReader</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>imageIndex</CODE> - The image index.<DD><CODE>band</CODE> - The band index. Valid index goes from inclusive to exclusive. Index are independent of any <A HREF="http://java.sun.com/j2se/1.4/docs/api/javax/imageio/IIOParam.html#setSourceBands(int[])" title="class or interface in javax.imageio"><CODE>IIOParam.setSourceBands(int[])</CODE></A> setting.<DT><B>Returns:</B><DD>The expected range of values, or if unknow.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - If an error occurs reading the data information from the input source.</DL></DD></DL><HR><A NAME="parseLine(java.lang.String, double[])"><!-- --></A><H3>parseLine</H3><PRE>protected double[] <B>parseLine</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> line, double[] values) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/text/ParseException.html" title="class or interface in java.text">ParseException</A></PRE><DL><DD>Converts a line from the <A HREF="http://java.sun.com/j2se/1.4/docs/api/javax/imageio/ImageReader.html#input" title="class or interface in javax.imageio">input</A> stream to numerical values. This method is invoked automatically for each line to be read. The default implementation parse the line using the object created by <A HREF="../../../../org/geotools/image/io/TextImageReader.html#getLineFormat(int)"><CODE>TextImageReader.getLineFormat(int)</CODE></A>, and replace all occurences of the <A HREF="../../../../org/geotools/image/io/TextImageReader.html#getPadValue(int)">pad value</A> by <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Double.html#NaN" title="class or interface in java.lang"><CODE>Double.NaN</CODE></A> in every columns except the ones for <A HREF="../../../../org/geotools/image/io/TextRecordImageReader.html#getColumnX(int)">x</A> and <A HREF="../../../../org/geotools/image/io/TextRecordImageReader.html#getColumnY(int)">y</A> values. <p> <strong>TIP:</strong> This method is a convenient place where to fix rounding error in latitude and longitude coordinates. For example if longitude have a step 1/6
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -