⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 package-summary.html

📁 Geotools是一个开源的Java GIS工具包,可利用它来开发符合标准的地理信息系统。Geotools提供了OGC(Open Geospatial Consortium)规范的一个实现来作为他们的
💻 HTML
📖 第 1 页 / 共 2 页
字号:
Authority factories for  the <A HREF="http://www.epsg.org">EPSG</A> database.  <P ALIGN="justify">EPSG codes are numerical identifiers. For example "4326" is the EPSG  identifier for the "WGS 84" geographic CRS. However, the default implementation accepts  names as well as numeric identifiers. For example "<cite>NTF (Paris) / France I</cite>"  and  both fetchs the same object. Note that names may be ambiguous since  the same name may be used for more than one object. This is the case of "WGS 84" for example.  If such an ambiguity is found, an exception will be thrown.</P>  <P ALIGN="justify">An EPSG authority factory is created using the following code:</P>  <BLOCKQUOTE><CODE>CRSAuthorityFactory factory =  <A HREF="../../../../../org/geotools/referencing/FactoryFinder.html" title="class in org.geotools.referencing">FactoryFinder</A>.getCRSAuthorityFactory("EPSG", null);</CODE></BLOCKQUOTE>  <P ALIGN="justify">This package provides the general framework for accessing an EPSG database,  but the actual connection to a database requires the existence of an EPSG plugin in the classpath.  Otherwise, a <A HREF="../../../../../org/geotools/factory/FactoryNotFoundException.html" title="class in org.geotools.factory"><CODE>FactoryNotFoundException</CODE></A> will be thrown. Available plugins are:</P>  <TABLE ALIGN="center" BORDER="1" CELLPADDING="3">    <TR>      <TH>Required software</TH>      <TH>Data source</TH>      <TH>Plugin / JAR file</TH>      <TH>Additional notes</TH>    </TR>    <TR>      <TD>MS-Access ODBC driver</TD>      <TD><A HREF="../../../../../org/geotools/referencing/factory/epsg/AccessDataSource.html" title="class in org.geotools.referencing.factory.epsg"><CODE>AccessDataSource</CODE></A></TD>      <TD></TD>      <TD>See <A HREF="doc-files/Access.html">installation instructions</A></TD>    </TR>    <TR>      <TD>HSQL embedded database</TD>      <TD><A HREF="../../../../../org/geotools/referencing/factory/epsg/HSQLDataSource.html" title="class in org.geotools.referencing.factory.epsg"><CODE>HSQLDataSource</CODE></A></TD>      <TD></TD>      <TD><A HREF="doc-files/HSQL.html">Note for module mainteners</A></TD>    </TR>    <TR>      <TD>PostgreSQL database</TD>      <TD><A HREF="../../../../../org/geotools/referencing/factory/epsg/PostgreDataSource.html" title="class in org.geotools.referencing.factory.epsg"><CODE>PostgreDataSource</CODE></A></TD>      <TD></TD>      <TD><A HREF="doc-files/PostgreSQL.html">Note for module mainteners</A></TD>    </TR>  </TABLE>  <P>&nbsp;</P>  <H2>How to create a custom data source</H2>  <P ALIGN="justify">For getting the EPSG factory to uses a custom connection, create some subclass  that implements Geotools's <A HREF="../../../../../org/geotools/referencing/factory/epsg/DataSource.html" title="interface in org.geotools.referencing.factory.epsg"><CODE>DataSource</CODE></A> interface. For  example:</P>  <BLOCKQUOTE><TABLE border="2" width="100%"><TR><TD><PRE><B>import</B> org.postgresql.ds.PGSimpleDataSource;<B>import</B> org.geotools.factory.Hints;<B>import</B> org.geotools.referencing.factory.AbstractAuthorityFactory;<B>import</B> org.geotools.referencing.factory.epsg.DataSource;<B>public</B> MyDataSource <B>extends</B> PGSimpleDataSource <B>implements</B> <A HREF="../../../../../org/geotools/referencing/factory/epsg/DataSource.html" title="interface in org.geotools.referencing.factory.epsg">DataSource</A> {    <B>public</B> MyDataSource() {        setServerName("myserver.com");        setDatabaseName("mydatabase");    }    <B>public</B> <B>int</B> getPriority() {        <B>return</B> MAXIMUM_PRIORITY - 200;    <B>public</B> AbstractAuthorityFactory createFactory(Hints hints) <B>throws</B> SQLException {        <B>return</B> <B>new</B> FactoryUsingAnsiSQL(hints, getConnection());    }}</PRE></TD></TR></TABLE></BLOCKQUOTE>  <P ALIGN="justify">Then, declare this custom implementation in the following file  (for uses by <A HREF="../../../../../org/geotools/factory/FactoryRegistry.html" title="class in org.geotools.factory"><CODE>FactoryRegistry</CODE></A>):</P>  <BLOCKQUOTE><PRE>META-INF/services/org.geotools.referencing.factory.epsg.DataSource</PRE></BLOCKQUOTE>  <P ALIGN="justify">Just providing a JAR file with the above-cited <A HREF="../../../../../org/geotools/referencing/factory/epsg/DataSource.html" title="interface in org.geotools.referencing.factory.epsg"><CODE>DataSource</CODE></A>  implementation and  registration is suffisient for an application to connects automatically to  the specified server (providing that the relevant JDBC driver is present, of course).</P></LI>  <h3>Registration with JNDI (usually J2EE)</h3>  <P ALIGN="justify">Installation on Unix systems typically has a database software running on some  server rather than the local machine. The administrator will probably have to download the SQL  scripts from <A HREF="http://www.epsg.org">http://www.epsg.org</A> and executes it in whatever database  software they use (PostgreSQL, MySQL, Oracle, <cite>etc.</cite>). The connection parameters (server URL,  user name, <cite>etc.</cite>) can be specified as a <A HREF="../../../../../org/geotools/referencing/factory/epsg/DataSource.html" title="interface in org.geotools.referencing.factory.epsg"><CODE>DataSource</CODE></A>  registered with a naming service based on Java Naming and Directory (JNDI) interfaces. Like databases, the  naming service is typically located on some server. The data source name for the connection to the EPSG database  is <code>{@value}</code>.</P>  <UL>    <LI><P ALIGN="justify">For setting up a naming service (LDAP, NIS, <cite>etc.</cite>), see the        <A HREF="http://java.sun.com/products/jndi/tutorial/trailmap.html">JNDI tutorial</A>.</P></LI>            <LI><P ALIGN="justify">For an example of <A HREF="http://java.sun.com/j2se/1.4/docs/api/javax/sql/DataSource.html" title="class or interface in javax.sql"><CODE>DataSource</CODE></A> creation with different connection parameters        than the default ones, see <A HREF="http://java.sun.com/j2se/1.5/docs/guide/jdbc/bridge.html">New data source        implementations in the JDBC-ODBC bridge</A>.</P></LI>    <LI><P ALIGN="justify">For <A HREF="http://java.sun.com/j2se/1.4/docs/api/javax/sql/DataSource.html" title="class or interface in javax.sql"><CODE>DataSource</CODE></A> implementations targeting other database softwares, see        their JDBC documentation. For example the <A HREF="http://jdbc.postgresql.org">PostgreSQL JDBC</A> provides        an  basic implementation.</P></LI>  </UL><P><P><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>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../../../org/geotools/referencing/factory/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;&nbsp;<A HREF="../../../../../org/geotools/referencing/factory/wms/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<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></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR>Copyright &copy; 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 + -