Table of Contents
ArcGIS 10.1如何连接数据库
如何使用直连方式连接数据库
如何使用服务的方式连接数据库
Home Database Mysql Tutorial ArcGIS 10.1 如何连接数据库(转)

ArcGIS 10.1 如何连接数据库(转)

Jun 07, 2016 pm 03:10 PM
arcgis ht how database connect

如何连接数据库 最近在使用ArcGIS 10.1的数据库,在使用的过程中发现了跟以往不太一样的地方,在这里将自己的心得和想法跟大家分享一下(使用Postgresql),根据使用过程,我将内容分为

相关mysql视频教程推荐:《mysql教程

ArcGIS 10.1如何连接数据库

最近在使用ArcGIS 10.1的数据库,在使用的过程中发现了跟以往不太一样的地方,在这里将自己的心得和想法跟大家分享一下(使用Postgresql),根据使用过程,我将内容分为两个部分(这两个部分,是我在使用完分出来的,并重新整理,其中穿插我自己的想法,欢迎大家跟我们一起交流。)

如何使用直连方式连接数据库

1,    ArcGIS 10.1 统一了数据库连接,也就是不区分是空间数据库连接还是通过OLEDB方式的关系型数据库连接

2, 在Catalog中只能采用直连方式;

3, ArcGIS 10.1版本中,Esri提供的安装介质不在包含Postgresql(以前的是包含的);

