📄 miffile.html
字号:
FeatureWriter fw = mf.getFeatureWriter(); while(...) { Feature f = fw.next(); f.setAttribute(...,...); fw.write(); } fw.close(); </code></pre><P><DT><B>Parameters:</B><DD><CODE>path</CODE> - Full path & file name of the MIF file to create, can be specified without the .mif extension<DD><CODE>featureType</CODE> - <DD><CODE>params</CODE> - Parameter map<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> - Couldn't open the specified mif file for writing header<DD><CODE><A HREF="../../../../org/geotools/feature/SchemaException.html" title="class in org.geotools.feature">SchemaException</A></CODE> - Error setting the given FeatureType as the MIF schema</DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getHeaderClause(java.lang.String)"><!-- --></A><H3>getHeaderClause</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getHeaderClause</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> clause)</PRE><DL><DD>Gets the value for an header clause<P><DD><DL><DT><B>Parameters:</B><DD><CODE>clause</CODE> - </DL></DD></DL><HR><A NAME="getFeatureReader()"><!-- --></A><H3>getFeatureReader</H3><PRE>public <A HREF="../../../../org/geotools/data/FeatureReader.html" title="interface in org.geotools.data">FeatureReader</A> <B>getFeatureReader</B>() 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><p> Opens the MIF file for input and returns a FeatureReader for accessing the features. </p> <p> TODO Concurrent file access is still not handled. MUST LOCK FILE and return an error if another FeatureReader is open - Handle concurrent access with synchronized(mif) / or Filesystem locking is enough? </p><P><DD><DL><DT><B>Returns:</B><DD>A FeatureReader for reading features from MIF/MID file<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></DL></DD></DL><HR><A NAME="getFeatureWriter()"><!-- --></A><H3>getFeatureWriter</H3><PRE>public <A HREF="../../../../org/geotools/data/FeatureWriter.html" title="interface in org.geotools.data">FeatureWriter</A> <B>getFeatureWriter</B>() 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 a FeatureWriter for writing features to the MIF/MID file.<P><DD><DL><DT><B>Returns:</B><DD>A featureWriter for this file<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></DL></DD></DL><HR><A NAME="getMifName(java.lang.String)"><!-- --></A><H3>getMifName</H3><PRE>protected static <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getMifName</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> fName) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/FileNotFoundException.html" title="class or interface in java.io">FileNotFoundException</A></PRE><DL><DD>Returns the name of a .mif file without extension<P><DD><DL><DT><B>Parameters:</B><DD><CODE>fName</CODE> - The file name, possibly with .mif extension<DT><B>Returns:</B><DD>The name with no extension<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/FileNotFoundException.html" title="class or interface in java.io">FileNotFoundException</A></CODE> - if extension was other than "mif"</DL></DD></DL><HR><A NAME="getFileHandler(java.io.File, java.lang.String, java.lang.String, boolean)"><!-- --></A><H3>getFileHandler</H3><PRE>protected static <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/File.html" title="class or interface in java.io">File</A> <B>getFileHandler</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/File.html" title="class or interface in java.io">File</A> path, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> fileName, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> ext, boolean mustExist) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/FileNotFoundException.html" title="class or interface in java.io">FileNotFoundException</A></PRE><DL><DD>Utility function for initFiles - returns a File given a parent path, the file name without extension and the extension Tests different extension case for case-sensitive filesystems<P><DD><DL><DT><B>Parameters:</B><DD><CODE>path</CODE> - Directory containing the file<DD><CODE>fileName</CODE> - Name of the file with no extension<DD><CODE>ext</CODE> - extension with trailing "."<DD><CODE>mustExist</CODE> - If true, raises an excaption if the file does not exist<DT><B>Returns:</B><DD>The File object<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/FileNotFoundException.html" title="class or interface in java.io">FileNotFoundException</A></CODE></DL></DD></DL><HR><A NAME="getSchema()"><!-- --></A><H3>getSchema</H3><PRE>public <A HREF="../../../../org/geotools/feature/FeatureType.html" title="interface in org.geotools.feature">FeatureType</A> <B>getSchema</B>()</PRE><DL><DD>Returns the MIF schema<P><DD><DL><DT><B>Returns:</B><DD>the current FeatureType associated with the MIF file</DL></DD></DL><HR><A NAME="copyFileAndDelete(java.io.File, java.io.File, boolean)"><!-- --></A><H3>copyFileAndDelete</H3><PRE>protected static void <B>copyFileAndDelete</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/File.html" title="class or interface in java.io">File</A> in, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/File.html" title="class or interface in java.io">File</A> out, boolean deleteIn) 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>Utility function for copying or moving files<P><DD><DL><DT><B>Parameters:</B><DD><CODE>in</CODE> - Source file<DD><CODE>out</CODE> - Destination file<DD><CODE>deleteIn</CODE> - If true, source will be deleted upon successfull copy<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></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/MIFFile.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../org/geotools/data/mif/MIFDataStoreFactory.html" title="class in org.geotools.data.mif"><B>PREV CLASS</B></A> <A HREF="../../../../org/geotools/data/mif/MIFFileTokenizer.html" title="class in org.geotools.data.mif"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="MIFFile.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR>Copyright © 1996-2007 <a href="http://www.geotools.org">Geotools</a>. All Rights Reserved.</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -