<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Geoinformatics &#187; PostgreSQL</title>
	<atom:link href="http://www.geoinformatics.cn/tag/postgresql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geoinformatics.cn</link>
	<description>Arts and Sciences move me on ...</description>
	<lastBuildDate>Fri, 13 Jan 2012 10:29:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>将文本数据(txt/cvs)导入PostgreSQL数据库步骤</title>
		<link>http://www.geoinformatics.cn/2009/12/%e5%b0%86%e6%96%87%e6%9c%ac%e6%95%b0%e6%8d%aetxtcvs%e5%af%bc%e5%85%a5postgresql%e6%95%b0%e6%8d%ae%e5%ba%93%e6%ad%a5%e9%aa%a4/</link>
		<comments>http://www.geoinformatics.cn/2009/12/%e5%b0%86%e6%96%87%e6%9c%ac%e6%95%b0%e6%8d%aetxtcvs%e5%af%bc%e5%85%a5postgresql%e6%95%b0%e6%8d%ae%e5%ba%93%e6%ad%a5%e9%aa%a4/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 20:54:40 +0000</pubDate>
		<dc:creator>长安旧梦</dc:creator>
				<category><![CDATA[技术心得]]></category>
		<category><![CDATA[CBDB]]></category>
		<category><![CDATA[CVS]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Sqlite]]></category>

		<guid isPermaLink="false">http://www.geoinformatics.cn/?p=1700</guid>
		<description><![CDATA[前几天麻烦陈松把CBDB所有的数据打包给我一份，说起来还挺麻烦陈松的，他要通过Sophia联系项目支持方的一家台湾公司发给我才行。没用一个礼拜陈松就把所有的数据发给我了，不过数据只是utf8格式的文本数据，没有数据之间的关系，不过在CBDB的官方网站上可以下载2009年3月版本的access版本数据库，这个数据库一直是由CBDB委员会维护的，主要数据来自于王德毅教授的《宋人传记资料索引》（全书一共有六册）。再说这份数据，每个表分别为一份文本数据文件，下图即为Office_codes.txt 数据节选。 最开始拿到这份数据的时候，想到了很多导入数据库的方法，只要一个数据库支持csv数据导入，其实就应该没有什么问题。比如，用SqLite Manager可以导入到SpatiaLite中，这样如果今后要做服务器端开发，或者桌面应用，Spatialite也是不错的选择。或者用Access 2007导入到Access数据库中，Microsoft把Access 2007做的实在很fancy，而且功能也是很不错的，只是Robbins的操作栏不太习惯而已。但是我还是遇到了一个大问题，PostgreSQL并没有很好的CVS导入的GUI操作软件。所以，我就想，因为PostgreSQL也是支持OBDC的，其实，所以可以用OBDC做为一个中转站，先将数据导入Access，然后通过OBDC导入到PostgreSQL中。关于OBDC的PostgreSQL接口，需要下载psqlodbc。 插句题外话，SpatiaLite是个不错的数据库，他是一个意大利小伙基于Sqlite和GEOS、GDAL、Proj4等开源地理插件做的空间数据库。如果想用Django做为后台，SqLite是native支持的，所以用SpatiaLite也个好的选择，我记得以前写过一篇介绍SqLite和SpatiaLite的文章。大家可以在我的网站上搜索到。我没有用spatialite一个主要原因是我希望利用postgreSQL进行全文搜索，如果用spatialite，就不方便做到这一点。 好，接着是将数据到导入到Access的大致步骤，这个过程还是相当handy的： 新建数据库 选择 文本数据导入 3．打开要导入的文本数据 4．主要选择数据编码为utf8， 用制表符做为分隔符，并且第一行为标题行 5．除了以上的注意事项，基本上就可以默认生成表了。 注意，在转换过程中会遇到很多问题，Access会为我们建立错误索引，所以很容易就可以对数据进行修改，但是我暂时不建议大家修改Access数据库，我建议大家等导入到PostgreSQL只有在根据错误的索引对错误加以修改。 6. 导入PostgreSQL数据库也不难，为了让数据库以后支持空间数据，首先要建立一个空间数据库。最方便的就是复制一个空间数据库模板template_postgis。注意字符编码一定要选择UTF8.因为古汉语的单字很多普通的字库都无法识别。 7．在Access里面，选择外部数据àOBDC数据库 8. 选择需要导入的数据库 发现有些错误是由于access默认导入造成的，所以我用sqlite版本的数据输出csv，然后再次导入到access数据就没有出现类似的问题，然后再通过ODBC导入到PostgreSQL数据库中。 9. 根据原始的CBDB数据的关系确定PostgreSQL各个表的主键以及外键。]]></description>
			<content:encoded><![CDATA[<p>前几天麻烦<a href="mailto:songchen@fas.harvard.edu">陈松</a>把CBDB所有的数据打包给我一份，说起来还挺麻烦陈松的，他要通过Sophia联系项目支持方的一家台湾公司发给我才行。没用一个礼拜陈松就把所有的数据发给我了，不过数据只是utf8格式的文本数据，没有数据之间的关系，不过在<a href="http://isites.harvard.edu/fs/docs/icb.topic243261.files/20090311CBDBk.zip">CBDB的官方网站</a>上可以下载2009年3月版本的access版本数据库，这个数据库一直是由CBDB委员会维护的，主要数据来自于王德毅教授的《宋人传记资料索引》<a href="http://www.cp1897.com.hk/product_info.php?BookId=9789574540020">（全书一共有六册）</a>。再说这份数据，每个表分别为一份文本数据文件，下图即为Office_codes.txt 数据节选。</p>
<p><img src="http://www.geoinformatics.cn/wp-content/uploads/2009/12/122709_2054_txtcvs12.png" alt="" /></p>
<p>最开始拿到这份数据的时候，想到了很多导入数据库的方法，只要一个数据库支持csv数据导入，其实就应该没有什么问题。比如，用SqLite Manager可以导入到SpatiaLite中，这样如果今后要做服务器端开发，或者桌面应用，Spatialite也是不错的选择。或者用Access 2007导入到Access数据库中，Microsoft把Access 2007做的实在很fancy，而且功能也是很不错的，只是Robbins的操作栏不太习惯而已。但是我还是遇到了一个大问题，PostgreSQL并没有很好的CVS导入的GUI操作软件。所以，我就想，因为PostgreSQL也是支持OBDC的，其实，所以可以用OBDC做为一个中转站，先将数据导入Access，然后通过OBDC导入到PostgreSQL中。关于OBDC的PostgreSQL接口，需要下载psqlodbc。<span id="more-1700"></span></p>
<p>插句题外话，SpatiaLite是个不错的数据库，他是一个意大利小伙基于Sqlite和GEOS、GDAL、Proj4等开源地理插件做的空间数据库。如果想用Django做为后台，SqLite是native支持的，所以用SpatiaLite也个好的选择，我记得以前写过一篇介绍SqLite和SpatiaLite的文章。大家可以在我的网站上搜索到。我没有用spatialite一个主要原因是我希望利用postgreSQL进行全文搜索，如果用spatialite，就不方便做到这一点。</p>
<p><img src="http://www.geoinformatics.cn/wp-content/uploads/2009/12/122709_2054_txtcvs21.png" alt="" /></p>
<p>好，接着是将数据到导入到Access的大致步骤，这个过程还是相当handy的：</p>
<ol>
<li>新建数据库</li>
</ol>
<p><img src="http://www.geoinformatics.cn/wp-content/uploads/2009/12/122709_2054_txtcvs31.png" alt="" /></p>
<ol>
<li>选择 文本数据导入</li>
</ol>
<p><img src="http://www.geoinformatics.cn/wp-content/uploads/2009/12/122709_2054_txtcvs41.png" alt="" /></p>
<p>3．打开要导入的文本数据</p>
<p><img src="http://www.geoinformatics.cn/wp-content/uploads/2009/12/122709_2054_txtcvs51.png" alt="" /></p>
<p>4．主要选择数据编码为utf8， 用制表符做为分隔符，并且第一行为标题行</p>
<p><img src="http://www.geoinformatics.cn/wp-content/uploads/2009/12/122709_2054_txtcvs61.png" alt="" /></p>
<p>5．除了以上的注意事项，基本上就可以默认生成表了。</p>
<p><img src="http://www.geoinformatics.cn/wp-content/uploads/2009/12/122709_2054_txtcvs71.png" alt="" /></p>
<p>注意，在转换过程中会遇到很多问题，Access会为我们建立错误索引，所以很容易就可以对数据进行修改，但是我暂时不建议大家修改Access数据库，我建议大家等导入到PostgreSQL只有在根据错误的索引对错误加以修改。</p>
<p>6. 导入PostgreSQL数据库也不难，为了让数据库以后支持空间数据，首先要建立一个空间数据库。最方便的就是复制一个空间数据库模板template_postgis。注意字符编码一定要选择UTF8.因为古汉语的单字很多普通的字库都无法识别。</p>
<p><img src="http://www.geoinformatics.cn/wp-content/uploads/2009/12/122709_2054_txtcvs81.png" alt="" /></p>
<p>7．在Access里面，选择外部数据<span style="font-family: Wingdings;">à</span>OBDC数据库</p>
<p><img src="http://www.geoinformatics.cn/wp-content/uploads/2009/12/122709_2054_txtcvs91.png" alt="" /></p>
<p>8. 选择需要导入的数据库</p>
<p><img src="http://www.geoinformatics.cn/wp-content/uploads/2009/12/122709_2054_txtcvs101.png" alt="" /></p>
<p>发现有些错误是由于access默认导入造成的，所以我用sqlite版本的数据输出csv，然后再次导入到access数据就没有出现类似的问题，然后再通过ODBC导入到PostgreSQL数据库中。</p>
<p>9. 根据原始的CBDB数据的关系确定PostgreSQL各个表的主键以及外键。</p>
<p><img src="http://www.geoinformatics.cn/wp-content/uploads/2009/12/122709_2054_txtcvs111.png" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoinformatics.cn/2009/12/%e5%b0%86%e6%96%87%e6%9c%ac%e6%95%b0%e6%8d%aetxtcvs%e5%af%bc%e5%85%a5postgresql%e6%95%b0%e6%8d%ae%e5%ba%93%e6%ad%a5%e9%aa%a4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>圣诞第一天</title>
		<link>http://www.geoinformatics.cn/2009/12/%e5%9c%a3%e8%af%9e%e7%ac%ac%e4%b8%80%e5%a4%a9/</link>
		<comments>http://www.geoinformatics.cn/2009/12/%e5%9c%a3%e8%af%9e%e7%ac%ac%e4%b8%80%e5%a4%a9/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 19:23:23 +0000</pubDate>
		<dc:creator>长安旧梦</dc:creator>
				<category><![CDATA[技术心得]]></category>
		<category><![CDATA[生活感悟]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://www.geoinformatics.cn/?p=1651</guid>
		<description><![CDATA[working in the lab. 终于把问题解决了，it worked!!! 去吃饭去，哈哈。]]></description>
			<content:encoded><![CDATA[<p>working in the lab.</p>
<p><a rel="attachment wp-att-1652" href="http://www.geoinformatics.cn/2009/12/%e5%9c%a3%e8%af%9e%e7%ac%ac%e4%b8%80%e5%a4%a9/20091225_me/" title="working in the lab"><img class="alignnone size-full wp-image-1652" title="working in the lab" src="http://www.geoinformatics.cn/wp-content/uploads/2009/12/20091225_me.jpg" alt="" width="375" height="500" /></a></p>
<div id="attachment_1653" class="wp-caption alignnone" style="width: 510px"><a rel="attachment wp-att-1653" href="http://www.geoinformatics.cn/2009/12/%e5%9c%a3%e8%af%9e%e7%ac%ac%e4%b8%80%e5%a4%a9/20091225_mac/" title="mac &amp; my vaio"><img class="size-full wp-image-1653" title="mac &amp; my vaio" src="http://www.geoinformatics.cn/wp-content/uploads/2009/12/20091225_mac.jpg" alt="" width="500" height="376" /></a><p class="wp-caption-text">mac workstation &amp; my vaio</p></div>
<p><a rel="attachment wp-att-1659" href="http://www.geoinformatics.cn/2009/12/%e5%9c%a3%e8%af%9e%e7%ac%ac%e4%b8%80%e5%a4%a9/20091225_problemsovled/" title="problem sovled"><img class="alignnone size-full wp-image-1659" title="problem sovled" src="http://www.geoinformatics.cn/wp-content/uploads/2009/12/20091225_problemsovled.jpg" alt="problem sovled" width="500" height="375" /></a></p>
<p>终于把问题解决了，it worked!!! 去吃饭去，哈哈。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoinformatics.cn/2009/12/%e5%9c%a3%e8%af%9e%e7%ac%ac%e4%b8%80%e5%a4%a9/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>数据库转换小记</title>
		<link>http://www.geoinformatics.cn/2009/11/%e6%95%b0%e6%8d%ae%e5%ba%93%e8%bd%ac%e6%8d%a2%e5%b0%8f%e8%ae%b0/</link>
		<comments>http://www.geoinformatics.cn/2009/11/%e6%95%b0%e6%8d%ae%e5%ba%93%e8%bd%ac%e6%8d%a2%e5%b0%8f%e8%ae%b0/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 22:41:25 +0000</pubDate>
		<dc:creator>长安旧梦</dc:creator>
				<category><![CDATA[技术心得]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[FTS]]></category>
		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://www.geoinformatics.cn/?p=1543</guid>
		<description><![CDATA[1. mysql_connect()和mysql_pconnect()的区别? mysql_connect()是普通连接，mysql_pconnect()是永久连接，mysql_connect()在执行完代码后自动关闭连接，而mysql_pconnect()不会。 而针对postgreSQL，其永久链连接的函数为pg_pconnect。 关于链接字符串，可以参考 http://docs.php.net/manual/zh/function.pg-connect.php， 注意，旧的多参数语法 $conn = pg_connect(&#8220;host&#8221;, &#8220;port&#8221;, &#8220;options&#8221;, &#8220;tty&#8221;, &#8220;dbname&#8221;) 已经不提倡使用，但是依然可以使用。 2. PostgreSQL 里面不需要进行类似于MySQL中的mysql_select_db操作。 3. MYSQL_ASSOC? mysql_fetch_array() 中可选的第二个参数 result_type 是一个常量，可以接受以下值：MYSQL_ASSOC，MYSQL_NUM 和 MYSQL_BOTH。本特性是 PHP 3.0.7 起新加的。本参数的默认值是 MYSQL_BOTH。 如果用了 MYSQL_BOTH，将得到一个同时包含关联和数字索引的数组。用 MYSQL_ASSOC 只得到关联索引（如同 mysql_fetch_assoc() 那样），用 MYSQL_NUM 只得到数字索引（如同 mysql_fetch_row() 那样）。 而针对postgreSQL也有pg_fetch_array()函数，返回一个与所提取的行（元组/记录）相一致的数组。如果没有更多行可供提取，则返回 FALSE。 result_type 是可选参数，控制着怎样初始化返回值。result_type 是一个常量，可以有以下取值：PGSQL_ASSOC，PGSQL_NUM 和 PGSQL_BOTH。取值为 PGSQL_ASSOC 时 pg_fetch_array() 返回用字段名作为键值索引的关联数组，取值为 PGSQL_NUM 时用字段编号作为键值，取值为 PGSQL_BOTH 时则同时用两者作为键值。默认值是 PGSQL_BOTH. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>1. mysql_connect()和mysql_pconnect()的区别?</strong><br />
mysql_connect()是普通连接，mysql_pconnect()是永久连接，mysql_connect()在执行完代码后自动关闭连接，而mysql_pconnect()不会。<br />
而针对postgreSQL，其永久链连接的函数为pg_pconnect。</p>
<p>关于链接字符串，可以参考 <a href="http://docs.php.net/manual/zh/function.pg-connect.php">http://docs.php.net/manual/zh/function.pg-connect.php</a>， 注意，旧的多参数语法 <strong>$conn = pg_connect(&#8220;host&#8221;, &#8220;port&#8221;, &#8220;options&#8221;, &#8220;tty&#8221;, &#8220;dbname&#8221;)</strong> 已经不提倡使用，但是依然可以使用。</p>
<p><strong>2. PostgreSQL 里面不需要进行类似于MySQL中的mysql_select_db操作。</strong></p>
<p><strong>3. MYSQL_ASSOC?</strong><br />
mysql_fetch_array() 中可选的第二个参数 result_type 是一个常量，可以接受以下值：MYSQL_ASSOC，MYSQL_NUM 和 MYSQL_BOTH。本特性是 PHP 3.0.7 起新加的。本参数的默认值是 MYSQL_BOTH。 如果用了 MYSQL_BOTH，将得到一个同<strong>时包含关联和数字索引的数组</strong>。用 MYSQL_ASSOC 只得到关联索引（如同 mysql_fetch_assoc() 那样），用 MYSQL_NUM 只得到数字索引（如同 mysql_fetch_row() 那样）。<br />
而针对postgreSQL也有pg_fetch_array()函数，返回一个与所提取的行（元组/记录）相一致的数组。如果没有更多行可供提取，则返回 FALSE。 result_type 是可选参数，控制着怎样初始化返回值。result_type 是一个常量，可以有以下取值：PGSQL_ASSOC，PGSQL_NUM 和 PGSQL_BOTH。取值为 PGSQL_ASSOC 时 pg_fetch_array() 返回用字段名作为键值索引的关联数组，取值为 PGSQL_NUM 时用字段编号作为键值，取值为 PGSQL_BOTH 时则同时用两者作为键值。默认值是 PGSQL_BOTH.</p>
<p><strong>4. php操作mysql数据库,可以使用mysql_unbuffered_query. 但是操作postgresql无相关的函数,如何替换？<span id="more-1543"></span><br />
</strong></p>
<p>mysql_unbuffered_query这个函数可到这里看说明。 http://php.liukang.com/manual/zh/function.mysql-unbuffered-query.php<br />
php对postgresql操作好像没有这样的函数，但可以用postgresql的游标达到目标。参考 http://www.pgsqldb.org/pgsqldoc-8.1c/sql-declare.html</p>
<p>如果没有声明 <tt>WITH HOLD</tt>，那么这个命令创建的游标只能在当前事务中使用。使用 <a style="color: #000066;" href="http://www.pgsqldb.org/pgsqldoc-8.1c/sql-begin.html"><em>BEGIN</em></a>， <a style="color: #000066;" href="http://www.pgsqldb.org/pgsqldoc-8.1c/sql-commit.html"><em>COMMIT</em></a> 和 <a style="color: #000066;" href="http://www.pgsqldb.org/pgsqldoc-8.1c/sql-rollback.html"><em>ROLLBACK</em></a> 定义一个事务块。</p>
<p>如果声明了 <tt>WITH HOLD</tt>，并且创建该游标的事务成功提交， 那么游标还可以在同一会话随后的事务里访问。（但如果创建它的事务回滚，那么游标被删除。） 带着 <tt>WITH HOLD</tt> 创建的游标是用一个明确的 <tt>CLOSE</tt> 命令，或者是会话终止来关闭的。 在目前的实现里，由一个游标代表的行是被拷贝到一个临时文件或者内存区里的，这样他们就仍然可以在随后的事务中被访问。</p>
<p>在定义一个要用来向后抓取的游标的时候，我们应该声明 <tt>SCROLL</tt> 选项。 这个是 SQL 标准要求的。不过，为了和早期的版本兼容， <span>PostgreSQL</span> 在没有 <tt>SCROLL</tt> 的时候也允许向后抓取， 只要游标的查询计划简单得不需要额外的开销就可以支持它。 不过，我们建议应用开发人员不要依赖于使用没有带着 <tt>SCROLL</tt> 定义的游标的后向查找功能。如果声明了 <tt>NO SCROLL</tt>，那么不管怎样都会禁止向后抓取的功能。</p>
<p>在 SQL 标准中游标只能在嵌入 <acronym style="font-style: inherit;">SQL</acronym> （<acronym style="font-style: inherit;">ESQL</acronym>） 的应用中使用。 <span>PostgreSQL</span> 服务器没有一个明确的 <tt>OPEN </tt>语句；一个游标被认为在定义时就已经打开了。 不过，<span>PostgreSQL</span>嵌入的 SQL 预编译器， <span>ecpg</span>， 支持 <acronym style="font-style: inherit;">SQL92</acronym> 习惯，包括那些和<tt>DECLARE</tt>和<tt>OPEN</tt>相关的语句。</p>
<p><strong>5. Full text index</strong></p>
<p>MySQL comes with full-text search, but can only be run on the MyISAM storage engine. <a style="text-decoration: none; color: #3366bb; background-image: url(http://www.wikivs.com/skins/monobook/external.png); background-repeat: no-repeat; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; padding-top: 0px; padding-right: 13px; padding-bottom: 0px; padding-left: 0px; background-position: 100% 50%;" rel="nofollow" href="http://dev.mysql.com/doc/refman/5.1/en/fulltext-search.html">[12]</a></p>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em;">A 3rd party add-on to MySQL, <a style="text-decoration: none; color: #3366bb; background-image: url(http://www.wikivs.com/skins/monobook/external.png); background-repeat: no-repeat; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; padding-top: 0px; padding-right: 13px; padding-bottom: 0px; padding-left: 0px; background-position: 100% 50%;" rel="nofollow" href="http://www.sphinxsearch.com/features.html">Sphinx Fulltext Search Engine</a> allows it to support full-text searches of InnoDB tables.</p>
<p>PostgreSQL 8.2 has full text search in the <a style="text-decoration: none; color: #3366bb; background-image: url(http://www.wikivs.com/skins/monobook/external.png); background-repeat: no-repeat; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; padding-top: 0px; padding-right: 13px; padding-bottom: 0px; padding-left: 0px; background-position: 100% 50%;" rel="nofollow" href="http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/">tsearch2</a> module.</p>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em;">PostgreSQL 8.3 integrates tsearch2 into the core: &#8220;TSearch2, our cutting-edge full text search tool, has been fully integrated into the core code, and also has a cleaner API.&#8221; <a style="text-decoration: none; color: #3366bb; background-image: url(http://www.wikivs.com/skins/monobook/external.png); background-repeat: no-repeat; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; padding-top: 0px; padding-right: 13px; padding-bottom: 0px; padding-left: 0px; background-position: 100% 50%;" rel="nofollow" href="http://www.postgresql.org/about/press/features83.html">[13]</a></p>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em;">参考<a href="http://blog.chinaunix.net/u/11565/showart_1848766.html">http://blog.chinaunix.net/u/11565/showart_1848766.html</a> 进行tsearch2支持的全文搜索.</p>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em;">6. &amp;&amp; &#8211;&gt; AND</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoinformatics.cn/2009/11/%e6%95%b0%e6%8d%ae%e5%ba%93%e8%bd%ac%e6%8d%a2%e5%b0%8f%e8%ae%b0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>将网站数据库系统从MySQL转向 PostgreSQL</title>
		<link>http://www.geoinformatics.cn/2009/11/%e5%b0%86%e7%bd%91%e7%ab%99%e6%95%b0%e6%8d%ae%e5%ba%93%e7%b3%bb%e7%bb%9f%e4%bb%8emysql%e8%bd%ac%e5%90%91-postgresql/</link>
		<comments>http://www.geoinformatics.cn/2009/11/%e5%b0%86%e7%bd%91%e7%ab%99%e6%95%b0%e6%8d%ae%e5%ba%93%e7%b3%bb%e7%bb%9f%e4%bb%8emysql%e8%bd%ac%e5%90%91-postgresql/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 01:25:37 +0000</pubDate>
		<dc:creator>长安旧梦</dc:creator>
				<category><![CDATA[技术心得]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.geoinformatics.cn/?p=1540</guid>
		<description><![CDATA[1.Sun官网上一篇《将数据库从 MySQL 切换到 PostgreSQL 8.2》的文章，主要还是讲环境配置 http://www.sun.com/bigadmin/hubs/multilingual/simp_chinese/content/switching_to_postgres.jsp 2.《将你的网站从MySQL改为PostgreSQL》一篇不错的中文文献，但是年头有点老，但是还是有指导价值的。 http://www.cn029.com/article/107/113/2007/2007052371859.html 3. Converting MySQL to PostgreSQL ，一篇不错的英文文章，专门讲两种数据库如何转换的细节问题。值得一看。 http://en.wikibooks.org/wiki/Converting_MySQL_to_PostgreSQL 4. MySQL vs PostgreSQL 一篇英文文章，主要讲两种数据库管理系统的对比。 http://www.wikivs.com/wiki/MySQL_vs_PostgreSQL]]></description>
			<content:encoded><![CDATA[<p><strong>1.Sun官网上一篇《将数据库从 MySQL 切换到 PostgreSQL 8.2》的文章，主要还是讲环境配置</strong></p>
<p>http://www.sun.com/bigadmin/hubs/multilingual/simp_chinese/content/switching_to_postgres.jsp</p>
<p><strong>2.《将你的网站从MySQL改为PostgreSQL》一篇不错的中文文献，但是年头有点老，但是还是有指导价值的。</strong></p>
<p>http://www.cn029.com/article/107/113/2007/2007052371859.html</p>
<p><strong>3. </strong><em><strong>Converting MySQL to PostgreSQL</strong></em><strong> ，一篇不错的英文文章，专门讲两种数据库如何转换的细节问题。值得一看。</strong></p>
<p>http://en.wikibooks.org/wiki/Converting_MySQL_to_PostgreSQL</p>
<p><strong>4. <em>MySQL vs PostgreSQL</em></strong><strong> 一篇英文文章，主要讲两种数据库管理系统的对比。</strong></p>
<p>http://www.wikivs.com/wiki/MySQL_vs_PostgreSQL</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoinformatics.cn/2009/11/%e5%b0%86%e7%bd%91%e7%ab%99%e6%95%b0%e6%8d%ae%e5%ba%93%e7%b3%bb%e7%bb%9f%e4%bb%8emysql%e8%bd%ac%e5%90%91-postgresql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GeoDjango中文教程</title>
		<link>http://www.geoinformatics.cn/2009/07/geodjango%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b/</link>
		<comments>http://www.geoinformatics.cn/2009/07/geodjango%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 08:53:53 +0000</pubDate>
		<dc:creator>长安旧梦</dc:creator>
				<category><![CDATA[技术心得]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[OGC]]></category>
		<category><![CDATA[OSGeo]]></category>
		<category><![CDATA[PostGIS]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[PROJ4]]></category>
		<category><![CDATA[Sphinx]]></category>
		<category><![CDATA[开源]]></category>

		<guid isPermaLink="false">http://www.geoinformatics.cn/?p=1078</guid>
		<description><![CDATA[最近接触最多的就是GeoDjango，上周三在Wendy老师的举荐下，在哈佛做了一次GIS presentation，内容就是关于GeoDjango实例的，大家都比较感兴趣，也认识了同样对GeoDjango感兴趣的brett。不过国内对于GeoDjango的介绍比较少，为了方便大家学习，做了份中文版本的GeoDjango教程，其一是自己学习Sphinx的使用，其二也希望对大家有一定帮助。中文教程请点击 http://geoinformatics.cn/lab/geodjango/tutorial.html]]></description>
			<content:encoded><![CDATA[<p>最近接触最多的就是GeoDjango，上周三在Wendy老师的举荐下，在哈佛做了一次GIS presentation，内容就是关于GeoDjango实例的，大家都比较感兴趣，也认识了同样对GeoDjango感兴趣的brett。不过国内对于GeoDjango的介绍比较少，为了方便大家学习，做了份中文版本的GeoDjango教程，其一是自己学习Sphinx的使用，其二也希望对大家有一定帮助。中文教程请点击 <a href="http://geoinformatics.cn/lab/geodjango/tutorial.html">http://geoinformatics.cn/lab/geodjango/tutorial.html</a></p>
<p><a href="http://geoinformatics.cn/lab/geodjango/tutorial.html" title="20090719_geodjangodoc"><img class="aligncenter size-medium wp-image-1079" title="20090719_geodjangodoc" src="/wp-content/uploads//20090719_geodjangodoc-300x276.jpg" alt="20090719_geodjangodoc" width="450" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoinformatics.cn/2009/07/geodjango%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>开源格网之Grid SQL Parallel Query &amp; pyWPS</title>
		<link>http://www.geoinformatics.cn/2009/01/%e5%bc%80%e6%ba%90%e6%a0%bc%e7%bd%91%e4%b9%8bgrid-sql-parallel-query-pywps/</link>
		<comments>http://www.geoinformatics.cn/2009/01/%e5%bc%80%e6%ba%90%e6%a0%bc%e7%bd%91%e4%b9%8bgrid-sql-parallel-query-pywps/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 18:07:08 +0000</pubDate>
		<dc:creator>长安旧梦</dc:creator>
				<category><![CDATA[技术心得]]></category>
		<category><![CDATA[Grid]]></category>
		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://www.geoinformatics.cn/?p=905</guid>
		<description><![CDATA[Today when I try to download some python based postgresql module, I met a new plugin for Postgresql to implement the Grid SQL, which is Grid SQL Parallel Query.GridSQL enables organizations to easily meet complex Data Warehousing and Business Intelligence challenges using true grid technology that implements a shared-nothing, distributed data architecture. GridSQL enables OLAP [...]]]></description>
			<content:encoded><![CDATA[<p>Today when I try to download some python based postgresql module, I met a new plugin for Postgresql to implement the Grid SQL, which is <a href="http://www.enterprisedb.com/products/postgres_plus/gridsql.do" target="_blank">Grid SQL Parallel Query</a>.GridSQL enables organizations to easily meet complex Data Warehousing and Business Intelligence challenges using true grid technology that implements a shared-nothing, distributed data architecture. GridSQL enables OLAP applications to leverage the power of multiple commodity servers while appearing as a single database to the application. Most important is, Grid SQL is opensource.</p>
<p>look at the figure below, which describe the workflow of Grid SQL.</p>
<p style="text-align: center;"><a href="/wp-content/uploads//20090131_gridsql_architecture.jpg" rel="shadowbox[sbpost-905];player=img;" title="gridsql_architecture"><img class="size-full wp-image-906 aligncenter" title="gridsql_architecture" src="/wp-content/uploads//20090131_gridsql_architecture.jpg" alt="" width="382" height="374" /></a></p>
<p>At the meantime, another opensource module written  by python is pyWPS. WPS is newly released specification by OGC to realize the web map processing. in my point of veiw, the map processing, particularly the GIS analysis has a promising outlook in the near future. By the way, we can use grid sql and pyWPS to make analysis. the grid sql is for retrieving geospatial data, pyWPS is for  transacting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoinformatics.cn/2009/01/%e5%bc%80%e6%ba%90%e6%a0%bc%e7%bd%91%e4%b9%8bgrid-sql-parallel-query-pywps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostGIS 1.3.4 支持GeoJSON格式输出</title>
		<link>http://www.geoinformatics.cn/2008/12/postgis-134-%e6%94%af%e6%8c%81geojson%e6%a0%bc%e5%bc%8f%e8%be%93%e5%87%ba/</link>
		<comments>http://www.geoinformatics.cn/2008/12/postgis-134-%e6%94%af%e6%8c%81geojson%e6%a0%bc%e5%bc%8f%e8%be%93%e5%87%ba/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 10:38:54 +0000</pubDate>
		<dc:creator>长安旧梦</dc:creator>
				<category><![CDATA[技术心得]]></category>
		<category><![CDATA[PostGIS]]></category>
		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://www.geoinformatics.cn/?p=866</guid>
		<description><![CDATA[好久没有看refractions上关于PostGIS的更新，发现最近两个月PostGIS，频繁更新了1.3.4 和1.3.5，同时 1.4.0也on this way. 关于1.3.4令人振奋的消息是关于GeoJSON的支持，我现在还在陶醉于1.3.0呵呵，而且习惯于在服务器端先AsText()然后在自己根据字符串进行解析。。有了GeoJSON的支持可以省去这个步骤，在客户端可以用Jquery直接$.getJSON，不过我觉得可能在服务器端得到GeoJSON数据后仍需要进一步解析，因为PostGIS是以对象组织空间数据的，而不是以整个文件，所以要输出整个查询结果，仍需要将结果再次组织。 同往常的更新一样，1.3.4增加了一些新的功能并fix了不少错误，Paul Ramsey依然出了不少力。Sol Katz  GFOSS被你拿到真是实至名归。1.3.5 主要是是fixmapserver配合的一个严重问题。 PS：我真的不能不佩服Paul Ramsey了。。改日我要去加拿大拜会你。。。。 References: Well organized quick tutorial of PostGIS PostGIS 1.3.4 released Postgres Journal]]></description>
			<content:encoded><![CDATA[<p>好久没有看refractions上关于PostGIS的更新，发现最近两个月PostGIS，频繁更新了1.3.4 和1.3.5，同时 1.4.0也on this way.</p>
<p>关于1.3.4令人振奋的消息是关于GeoJSON的支持，我现在还在陶醉于1.3.0呵呵，而且习惯于在服务器端先AsText()然后在自己根据字符串进行解析。。有了GeoJSON的支持可以省去这个步骤，在客户端可以用Jquery直接$.getJSON，不过我觉得可能在服务器端得到GeoJSON数据后仍需要进一步解析，因为PostGIS是以对象组织空间数据的，而不是以整个文件，所以要输出整个查询结果，仍需要将结果再次组织。</p>
<p>同往常的更新一样，1.3.4增加了一些新的功能并fix了不少错误，Paul Ramsey依然出了不少力。Sol Katz  GFOSS被你拿到真是实至名归。1.3.5 主要是是fixmapserver配合的一个严重问题。</p>
<p>PS：我真的不能不佩服Paul Ramsey了。。改日我要去加拿大拜会你。。。。</p>
<p><strong>References:</strong></p>
<p><a href="http://www.bostongis.com/postgis_quickguide.bqg" target="_blank">Well organized quick tutorial of PostGIS</a></p>
<p><a href="http://postgis.refractions.net/news/20081124/" target="_blank">PostGIS 1.3.4 released</a></p>
<p><a href="http://www.postgresonline.com/journal/index.php?/archives/7-PostGIS-for-geospatial-analysis-and-mapping.html">Postgres Journal</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoinformatics.cn/2008/12/postgis-134-%e6%94%af%e6%8c%81geojson%e6%a0%bc%e5%bc%8f%e8%be%93%e5%87%ba/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pgRouting</title>
		<link>http://www.geoinformatics.cn/2008/06/pgrouting/</link>
		<comments>http://www.geoinformatics.cn/2008/06/pgrouting/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 15:04:36 +0000</pubDate>
		<dc:creator>长安旧梦</dc:creator>
				<category><![CDATA[技术心得]]></category>
		<category><![CDATA[pgRouting]]></category>
		<category><![CDATA[PostGIS]]></category>
		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://www.geoinformatics.cn/?p=618</guid>
		<description><![CDATA[安装与配置可以参见两篇帖子： routing (来自Cartoweb) pgRouting示例 (来自GeoSalon的stinjia) 相关代码： 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 -- 构建拓扑关系-- ALTER TABLE road ADD COLUMN source_id int; ALTER TABLE road ADD [...]]]></description>
			<content:encoded><![CDATA[<p>安装与配置可以参见两篇帖子：</p>
<h4><font color="#0000ff"><a href="http://www.cartoweb.org/doc_head/docbook/xhtml/user.routing.html#user.routing.installation" target="_blank">routing (来自Cartoweb)</a></font></h4>
<h4><font color="#0000ff"><a href="http://www.cnblogs.com/StinJia/archive/2008/04/22/1165788.html" target="_blank">pgRouting示例 (来自GeoSalon的stinjia)</a></font></h4>
<p>相关代码：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
</pre></td><td class="code"><pre class="plsql" style="font-family:monospace;"><span style="color: #080; font-style: italic;">-- 构建拓扑关系--</span>
<span style="color: #00F;">ALTER</span> <span style="color: #00F;">TABLE</span> road ADD COLUMN source_id int<span style="color: #00F;">;</span>
<span style="color: #00F;">ALTER</span> <span style="color: #00F;">TABLE</span> road ADD COLUMN target_id int<span style="color: #00F;">;</span>
<span style="color: #00F;">ALTER</span> <span style="color: #00F;">TABLE</span> road ADD COLUMN edge_id int<span style="color: #00F;">;</span>
<span style="color: #080; font-style: italic;">-- next line is to work around a pgRouting bug in update_cost_from_distance (fixed in latest CVS)</span>
<span style="color: #00F;">ALTER</span> <span style="color: #00F;">TABLE</span> road RENAME id <span style="color: #00F;">TO</span> id_old<span style="color: #00F;">;</span>
&nbsp;
<span style="color: #00F;">SELECT</span> assign_vertex_id<span style="color: #00F;">&#40;</span><span style="color: #F00;">'road'</span><span style="color: #00F;">,</span> <span style="color: #800;">0.001</span><span style="color: #00F;">&#41;</span><span style="color: #00F;">;</span>
&nbsp;
<span style="color: #080; font-style: italic;">-- 重复检查--</span>
<span style="color: #00F;">SELECT</span> <span style="color: #00F;">*</span> <span style="color: #00F;">FROM</span> <span style="color: #00F;">&#40;</span><span style="color: #00F;">SELECT</span> source_id<span style="color: #00F;">,</span> target_id<span style="color: #00F;">,</span> <span style="color: #000;">COUNT</span><span style="color: #00F;">&#40;</span><span style="color: #00F;">*</span><span style="color: #00F;">&#41;</span> <span style="color: #00F;">AS</span> c <span style="color: #00F;">FROM</span> road <span style="color: #00F;">GROUP</span> <span style="color: #00F;">BY</span>
source_id<span style="color: #00F;">,</span> target_id <span style="color: #00F;">ORDER</span> <span style="color: #00F;">BY</span> c<span style="color: #00F;">&#41;</span>
<span style="color: #00F;">AS</span> foo <span style="color: #00F;">WHERE</span> foo<span style="color: #00F;">.</span>c <span style="color: #00F;">=</span> <span style="color: #800;">2</span><span style="color: #00F;">;</span>
&nbsp;
<span style="color: #080; font-style: italic;">-- 删除重复的列--</span>
<span style="color: #00F;">CREATE</span> <span style="color: #00F;">TABLE</span> doublons <span style="color: #00F;">AS</span> <span style="color: #00F;">SELECT</span> <span style="color: #00F;">*</span> <span style="color: #00F;">FROM</span> road <span style="color: #00F;">WHERE</span> gid  <span style="color: #00F;">IN</span>
<span style="color: #00F;">&#40;</span><span style="color: #00F;">SELECT</span> gid <span style="color: #00F;">FROM</span> <span style="color: #00F;">&#40;</span><span style="color: #00F;">SELECT</span> <span style="color: #00F;">DISTINCT</span> <span style="color: #00F;">ON</span> <span style="color: #00F;">&#40;</span>source_id<span style="color: #00F;">,</span> target_id<span style="color: #00F;">&#41;</span> source_id<span style="color: #00F;">,</span> gid
<span style="color: #00F;">FROM</span> road<span style="color: #00F;">&#41;</span> <span style="color: #00F;">AS</span> doublon<span style="color: #00F;">&#41;</span><span style="color: #00F;">;</span>
<span style="color: #00F;">DELETE</span> <span style="color: #00F;">FROM</span> road<span style="color: #00F;">;</span>
<span style="color: #00F;">INSERT</span> <span style="color: #00F;">INTO</span> road <span style="color: #00F;">&#40;</span><span style="color: #00F;">SELECT</span> <span style="color: #00F;">*</span> <span style="color: #00F;">FROM</span> doublons<span style="color: #00F;">&#41;</span><span style="color: #00F;">;</span>
<span style="color: #00F;">DROP</span> <span style="color: #00F;">TABLE</span> doublons<span style="color: #00F;">;</span>
&nbsp;
<span style="color: #080; font-style: italic;">-- 构建视图--</span>
<span style="color: #00F;">SELECT</span> create_graph_tables<span style="color: #00F;">&#40;</span><span style="color: #F00;">'road'</span><span style="color: #00F;">,</span> <span style="color: #F00;">'int4'</span><span style="color: #00F;">&#41;</span><span style="color: #00F;">;</span>
&nbsp;
<span style="color: #080; font-style: italic;">--用距离赋予权重 --</span>
<span style="color: #00F;">SELECT</span> update_cost_from_distance<span style="color: #00F;">&#40;</span><span style="color: #F00;">'road'</span><span style="color: #00F;">&#41;</span><span style="color: #00F;">;</span>
&nbsp;
<span style="color: #080; font-style: italic;">-- 执行shortest_path命令--</span>
<span style="color: #00F;">SELECT</span> <span style="color: #00F;">*</span> <span style="color: #00F;">FROM</span> shortest_path<span style="color: #00F;">&#40;</span><span style="color: #F00;">'
SELECT gid as id,
source_id::integer as source,
target_id::integer as target,
length(the_geom) as cost
FROM road'</span><span style="color: #00F;">,</span>
<span style="color: #800;">1</span><span style="color: #00F;">,</span> <span style="color: #800;">15</span><span style="color: #00F;">,</span> <span style="color: #00F;">TRUE</span><span style="color: #00F;">,</span> <span style="color: #00F;">FALSE</span><span style="color: #00F;">&#41;</span><span style="color: #00F;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.geoinformatics.cn/2008/06/pgrouting/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Postgis, MapServer and OpenLayers</title>
		<link>http://www.geoinformatics.cn/2007/12/postgis-mapserver-and-openlayers/</link>
		<comments>http://www.geoinformatics.cn/2007/12/postgis-mapserver-and-openlayers/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 20:30:32 +0000</pubDate>
		<dc:creator>长安旧梦</dc:creator>
				<category><![CDATA[技术心得]]></category>
		<category><![CDATA[MapServer]]></category>
		<category><![CDATA[PostGIS]]></category>
		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://www.geoinformatics.cn/index.php/category/postgresql/20071211552.html</guid>
		<description><![CDATA[If you want to establish your own map service (PostgreSQL/Postgis as the Database, MapServer as the Map Server, and Openlayers as the Client Side), I just recommend you to get the following materials from the Mapserver offical website: 1 the first section of Mapserver Tutorials 2 the last chapter of introduction to postgis 3 Examples [...]]]></description>
			<content:encoded><![CDATA[<p>If  you want to establish your own map service (PostgreSQL/Postgis as the Database, MapServer as the Map Server, and Openlayers as the Client Side), I just recommend you to get the following materials from the Mapserver offical website:</p>
<ul>
<li>1  the first section of Mapserver Tutorials</li>
<li>2  the last chapter of introduction to postgis</li>
<li>3  Examples of Openlayers Package</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.geoinformatics.cn/2007/12/postgis-mapserver-and-openlayers/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>About the Database interface of R</title>
		<link>http://www.geoinformatics.cn/2007/02/about-the-database-interface-of-r/</link>
		<comments>http://www.geoinformatics.cn/2007/02/about-the-database-interface-of-r/#comments</comments>
		<pubDate>Sun, 04 Feb 2007 18:06:29 +0000</pubDate>
		<dc:creator>长安旧梦</dc:creator>
				<category><![CDATA[技术心得]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[R]]></category>

		<guid isPermaLink="false">http://www.geoinformatics.cn/index.php/category/qgis/20070204420.html</guid>
		<description><![CDATA[在R中调用数据库中的数据是为了破除R的内存限制的一个极好方法。为了对开源软件的延续，所以一直选用开源数据库PostgreSQL，在数据库中调用R可以使用RPL，但是在R中获得数据库中的数据时，要选用DBI包。 DBI的发展，最早可以追溯到RPgSQL，后来为了对多钟数据库的支持，RPgSQL停止了更新，从而演变成RDBI，但是该包2002年也停止了更新，随而，在2006年12月4日，R Special Interest Group on Databases (R-SIG-DB)发布了DBI包，用以解决R与数据库接口的问题。昨日订阅了R-SIG-DB和R-SIG-Geo的maillist希望弄从中挖些有用的知识。 尝试用了一下用DBI链接PostgreSQL数据库，不过都fail了，不知道是自己的问题还是DBI本身的问题，它总是提示没有定义诸如“PostgreSQL”的drvName，希望近两日能够解决这个问题。]]></description>
			<content:encoded><![CDATA[<p>在R中调用数据库中的数据是为了破除R的内存限制的一个极好方法。为了对开源软件的延续，所以一直选用开源数据库PostgreSQL，在数据库中调用R可以使用RPL，但是在R中获得数据库中的数据时，要选用DBI包。</p>
<p>DBI的发展，最早可以追溯到RPgSQL，后来为了对多钟数据库的支持，RPgSQL停止了更新，从而演变成RDBI，但是该包2002年也停止了更新，随而，在2006年12月4日，R Special Interest Group on Databases (R-SIG-DB)发布了DBI包，用以解决R与数据库接口的问题。昨日订阅了R-SIG-DB和R-SIG-Geo的maillist希望弄从中挖些有用的知识。</p>
<p>尝试用了一下用DBI链接PostgreSQL数据库，不过都fail了，不知道是自己的问题还是DBI本身的问题，它总是提示没有定义诸如“PostgreSQL”的drvName，希望近两日能够解决这个问题。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoinformatics.cn/2007/02/about-the-database-interface-of-r/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why aren&#8217;t PostgreSQL R-Tree indexes supported?</title>
		<link>http://www.geoinformatics.cn/2006/12/why-arent-postgresql-r-tree-indexes-supported/</link>
		<comments>http://www.geoinformatics.cn/2006/12/why-arent-postgresql-r-tree-indexes-supported/#comments</comments>
		<pubDate>Wed, 06 Dec 2006 23:58:06 +0000</pubDate>
		<dc:creator>长安旧梦</dc:creator>
				<category><![CDATA[技术心得]]></category>
		<category><![CDATA[PostGIS]]></category>
		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://www.geoinformatics.cn/index.php/category/postgresql/20061206375.html</guid>
		<description><![CDATA[From PostGIS Manual: Early versions of PostGIS used the PostgreSQL R-Tree indexes. However, PostgreSQL R-Trees have been completely discarded since version 0.6, and spatial indexing is provided with an R-Tree-over-GiST scheme. Our tests have shown search speed for native R-Tree and GiST to be comparable. Native PostgreSQL R-Trees have two limitations which make them undesirable [...]]]></description>
			<content:encoded><![CDATA[<p>From PostGIS Manual: Early versions of PostGIS used the PostgreSQL R-Tree indexes. However, PostgreSQL R-Trees have been completely discarded since version 0.6, and spatial indexing is provided with an R-Tree-over-GiST scheme.<br />
Our tests have shown search speed for native R-Tree and GiST to be comparable. Native PostgreSQL R-Trees have two limitations which make them undesirable for use with GIS features (note that these limitations are due to the current PostgreSQL native R-Tree implementation, not the R-Tree concept in general):</p>
<ol>
<li>R-Tree indexes in PostgreSQL cannot handle features which are larger than 8K in size. GiST indexes can, using the &#8220;lossy&#8221; trick of substituting the bounding box for the feature itself.</li>
<li>R-Tree indexes in PostgreSQL are not &#8220;null safe&#8221;, so building an index on a geometry column which contains null geometries will fail.</li>
</ol>
<ul></ul>
]]></content:encoded>
			<wfw:commentRss>http://www.geoinformatics.cn/2006/12/why-arent-postgresql-r-tree-indexes-supported/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CartoWeb－an advanced framework to build WebGIS</title>
		<link>http://www.geoinformatics.cn/2006/09/cartoweb%ef%bc%8dan-advanced-framework-to-build-webgis/</link>
		<comments>http://www.geoinformatics.cn/2006/09/cartoweb%ef%bc%8dan-advanced-framework-to-build-webgis/#comments</comments>
		<pubDate>Mon, 18 Sep 2006 02:51:38 +0000</pubDate>
		<dc:creator>长安旧梦</dc:creator>
				<category><![CDATA[技术心得]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[MapServer]]></category>
		<category><![CDATA[OpenGIS]]></category>
		<category><![CDATA[PostGIS]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[WebGIS]]></category>

		<guid isPermaLink="false">http://www.geoinformatics.cn/index.php/category/postgresql/20060917210.html</guid>
		<description><![CDATA[last a few days, i was attracted by ka-map. but now, a more convenient opensource software CartoWeb, which supplies an alternative to build the client of WebGIS, comes into my view. CartoWeb is a comprehensive and ready-to-use Web-GIS (Geographical Information System) as well as a convenient framework for building advanced and customized applications. Developed by [...]]]></description>
			<content:encoded><![CDATA[<p>last a few days, i was attracted by ka-map. but now, a more convenient opensource software CartoWeb, which supplies an alternative to build the client of WebGIS, comes into my view.</p>
<p><img src="/wp-content/uploads/cartowebscreens.png" align="left" /><a title="CartoWeb" href="http://www.cartoweb.org/" target="_blank">CartoWeb</a> is a comprehensive and ready-to-use Web-GIS (Geographical Information System) as well as a convenient framework for building advanced and customized applications.</p>
<p>Developed by Camptocamp SA, it is based on the UMN MapServer engine and is released under the GNU General Public License (GPL).</p>
<p>Written using innovative language PHP5, CartoWeb is highly modular and customizable thanks to its object-oriented architecture. It runs evenly on Windows or Unix-like platforms and shows its real power when associated to PostgreSQL/PostGIS.</p>
<p>Last but not least, CartoWeb may be set up as a SOAP Web Service enabling to have front-end server on one machine and data and map generation on an other.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoinformatics.cn/2006/09/cartoweb%ef%bc%8dan-advanced-framework-to-build-webgis/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Install PostgreSQL in Ubuntu Linux</title>
		<link>http://www.geoinformatics.cn/2006/08/install-postgresql-in-ubuntu-linux/</link>
		<comments>http://www.geoinformatics.cn/2006/08/install-postgresql-in-ubuntu-linux/#comments</comments>
		<pubDate>Tue, 08 Aug 2006 02:21:51 +0000</pubDate>
		<dc:creator>长安旧梦</dc:creator>
				<category><![CDATA[技术心得]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.geoinformatics.cn/index.php/category/ubuntu/2006080740.html</guid>
		<description><![CDATA[Introduction 介绍 ======= 目前Mysql被炒得沸沸扬扬，热火朝天，但我却对大家为什么不用PostgreSQL感到很不理解，甚至很多人都不知道PostgreSQL是什么， PostgreSQL 是一种非常复杂的对象-关系型数据库管理系统（ORDBMS），也是目前功能最强大，特性最丰富和最复杂的自由软件数据库系统。有些特性甚至连商业数据库 都不具备。这个起源于伯克利（BSD）的数据库研究计划目前已经衍生成一项国际开发项目，并且有非常广泛的用户。据我了解国内四大国产数据库，其中三个都 是基于PostgreSQL开发的！不过不知道为什么大家都对Mysql情有独钟，要知道无论从功能、性能还是软件自由程度而言，Mysql与 PostgreSQL相比简直不是一个数量级的，而且官方中文文档也很齐备。大家可以访问http: //www.pgsqldb.org看看吧，尤其是那篇《PostgreSQL 的昨天、今天和明天》。 Install 安装 ======== 测试环境：Ubuntu Linux 5.10 （Breezy） 在Ubuntu下安装软件是一种享受，安装PostgreSQL也不例外： 代码: $sudo apt-get install postgresql-8.0 这样就安装好了PostgreSQL 8.0了，该安装将自动创建一个缺省的数据库集群（pgsqldb.org中的译法）“main”，且生成一个数据库超级用户postgres。 接下来就是要对数据库用户及权限进行设置了，首先要得到超级用户postgres的一个Shell，在这里可以通过下面的方式得到： 代码: $sudo -u postgres sh 在这个Shell中创建一个同你用户相同的数据库用户，在这里我使用firehare，因为这也是我登录Ubuntu的用户名 代码: $createuser -A -D firehare 然后为该用户创建一个数据库，在这里我以mydb为例 $createdb -O firehare mydb 注意以上操作都是在用户postgres的Shell中完成的，然后退出该用户Shell环境，进入自己用户的Shell中。 $exit 现在做用firehare用户，你可以通过下面的命令连接到你的mydb数据库中了 $psql mydb 退出用/q]]></description>
			<content:encoded><![CDATA[<p><span class="postbody">Introduction 介绍<br />
=======<br />
目前Mysql被炒得沸沸扬扬，热火朝天，但我却对大家为什么不用PostgreSQL感到很不理解，甚至很多人都不知道PostgreSQL是什么， PostgreSQL 是一种非常复杂的对象-关系型数据库管理系统（ORDBMS），也是目前功能最强大，特性最丰富和最复杂的自由软件数据库系统。有些特性甚至连商业数据库 都不具备。这个起源于伯克利（BSD）的数据库研究计划目前已经衍生成一项国际开发项目，并且有非常广泛的用户。据我了解国内四大国产数据库，其中三个都 是基于PostgreSQL开发的！不过不知道为什么大家都对Mysql情有独钟，要知道无论从功能、性能还是软件自由程度而言，Mysql与 PostgreSQL相比简直不是一个数量级的，而且官方中文文档也很齐备。大家可以访问http: //www.pgsqldb.org看看吧，尤其是那篇《PostgreSQL 的昨天、今天和明天》。</span></p>
<p>Install 安装<br />
========<br />
测试环境：Ubuntu Linux 5.10 （Breezy）<br />
在Ubuntu下安装软件是一种享受，安装PostgreSQL也不例外：<br />
代码:<br />
$sudo apt-get install postgresql-8.0</p>
<p>这样就安装好了PostgreSQL 8.0了，该安装将自动创建一个缺省的数据库集群（pgsqldb.org中的译法）“main”，且生成一个数据库超级用户postgres。</p>
<p>接下来就是要对数据库用户及权限进行设置了，首先要得到超级用户postgres的一个Shell，在这里可以通过下面的方式得到：<br />
代码:<br />
$sudo -u postgres sh</p>
<p>在这个Shell中创建一个同你用户相同的数据库用户，在这里我使用firehare，因为这也是我登录Ubuntu的用户名<br />
代码:<br />
$createuser -A -D firehare</p>
<p>然后为该用户创建一个数据库，在这里我以mydb为例<br />
$createdb -O firehare mydb<br />
注意以上操作都是在用户postgres的Shell中完成的，然后退出该用户Shell环境，进入自己用户的Shell中。<br />
$exit<br />
现在做用firehare用户，你可以通过下面的命令连接到你的mydb数据库中了<br />
$psql mydb<br />
退出用/q</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoinformatics.cn/2006/08/install-postgresql-in-ubuntu-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>About the paper I intend to write</title>
		<link>http://www.geoinformatics.cn/2005/11/about-the-paper-i-intend-to-write/</link>
		<comments>http://www.geoinformatics.cn/2005/11/about-the-paper-i-intend-to-write/#comments</comments>
		<pubDate>Mon, 07 Nov 2005 17:11:21 +0000</pubDate>
		<dc:creator>长安旧梦</dc:creator>
				<category><![CDATA[技术心得]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[WebGIS]]></category>

		<guid isPermaLink="false">http://www.geoinformatics.cn/index.php/category/postgresql/2005110790.html</guid>
		<description><![CDATA[PHP还是很难的一个东西。我看了几天的语法，大致有一个了解。但是同时很多问题的发现也是在自己浏览网站源码的时候发现的。 我觉得今后还是要多看看一些相关网站的程序，尽量赶快开工，要不就太晚了。 自已应该亲自写些源码，这样的话可能会更好一点，现在我的软件和硬件方面都准备的很好，就看自己的努力了！ 在WAMP平台上开发webGIS。 我的论文应该从很多方面讲，但是，最终，还是要有一个浅显的表述，和清晰的逻辑思路。 support: WAMP(LAMP) technology: SVG, GML &#8211;> XML (in a broad view) target: webGIS (一个精练的webGIS实现手段) 既然要写书一定要做好preperation, it mainly contains the facets below: 1) It is necessory to seek for more information about the core parts of the Support, Tech and Target. 2) To design a webGIS all by myself, Merely depend [...]]]></description>
			<content:encoded><![CDATA[<p>PHP还是很难的一个东西。我看了几天的语法，大致有一个了解。但是同时很多问题的发现也是在自己浏览网站源码的时候发现的。<br />
我觉得今后还是要多看看一些相关网站的程序，尽量赶快开工，要不就太晚了。</p>
<p>自已应该亲自写些源码，这样的话可能会更好一点，现在我的软件和硬件方面都准备的很好，就看自己的努力了！<br />
在WAMP平台上开发webGIS。<br />
我的论文应该从很多方面讲，但是，最终，还是要有一个浅显的表述，和清晰的逻辑思路。</p>
<p>support: WAMP(LAMP)<br />
technology: SVG, GML &#8211;> XML (in a broad view)<br />
target: webGIS (一个精练的webGIS实现手段)</p>
<p>既然要写书一定要做好preperation, it mainly contains the facets below:</p>
<p>1) It is necessory to seek for more information about the core parts of the Support, Tech and Target.</p>
<p>2) To design a webGIS all by myself, Merely depend on this, I could know more about what I should write and give more detailed information to the readers.</p>
<p>3) A schema to organize the book.</p>
<p>4) hehe, Hard Working&#8230; &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoinformatics.cn/2005/11/about-the-paper-i-intend-to-write/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