4, 安装Postgresql,官方给的软件要求是64位数,而且所有的企业级数据库都是64位(这应该和Server有关系吧,因为Server 10.1是纯64位,在桌面软件的DatabaseSupport目录中给出的几个dll都是64位,这几个dll 后面会用到,官方给的软件需求如下:

Database 
Supported Operating Systems 
Minimum OS Version 
Maximum OS Version 
PostgreSQL 9.0.5 (64-bit)
Red Hat Enterprise Linux Server 5 (64-bit)
Update 7
Red Hat Enterprise Linux Server 6 (64-bit)
SUSE Linux Enterprise Server 11 (64-bit)
SP1
Windows Server 2003 Standard, Enterprise, and Datacenter (64-bit [EM64T])
SP2
SP2
Windows Server 2008 R2 Standard, Enterprise, and Datacenter (64-bit [EM64T])
SP1
Copy after login

5, 配置PostgreSQL的客户端。因为直连方式要求ArcSDE的客户端必须安装数据库的客户端类库,所以首先需要获取PostgreSQL的客户端。ArcGIS Desktop是32位软件,需要的是32位的PostgreSQL类库。找到PostgreSQL的客户端,或者在别的机器上将32位的 libeay32.dll, libiconv-2.dll, libintl-8.dll, libpq.dll, and ssleay32.dll文件拷贝到Desktop 安装目录的bin目录下;

6, 拷贝 st_geometry.dll,将Desktop 安装目录下的DatabaseSupport/PostgreSQL/Windows64(看到64了吧)目录下,拷贝st_geometry.dll文件到PostgreSQL的lib目录。在PostgreSQL中创建Geodatabase时必须用到此类库;

7, 配置pg_hba.conf,修改PostgreSQ 的pg_hba.conf文件,添加“host all all 0.0.0.0/0 md5”(关于该文件的配置,可以参阅相关资料);

8, 在安装完SDE后,发现没有以往的post界面,在10.1中,对于创建企业级Geodatabase都采用工具箱中提供的工具,换句话说,以前的post被Toolbox中的一堆工具替代;

9, 创建地理数据库

10.1在创建地理数据库的时候,提供了三个,Oracle,SQL Server和Postgresql,我们用这个工具创建地理数据库,这个过程相当于早起的POST过程,创建数据库并写入一堆系统表等,创建界面如下图:

创建成功后就可以在pgAdmin中看到sde这个数据库,并且看到很多系统表,如下图:

10, 连接地理数据(直连);

在上面说了ArcGIS 10.1对数据库连接做了统一,那如何判断是关系型数据库还是空间数据库呢?其实这点并不难,因为在创建空间数据库的时候,我们同时创建了用户名和密码,那么用这个用户名连接,并选择创建的这个数据库,那么这个数据库就是空间数据库。

连接成功后,我在数据库里创建了要素数据集添加了几个数据,做了一个拓扑分析(做这个的目的不是为了做拓扑,而是为了验证能否做拓扑分析,所以拓扑分析的结果我们不做讨论),结果如下:

同理,做了一个几何网络。

现在我们想一个问题,上面我们使用的是直连的方式访问数据库,大家觉得是否缺少什么呢?我们会想以前如何使用数据库的,首先装了关系型数据库(Postgresql),这一步我们有了,然后就是安装ArcGIS SDE for postgresql,这一步我们没有,然后就是创建数据库,连接数据库。从整个过程来看,我们没有安装SDE,那为什么也可以创建空间数据库呢?

这也是我自己发现的一个,在开始的时候,我的确是安装了SDE,但是我发现这个安装不想ArcGIS 10 或者之前的弹出一个post的界面,装了之后什么反应都没有,我去安装目录下看了看,发现这个安装其实就是解压了一些东西,而我的空间数据库还没有建立呢?再后来发现连接数据库的时候,没有服务这个选项,当初我就觉得这个安装跟我连接数据库没有关系,于是卸载了,根据:

http://resources.arcgis.com/en/help/main/10.1/index.html#/Setting_up_a_geodatabase_in_PostgreSQL/002p00000001000000/
Copy after login

仔细看了一遍,发现这个过程的确不安装SDE是可以的,跟售后的同事确认了下,得出的结论:如果是使用直连方式,ArcGIS 10.1 是不用安装SDE的任何组件。新的问题来了,我们知道在以前的版本中SDE还有一种方式就是服务连接,那如何使用服务连接呢?

如果细心的话,我们可以发现在安装SDE的时候,有两个组件让我们安装:

根据组件右边的描述,我们知道这个安装就是针对服务连接的,也就是说如果要使用服务方式连接,就需要安装SDE,如何创建服务,如何使用服务连接(我们明显看到连接中根本就没有服务这个选项)就是我们下来要讨论的问题。

如何使用服务的方式连接数据库

服务连接的额外步骤

  1. 安装ArcSDE for PostgreSQL 10.1;

  2. 修改ArcSDE安装目录中services.sde文件和Windows中的hosts文件,分别增加“esri_sde 5151/tcp”记录;

  3. 创建ArcSDE服务。分别键入以下两个命令以完成在注册表中创建服务的工作:
    sdeservice -o create -d POSTGRESQL,postgresql-x64-9.0
    sdeservice -o register -d POSTGRESQL,postgresql-x64-9.0 -r ADMIN_DATABASE -v sde

  4. 启动服务。可以用“sdemon –o start”命令或从Windows服务面板中启动ArcSDE服务;

  5. 创建连接。在catalog中只能创建直连服,因此需要使用新的Create ArcSDE Connection File GP工具来创建ArcSDE服务连接文件。创建成功后,在catalog中找到这个连接双击就可以打开。

通过这个工具,如果我们的数据库是ArcGIS 10 或者之前的,并且采用服务的方式,那么在使用10.1的时候,应该用这个工具吧(没有测试,根据向下兼容,我自己猜想)

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How does Go language implement the addition, deletion, modification and query operations of the database? How does Go language implement the addition, deletion, modification and query operations of the database? Mar 27, 2024 pm 09:39 PM

Go language is an efficient, concise and easy-to-learn programming language. It is favored by developers because of its advantages in concurrent programming and network programming. In actual development, database operations are an indispensable part. This article will introduce how to use Go language to implement database addition, deletion, modification and query operations. In Go language, we usually use third-party libraries to operate databases, such as commonly used sql packages, gorm, etc. Here we take the sql package as an example to introduce how to implement the addition, deletion, modification and query operations of the database. Assume we are using a MySQL database.

How to connect OnePlus watch to Bluetooth headset_How to connect OnePlus watch to Bluetooth headset How to connect OnePlus watch to Bluetooth headset_How to connect OnePlus watch to Bluetooth headset Mar 23, 2024 pm 01:16 PM

1. Place the earphones in the earphone box and keep the lid open. Press and hold the button on the box to enter the pairing state of the earphones. 2. Turn on the watch music function and select Bluetooth headphones, or select Bluetooth headphones in the watch settings function. 3. Select the headset on the watch to pair successfully.

How does Hibernate implement polymorphic mapping? How does Hibernate implement polymorphic mapping? Apr 17, 2024 pm 12:09 PM

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

An in-depth analysis of how HTML reads the database An in-depth analysis of how HTML reads the database Apr 09, 2024 pm 12:36 PM

HTML cannot read the database directly, but it can be achieved through JavaScript and AJAX. The steps include establishing a database connection, sending a query, processing the response, and updating the page. This article provides a practical example of using JavaScript, AJAX and PHP to read data from a MySQL database, showing how to dynamically display query results in an HTML page. This example uses XMLHttpRequest to establish a database connection, send a query and process the response, thereby filling data into page elements and realizing the function of HTML reading the database.

Detailed tutorial on establishing a database connection using MySQLi in PHP Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

How to handle database connection errors in PHP How to handle database connection errors in PHP Jun 05, 2024 pm 02:16 PM

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

Analysis of the basic principles of MySQL database management system Analysis of the basic principles of MySQL database management system Mar 25, 2024 pm 12:42 PM

Analysis of the basic principles of the MySQL database management system MySQL is a commonly used relational database management system that uses structured query language (SQL) for data storage and management. This article will introduce the basic principles of the MySQL database management system, including database creation, data table design, data addition, deletion, modification, and other operations, and provide specific code examples. 1. Database Creation In MySQL, you first need to create a database instance to store data. The following code can create a file named "my

See all articles