<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>GIS4Freedom Blog</title>
	<atom:link href="http://gis4free.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://gis4free.wordpress.com</link>
	<description>Add &#34;where&#34; to your life</description>
	<lastBuildDate>Thu, 01 Dec 2011 08:02:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='gis4free.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>GIS4Freedom Blog</title>
		<link>http://gis4free.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://gis4free.wordpress.com/osd.xml" title="GIS4Freedom Blog" />
	<atom:link rel='hub' href='http://gis4free.wordpress.com/?pushpress=hub'/>
		<item>
		<title>I&#8217;m moving to www.libregis.org</title>
		<link>http://gis4free.wordpress.com/2011/11/26/im-moving-to-www-libregis-org/</link>
		<comments>http://gis4free.wordpress.com/2011/11/26/im-moving-to-www-libregis-org/#comments</comments>
		<pubDate>Sat, 26 Nov 2011 10:12:47 +0000</pubDate>
		<dc:creator>jorgearevalo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gis4free.wordpress.com/?p=507</guid>
		<description><![CDATA[I&#8217;ve migrated all the blog content to a new domain: http://www.libregis.org So, you can update your markers if needed. I will keep this blog alive for some time.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=507&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve migrated all the blog content to a new domain:</p>
<h3><strong><a href="http://www.libregis.org">http://www.libregis.org</a></strong></h3>
<p>So, you can update your markers if needed. I will keep this blog alive for some time.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gis4free.wordpress.com/507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gis4free.wordpress.com/507/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gis4free.wordpress.com/507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gis4free.wordpress.com/507/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gis4free.wordpress.com/507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gis4free.wordpress.com/507/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gis4free.wordpress.com/507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gis4free.wordpress.com/507/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gis4free.wordpress.com/507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gis4free.wordpress.com/507/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gis4free.wordpress.com/507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gis4free.wordpress.com/507/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gis4free.wordpress.com/507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gis4free.wordpress.com/507/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=507&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gis4free.wordpress.com/2011/11/26/im-moving-to-www-libregis-org/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15a5354814d778a1cdf5b9c5699f791d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gis4free</media:title>
		</media:content>
	</item>
		<item>
		<title>Web-based PostGIS geometry/raster viewers</title>
		<link>http://gis4free.wordpress.com/2011/08/27/web-based-postgis-geometryraster-viewers/</link>
		<comments>http://gis4free.wordpress.com/2011/08/27/web-based-postgis-geometryraster-viewers/#comments</comments>
		<pubDate>Sat, 27 Aug 2011 10:21:43 +0000</pubDate>
		<dc:creator>jorgearevalo</dc:creator>
				<category><![CDATA[GIS Software]]></category>
		<category><![CDATA[PostGIS Raster]]></category>

		<guid isPermaLink="false">http://gis4free.wordpress.com/?p=491</guid>
		<description><![CDATA[If you want to test PostGIS Raster (included in the next PostGIS 2.0) without installing any software in your computer, take a look at these web-based PostGIS geometry/raster viewers: Web-viewer (ASP.NET) Web viewer (PHP) Thanks to Regina Obe for this, and all the PostGIS team for the excellent work. I&#8217;m working in the GDAL PostGIS [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=491&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you want to test PostGIS Raster (included in the next PostGIS 2.0) without installing any software in your computer, take a look at these web-based PostGIS geometry/raster viewers:</p>
<ul>
<li><a title="Web-viewer (ASP.NET)" href="http://www.bostongis.com/blog/index.php?/archives/174-Minimalist-Web-based-ASP.NET-PostGIS-2.0-Spatial-GeometryRaster-Viewer.html">Web-viewer (ASP.NET)</a></li>
<li><a title="Web viewer (PHP)" href="http://www.bostongis.com/blog/index.php?/archives/175-Minimalist-Web-based-PHP-PostGIS-2.0-Spatial-GeometryRaster-Viewer.html">Web viewer (PHP)</a></li>
</ul>
<div>Thanks to Regina Obe for this, and all the PostGIS team for the excellent work. I&#8217;m working in the GDAL PostGIS Raster driver. So, I hope to have some good news soon.</div>
<p></p>
<div>BTW, if you&#8217;re attending <a title="FOSS4G 2011 in Denver" href="http://2011.foss4g.org/">FOSS4G 2011 in Denver</a>, don&#8217;t miss the talk <a title="PostGIS 2.0, the new stuff" href="http://2011.foss4g.org/sessions/postgis-20-new-stuff">PostGIS 2.0, the new stuff</a></div>
<p></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gis4free.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gis4free.wordpress.com/491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gis4free.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gis4free.wordpress.com/491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gis4free.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gis4free.wordpress.com/491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gis4free.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gis4free.wordpress.com/491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gis4free.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gis4free.wordpress.com/491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gis4free.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gis4free.wordpress.com/491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gis4free.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gis4free.wordpress.com/491/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=491&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gis4free.wordpress.com/2011/08/27/web-based-postgis-geometryraster-viewers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15a5354814d778a1cdf5b9c5699f791d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gis4free</media:title>
		</media:content>
	</item>
		<item>
		<title>Free and ready to use anywhere GIS Virtual Machine!</title>
		<link>http://gis4free.wordpress.com/2011/04/07/free-and-ready-to-use-anywhere-gis-virtual-machine/</link>
		<comments>http://gis4free.wordpress.com/2011/04/07/free-and-ready-to-use-anywhere-gis-virtual-machine/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 09:35:25 +0000</pubDate>
		<dc:creator>jorgearevalo</dc:creator>
				<category><![CDATA[GIS Software]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://gis4free.wordpress.com/?p=484</guid>
		<description><![CDATA[Ricardo Pinho has announced on postgis-users list the availabilty of a VMWare-powered GIS Virtual Machine, based on Ubuntu 10.10 and with lots of great Open Source GIS stuff. There are 3 versions of this machine: GISVM base: A VM with Ubuntu 10.10 Desktop and ready-to-execute scripts, that allow you to install the GIS software you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=484&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ricardo Pinho <a href="http://postgis.refractions.net/pipermail/postgis-users/2011-April/029372.html">has announced on postgis-users list</a> the availabilty of a VMWare-powered GIS Virtual Machine, based on Ubuntu 10.10 and with lots of great Open Source GIS stuff. There are 3 versions of this machine:</p>
<ul>
<li>GISVM base: A VM with Ubuntu 10.10 Desktop and ready-to-execute scripts, that allow you to install the GIS software you need. The lighter version.</li>
<li>GISVM desktop: This VM includes <em>PostgreSQL</em>, <em>PostGIS</em>, <em>GeoServer</em>, <em>Mapserver</em>, <em>FWTools</em>, <em>QGIS</em>, <em>GRASS</em>, <em>gvSIG</em>, <em>uDIG</em>, <em>Kosmo</em> and <em>OpenJump</em> installed. Based on Ubuntu 10.10 Desktop too.</li>
<li>GISVM server: The sever version of the VM includes <em>Linux</em>, <em>Apache</em>, <em>MySQL</em>, <em>Php</em>,<em>Tomcat</em>,<em>PostgreSQL</em>, <em>PostGIS</em>, <em>GeoServer</em>, <em>Mapserver</em>, <em>deegree</em> and <em>Geonetwork</em>. Based on Ubuntu 10.10 server.</li>
</ul>
<p>You can download the machines from <a href="http://gisvm.com/index.html">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gis4free.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gis4free.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gis4free.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gis4free.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gis4free.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gis4free.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gis4free.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gis4free.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gis4free.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gis4free.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gis4free.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gis4free.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gis4free.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gis4free.wordpress.com/484/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=484&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gis4free.wordpress.com/2011/04/07/free-and-ready-to-use-anywhere-gis-virtual-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15a5354814d778a1cdf5b9c5699f791d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gis4free</media:title>
		</media:content>
	</item>
		<item>
		<title>Collaborate with an Open Source project and win 5000$</title>
		<link>http://gis4free.wordpress.com/2011/03/31/collaborate-with-open-source-project-and-win-5000/</link>
		<comments>http://gis4free.wordpress.com/2011/03/31/collaborate-with-open-source-project-and-win-5000/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 22:57:05 +0000</pubDate>
		<dc:creator>jorgearevalo</dc:creator>
				<category><![CDATA[GSoC11]]></category>

		<guid isPermaLink="false">http://gis4free.wordpress.com/?p=478</guid>
		<description><![CDATA[I participated in Google Summer of Code 2009, and that was the way I started working on PostGIS and GDAL. Now, I&#8217;ve been selected as mentor in Google Summer of Code 2011. In this page you can see my project and other related ones, with Pierre Racine as proposed mentor. Do you want to collaborate [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=478&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I participated in <a href="http://www.google-melange.com/gsoc/program/home/google/gsoc2009">Google Summer of Code 2009</a>, and that was the way I started working on PostGIS and GDAL. Now, I&#8217;ve been selected as mentor in <a href="http://www.google-melange.com/gsoc/homepage/google/gsoc2011">Google Summer of Code 2011</a>. In <a href="http://trac.osgeo.org/postgis/wiki/WKTRasterGSoC">this page</a> you can see my project and other related ones, with Pierre Racine as proposed mentor.</p>
<p>Do you want to collaborate in an Open Source project? Contact me by e-mail or leave a comment here. This summer could be a great summer of code!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gis4free.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gis4free.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gis4free.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gis4free.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gis4free.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gis4free.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gis4free.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gis4free.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gis4free.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gis4free.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gis4free.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gis4free.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gis4free.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gis4free.wordpress.com/478/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=478&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gis4free.wordpress.com/2011/03/31/collaborate-with-open-source-project-and-win-5000/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15a5354814d778a1cdf5b9c5699f791d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gis4free</media:title>
		</media:content>
	</item>
		<item>
		<title>How to install and configure PostGIS Raster on Windows</title>
		<link>http://gis4free.wordpress.com/2011/03/10/how-to-install-and-configure-postgis-raster-on-windows/</link>
		<comments>http://gis4free.wordpress.com/2011/03/10/how-to-install-and-configure-postgis-raster-on-windows/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 18:25:25 +0000</pubDate>
		<dc:creator>jorgearevalo</dc:creator>
				<category><![CDATA[GDAL]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[PostGIS Raster]]></category>

		<guid isPermaLink="false">http://gis4free.wordpress.com/?p=438</guid>
		<description><![CDATA[A lot of people ask me about how to use PostGIS Raster and the GDAL PostGIS Raster driver in Windows systems. And most of them are, comprehensibly, using the last stable releases of both libraries (PostGIS and GDAL). The problem is PostGIS Raster and GDAL driver are being developed in these moments. There&#8217;s no stable release, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=438&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A lot of people ask me about how to use <a href="http://trac.osgeo.org/postgis/wiki/WKTRaster">PostGIS Raster</a> and the <a href="http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html">GDAL PostGIS Raster driver</a> in Windows systems. And most of them are, comprehensibly, using the last stable releases of both libraries (PostGIS and GDAL). The problem is PostGIS Raster and GDAL driver are being developed in these moments. There&#8217;s no stable release, so far.</p>
<p>PostGIS Raster was <a href="http://gis4free.wordpress.com/2010/10/01/wkt-raster-is-now-postgis-raster/">included</a> as official part of PostGIS in October 2010. The old version, formerly named WKT Raster has been <strong>abandoned</strong>. So, if you want to use PostGIS Raster, with new functionalities and many bugs fixed, you&#8217;ll have to use the latest PostGIS development snapshot. The use of the old WKT Raster extension is strongly <strong>unrecommended</strong>, and there&#8217;s no support for it.</p>
<p>About GDAL, there was an important change in the driver on October 20st, 2010. A new version was committed, and this is the only version that works with PostGIS Raster. This new driver version was included in the release <strong>1.8.0</strong>, currently the stable release. So, the use of an older release to connect with PostGIS Raster is also <strong>unrecommended</strong>.</p>
<p>With these facts in mind, I understand the Windows users who want to use PostGIS Raster and the GDAL driver are a bit unprotected. I&#8217;m not a Windows user, but I consider it my fault. For this reason, I&#8217;ve decided to create this howto. I&#8217;m going to install and configure PostGIS Raster and GDAL in Windows. And fortunately, you don&#8217;t need to compile anything. Let&#8217;s go for it:</p>
<h3><strong>Enviroment: Windows 7 32 bits</strong></h3>
<h3>Step 1: Installing Python and Numpy</h3>
<p>PostGIS Raster loader uses GDAL Python bindings and numpy. So, we&#8217;ll first install Python and numpy. Several options here:</p>
<ul>
<li><a href="http://www.python.org/download/releases/2.5.4/">Python 2.5</a>, unofficial numpy 1.5.1 (download numpy-1.5.1.win32-py2.5.‌exe from <a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/">here</a>)</li>
<li><a href="http://www.python.org/download/releases/2.6.6/">Python 2.6</a>, unofficial numpy 1.5.1 (download numpy-1.5.1.win32-py2.6.‌exe from <a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/">here</a>)</li>
<li><a href="http://www.python.org/download/releases/2.7.1/">Python 2.7</a>, unofficial numpy 1.5.1 (download numpy-1.5.1.win32-py2.7.‌exe from <a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/">here</a>)</li>
</ul>
<p>I&#8217;m using:</p>
<ul>
<li>Python 2.6.6</li>
<li>Numpy 1.5.1 (numpy-1.5.1.win32-py2.6.‌exe)</li>
</ul>
<h3>Step 2: Installing GDAL</h3>
<p>I think the easiest way to have a complete GDAL installation (library + binaries + Python bindings) working on Windows is using the GDAL binaries mantained by Tamas Szekeres, <a href="http://vbkto.dyndns.org/sdk/">here</a>. Last GDAL versions from trunk are compiled daily with MSVC 2003, MSVC 2005 and MSVC 2008. Pick one. For example, the version compiled with MSVC 2003, <a href="http://vbkto.dyndns.org/sdk/PackageList.aspx?file=release-1310-gdal-1-8-mapserver-5-6.zip">here</a>.</p>
<p>The  faster way now would be to download the <a href="http://vbkto.dyndns.org/sdk/Download.aspx?file=release-1310-gdal-1-8-mapserver-5-6\gdal-18-1310-core.msi">generic installer for the GDAL core components</a>, and choose the complete installation</p>
<div id="attachment_446" class="wp-caption aligncenter" style="width: 509px"><a href="http://gis4free.files.wordpress.com/2011/03/gdal_core_installer_for_windows.png"><img class="size-full wp-image-446" title="GDAL 1.8.0 core installer for Windows" src="http://gis4free.files.wordpress.com/2011/03/gdal_core_installer_for_windows.png?w=600" alt="GDAL 1.8.0 core installer for Windows"   /></a><p class="wp-caption-text">GDAL 1.8.0 core installer for Windows</p></div>
<p>After the installation, you will need to add <em>C:\Program Files\GDAL\</em> to the PATH enviroment var. And create this new var:</p>
<pre>GDAL_DATA=C:\Program Files\GDAL\gdal-data</pre>
<p><strong>UPDATE 2011-10-07</strong>: About the GDAL Python bindings</p>
<p>After installing GDAL core components, you must install the Python bindings separately. You can use<a href="http://vbkto.dyndns.org/sdk/Download.aspx?file=release-1310-gdal-1-8-mapserver-5-6%5CGDAL-1.8.0.win32-py2.7.msi"> this installer</a> (for Python 2.7 and GDAL 1.8.0), or grab one of the executables existent at <a href="http://www.lfd.uci.edu/%7Egohlke/pythonlibs/">http://www.lfd.uci.edu/~gohlke/pythonlibs/</a></p>
<p>Depending on your Python installation, you can choose GDAL-1.8.1.win32-py2.6.‌exe, GDAL-1.8.1.win32-py2.7.‌exe, GDAL-1.8.1.win32-py3.1.‌exe or GDAL-1.8.1.win32-py3.2.‌exe</p>
<p><strong>UPDATE 2011-03-25:</strong> Alicia Duarte, from <a href="http://www.idesf.santafe.gov.ar/idesf/system/index.php">IDESF</a>, told me she was to additionally set the next enviroment vars to make it work:</p>
<pre>GDAL_DRIVER_PATH=C:\Program Files\GDAL\gdalplugins
PROJ_LIB=C:\Program Files\GDAL\projlib</pre>
<p></p>
<p><strong>WARNING</strong>: This directory (GDAL Python bindings location) may not exist in your GDAL installation. In my case, the bindings are in C:\Python27\Lib\site-packages\osgeo, and I didn&#8217;t need to define this variable.</p>
<pre>PYTHONPATH=C:\Program Files\GDAL\python</pre>
<p></p>
<p><del><strong>UPDATE 2011-07-19:</strong>  I think I introduced some confusion in the comments. I apologize for that. Several people are having problems with GDAL Python bindings. I&#8217;ll  try to make it clearer:</del></p>
<ul>
<li><del>On one hand, there&#8217;s a sure thing: you need GDAL library + GDAL Python bindings installed in your system. There&#8217;s an easy way of doing it, by executing the generic installer: <a href="http://vbkto.dyndns.org/sdk/Download.aspx?file=release-1310-gdal-1-8-mapserver-5-6\gdal-18-1310-core.msi">gdal-18-1310-core.msi</a>. This installer includes the Python bindings, and they&#8217;re installed at C:\Program Files\GDAL\python directory by default. This should be enough.</del></li>
<li><del>If you previously have a Python interpreter and a GDAL version installed on your system (check it from a console, executing gdalinfo &#8211;formats), you may want to simply install the proper GDAL Python bindings. Let&#8217;s assume your GDAL version is 1.8 (lower versions won&#8217;t work with PostGIS Raster), and your Python version is 2.7. Then, you simply need to install <a href="http://vbkto.dyndns.org/sdk/Download.aspx?file=release-1310-gdal-1-8-mapserver-5-6\GDAL-1.8.0.win32-py2.7.msi">GDAL-1.8.0.win32-py2.7.msi</a>. This installer will put GDAL Python bindings at C:\Python27\Lib\site-packages by default. This is a different location than above, but at the end, you should have a working version of GDAL Python bindings on your system.</del></li>
<li><del>Finally,  the PostGIS Windows experimental binaries with PostGIS Raster support (step 4) are packed with their own version of GDAL library, used only by the raster2pgsql loader.</del></li>
</ul>
<p>GDAL installed. Now, let&#8217;s go with step 3</p>
<h3>Step 3: Installing PostgreSQL</h3>
<p>I recommend Postgresql 8.4.x or higher. You can download the 1-click-installer from <a href="http://www.enterprisedb.com/products-services-training/pgdownload#windows">here</a>, and install it in the common Windows&#8217; way.</p>
<p>During the installation, you&#8217;ll be asked to install some nice additional stuff using the Application Stack Builder, like PostGIS 1.5.x or PostGIS 1.4.x. Don&#8217;t install anything. The PostGIS versions that can be installed doesn&#8217;t include PostGIS Raster. And you can&#8217;t install it separately, because, remember, now is part of PostGIS. We&#8217;re going to install last PostGIS version by hand. Don&#8217;t be afraid, it&#8217;ll be easy.</p>
<h3>Step 4: Installing PostGIS</h3>
<p>We&#8217;re going to use the <a href="http://postgis.refractions.net/download/windows/experimental.php">PostGIS Windows experimental binaries</a>. We need the binaries compiled for PostgreSQL 8.4, <a href="http://postgis.refractions.net/download/windows/pg84/experimental/postgis/postgis-pg84-binaries-2.0.0svn.zip">these ones</a></p>
<p>Once uncompressed, you can see this</p>
<div id="attachment_441" class="wp-caption aligncenter" style="width: 603px"><img class="size-full wp-image-441" title="Contents of binary package PostGIS 2.0 for Windows" src="http://gis4free.files.wordpress.com/2011/03/postgis_20_for_windows1.png?w=600" alt="postgis20 windows"   /><p class="wp-caption-text">Contents of binary package PostGIS 2.0 for Windows</p></div>
<p>Following the instructions of README.txt file, let&#8217;s edit <em>makepostgisdb.bat</em> to adapt the vars to our enviroment. We may want to change these vars:</p>
<pre>set PGPORT=5432
set PGHOST=localhost
set PGUSER=postgres
set PGPASSWORD=password_of_postgres_user
set THEDB=template_postgis20
set PGBIN=C:\Program Files\PostgreSQL\8.4\bin\
set PGLIB=C:\Program Files\PostgreSQL\8.4\lib\

<span class="Apple-style-span" style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:13px;line-height:19px;white-space:normal;">A</span><span class="Apple-style-span" style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:13px;line-height:19px;white-space:normal;">fter that, we make a backup of our PostgreSQL bin and lib directories (PGBIN and PGLIB). Just in case.</span></pre>
<p>We now execute <em>makepostgisdb.bat</em>. Take into account you may want to execute the script as <strong>administrator</strong>, in case your Windows user doesn&#8217;t have needed privileges (it was my case).</p>
<p><strong>UPDATE 2011-06-08</strong>: For all Windows XP Professional SP2 users:</p>
<p>when you run makepostgisdb.bat from the binaries of POSTGIS SVN2.0, please rename the libiconv-2.dll in bin folder of Postgresql/8.4/bin folder to any other name. Now run the makepostgisdb.bat file. You will not get any error of “operation aborted …. transaction block” (Thanks to <strong>C Patnaik</strong>)</p>
<p>Once executed, we have PostGIS 2.0 + PostGIS Raster installed and configured. A new database called <em>template_postgis20</em> is created, enabled with PostGIS and PostGIS Raster. Easy! Let&#8217;s test it with the next query:</p>
<pre>select postgis_full_version(), postgis_raster_lib_build_date(), postgis_raster_lib_version()</pre>
<p>
And the result:</p>
<div id="attachment_443" class="wp-caption aligncenter" style="width: 710px"><a href="http://gis4free.files.wordpress.com/2011/03/testing_postgis20_windows2.png"><img class="size-full wp-image-443" title="PostGIS version installed" src="http://gis4free.files.wordpress.com/2011/03/testing_postgis20_windows2.png?w=600" alt="PostGIS version installed"   /></a><p class="wp-caption-text">PostGIS version installed</p></div>
<p>Of course, you can create your own database using <em>template_postgis20</em> as template. From the command line:</p>
<pre>createdb -U postgres -T template_postgis20 your_database</pre>
<p>
Or from pgAdmin III:</p>
<div id="attachment_448" class="wp-caption aligncenter" style="width: 356px"><a href="http://gis4free.files.wordpress.com/2011/03/testing_postgis20_windows41.png"><img class="size-full wp-image-448" title="Creating new database from template in pgAdmin III" src="http://gis4free.files.wordpress.com/2011/03/testing_postgis20_windows41.png?w=600" alt="Creating new database from template in pgAdmin III"   /></a><p class="wp-caption-text">Creating new database from template in pgAdmin III</p></div>
<p>If you want to use the SHP2PGSQL GUI, you must copy the <em>postguisgui </em>folder (inside <em>bin </em>folder in the downloaded PostGIS experimental binaries file) into pgAdmin III folder (mine is <em>C:\Program Files\pgAdmin III\1.12</em>) and add the next lines to <em>plugins.ini</em> file, inside pgAdmin III folder too:</p>
<pre>;
;PostGIS shp2pgsql-gui (Windows):
;
Title=PostGIS Shapefile and DBF loader
Command="$$PGBINDIR\postgisgui\shp2pgsql-gui.exe" -h "$$HOSTNAME" -p $$PORT -U "$$USERNAME" -d "$$DATABASE" -W "$$PASSWORD"
Description=Open a PostGIS ESRI Shapefile or Plain dbf loader console to the current database.
KeyFile=$$PGBINDIR\postgisgui\shp2pgsql-gui.exe
Platform=windows
ServerType=postgresql
Database=Yes
SetPassword=Yes</pre>
<p>
After that, you can use the GUI inside pgAdmin III:</p>
<div id="attachment_444" class="wp-caption aligncenter" style="width: 690px"><a href="http://gis4free.files.wordpress.com/2011/03/testing_postgis20_windows3.png"><img class="size-full wp-image-444" title="SHP2PGSQL GUI installed under pgAdmin III" src="http://gis4free.files.wordpress.com/2011/03/testing_postgis20_windows3.png?w=600" alt="SHP2PGSQL GUI installed under pgAdmin III"   /></a><p class="wp-caption-text">SHP2PGSQL GUI installed under pgAdmin III</p></div>
<p>Now you can load raster data into your database in 2 steps. In the first step, you will generate a SQL file. Open a command line and execute this:</p>
<pre>python C:\Program Files\Postgresql\8.4\bin\raster2pgsql.py -r image.tif -t tablename -o image.sql</pre>
<p>
As result of this step, a SQL file named <em>image.sql</em> will be created in the directory where you executed the Python line above.</p>
<p>In the second step, you&#8217;ll need to load the SQL file in your_database, by using your favourite PostgreSQL client. For example, pgAdmin. If your use the psql command line client, the line to execute is:</p>
<pre>psql -h localhost -U postgres -d your_database -f image.sql</pre>
<p>
If you want to translate your raster data from the database to image files at disk again, execute <a href="http://www.gdal.org/gdal_translate.html">gdal_translate</a>.</p>
<pre>gdal_translate PG:"dbname=your_database user=postgres table=your_table mode=2" your_file.tif</pre>
<p>
Basically, this is all what you need to work with PostGIS Raster in Windows. Anyway, take into account the next additional notes:</p>
<h3>Additional notes:</h3>
<p>In step 2, I installed the whole GDAL library, including binaries and Python bindings. In step 4, I installed PostGIS 2.0 with all its pre-requisites. One of them is GDAL. The optimal way would be to use the existent GDAL library, but we&#8217;re working with pre-compiled binaries and DLLs. So, we have 2 copies of GDAL library:</p>
<ul>
<li><em>C:\Program Files\GDAL\gdal18.dll</em>: Installed with generic installer for GDAL, in step 2. Used by gdal_translate, when reading data from database, and in any operation involving GDAL, <strong>except </strong>the raster loading with <em>raster2pgsql.py</em> script</li>
<li><em>C:\Program Files\PostgreSQL\8.4\bin\libgdal.dll</em>: Installed with PostGIS Windows experimental binaries, in step 4. Used by <em>raster2pgsql.py</em> script, to load raster data into PostgreSQL.</li>
</ul>
<p>Both library files were compiled from GDAL 1.8.0 from trunk. But they will be slightly different, for sure. This is a suboptimal solution, of course, but it shouldn&#8217;t cause problems, because <em>libgdal.dll</em> is only used when loading raster data into the database. The rest of operations involving GDAL will be executed linking with <em>gdal18.dll</em></p>
<p>If you want to translate the raster data to any image format different from TIFF, you can use the -of option in gdal_translate. For example:</p>
<pre>gdal_translate -of "PNG" PG:"dbname=your_database user=your_user password=your_password table=your_table mode=2" your_file.png</pre>
<p>To get available raster formats:</p>
<pre>gdalinfo --formats</pre>
<p>UPDATE 2011-06-11: I changed the gdal_translate line. I&#8217;m using the &#8216;postgres&#8217; user and the &#8216;trust&#8217; method to authenticate this user (so, no password is needed), but it&#8217;s only a simplification. In general, you should use a different user and a password-enabled authentication method, like md5. Thanks to <strong>C.Patnaik</strong> again, because <a href="http://gis4free.wordpress.com/2011/03/10/how-to-install-and-configure-postgis-raster-on-windows/#comment-234">his comment</a> remainded me this issue</p>
<p><span class="Apple-style-span" style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:15px;font-weight:bold;line-height:19px;white-space:normal;">Conclussions:</span></p>
<p>It&#8217;s possible to work with the last version of PostGIS Raster and GDAL PostGIS Raster driver in Windows, but assuming that:</p>
<ul>
<li>You&#8217;re using experimental build. Not recommended for production enviroments.</li>
<li>The previous versions of PostGIS Raster (WKT Raster) and GDAL PostGIS Raster driver (before GDAL 1.8.0) are discontinued. Don&#8217;t use them.</li>
<li>It&#8217;s a suboptimal solution, because you install 2 copies of GDAL library. But I think this is the best available solution right now.</li>
</ul>
<p>Do you have problems, something to add, modify or correct? Let me know it in the comments</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gis4free.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gis4free.wordpress.com/438/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gis4free.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gis4free.wordpress.com/438/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gis4free.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gis4free.wordpress.com/438/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gis4free.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gis4free.wordpress.com/438/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gis4free.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gis4free.wordpress.com/438/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gis4free.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gis4free.wordpress.com/438/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gis4free.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gis4free.wordpress.com/438/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=438&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gis4free.wordpress.com/2011/03/10/how-to-install-and-configure-postgis-raster-on-windows/feed/</wfw:commentRss>
		<slash:comments>124</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15a5354814d778a1cdf5b9c5699f791d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gis4free</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2011/03/gdal_core_installer_for_windows.png" medium="image">
			<media:title type="html">GDAL 1.8.0 core installer for Windows</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2011/03/postgis_20_for_windows1.png" medium="image">
			<media:title type="html">Contents of binary package PostGIS 2.0 for Windows</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2011/03/testing_postgis20_windows2.png" medium="image">
			<media:title type="html">PostGIS version installed</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2011/03/testing_postgis20_windows41.png" medium="image">
			<media:title type="html">Creating new database from template in pgAdmin III</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2011/03/testing_postgis20_windows3.png" medium="image">
			<media:title type="html">SHP2PGSQL GUI installed under pgAdmin III</media:title>
		</media:content>
	</item>
		<item>
		<title>PostGIS Raster meets Desktop</title>
		<link>http://gis4free.wordpress.com/2010/12/10/postgis-raster-meets-desktop/</link>
		<comments>http://gis4free.wordpress.com/2010/12/10/postgis-raster-meets-desktop/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 12:36:32 +0000</pubDate>
		<dc:creator>jorgearevalo</dc:creator>
				<category><![CDATA[PostGIS Raster]]></category>

		<guid isPermaLink="false">http://gis4free.wordpress.com/?p=433</guid>
		<description><![CDATA[As I said in my previous post, there are people working to bring PostGIS Raster to desktop. Specifically: QGIS plugin for PostGIS Raster. Further information here. PostGIS Raster in gvSIG. Presentation in spanish, sorry. Official part of gvSIG from version 1.11. Many thanks! These initiatives help to continue working<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=433&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As I said in my <a href="http://gis4free.wordpress.com/2010/12/09/gdal-postgis-raster-driver/">previous post</a>, there are people working to bring PostGIS Raster to desktop. Specifically:</p>
<ul>
<li><a href="http://spatialserver.net/pyqgis_1.0/contributed/wktraster.zip">QGIS plugin for PostGIS Raster</a>. Further information <a href="http://pyqgis.org/repo/contributed">here</a>.</li>
<li>PostGIS Raster in gvSIG.<a href="http://www.slideshare.net/nbrodin/postgisrastergvsig"> Presentation</a> in spanish, sorry. Official part of gvSIG from version 1.11.</li>
</ul>
<p>Many thanks! These initiatives help to continue working</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gis4free.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gis4free.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gis4free.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gis4free.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gis4free.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gis4free.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gis4free.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gis4free.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gis4free.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gis4free.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gis4free.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gis4free.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gis4free.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gis4free.wordpress.com/433/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=433&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gis4free.wordpress.com/2010/12/10/postgis-raster-meets-desktop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15a5354814d778a1cdf5b9c5699f791d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gis4free</media:title>
		</media:content>
	</item>
		<item>
		<title>GDAL PostGIS Raster Driver</title>
		<link>http://gis4free.wordpress.com/2010/12/09/gdal-postgis-raster-driver/</link>
		<comments>http://gis4free.wordpress.com/2010/12/09/gdal-postgis-raster-driver/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 11:49:45 +0000</pubDate>
		<dc:creator>jorgearevalo</dc:creator>
				<category><![CDATA[GDAL]]></category>
		<category><![CDATA[PostGIS Raster]]></category>

		<guid isPermaLink="false">http://gis4free.wordpress.com/?p=424</guid>
		<description><![CDATA[Some people are asking for improvements and bug fixes on GDAL PostGIS Raster driver. Since r20912, there is an improved version of the driver in GDAL trunk. I&#8217;m working on it. And I know there are people making efforts to bring PostGIS Raster to some Desktop viewers by using GDAL. Many thanks! Apart from that, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=424&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some people are asking for improvements and bug fixes on <a title="GDAL PostGIS Raster driver" href="http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html">GDAL PostGIS Raster driver</a>. Since <a title="Release 20912 of GDAL PostGIS Raster driver" href="http://trac.osgeo.org/gdal/changeset/20912">r20912</a>, there is an improved version of the driver in GDAL trunk. I&#8217;m working on it. And I know there are people making efforts to bring PostGIS Raster to some Desktop viewers by using GDAL. Many thanks!</p>
<p>Apart from that, I&#8217;m working on <a title="PostGIS Raster MapAlgebra" href="http://trac.osgeo.org/postgis/wiki/WKTRaster/SpecificationWorking02#Objective2.0.02-Beingabletocreatearasterastheexpressionofanotherraster">PostGIS Raster MapAlgebra</a>. First version before January (I hope&#8230;)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gis4free.wordpress.com/424/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gis4free.wordpress.com/424/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gis4free.wordpress.com/424/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gis4free.wordpress.com/424/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gis4free.wordpress.com/424/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gis4free.wordpress.com/424/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gis4free.wordpress.com/424/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gis4free.wordpress.com/424/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gis4free.wordpress.com/424/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gis4free.wordpress.com/424/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gis4free.wordpress.com/424/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gis4free.wordpress.com/424/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gis4free.wordpress.com/424/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gis4free.wordpress.com/424/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=424&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gis4free.wordpress.com/2010/12/09/gdal-postgis-raster-driver/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15a5354814d778a1cdf5b9c5699f791d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gis4free</media:title>
		</media:content>
	</item>
		<item>
		<title>WKT Raster is now PostGIS Raster</title>
		<link>http://gis4free.wordpress.com/2010/10/01/wkt-raster-is-now-postgis-raster/</link>
		<comments>http://gis4free.wordpress.com/2010/10/01/wkt-raster-is-now-postgis-raster/#comments</comments>
		<pubDate>Fri, 01 Oct 2010 15:28:19 +0000</pubDate>
		<dc:creator>jorgearevalo</dc:creator>
				<category><![CDATA[PostGIS Raster]]></category>

		<guid isPermaLink="false">http://gis4free.wordpress.com/?p=413</guid>
		<description><![CDATA[The WKT PostGIS raster code is now part of PostGIS trunk. Quick install instructions (from PostGIS sources): ./configure &#8211;with-raster make make rt-all make install make rt-install createdb &#60;your_database&#62; createlang plpgsql &#60;your_database&#62; psql -f postgis/postgis.sql -d &#60;your_database&#62; psql -f spatial_ref_sys.sql -d &#60;your_database&#62; psql -f raster/rt_pg/rtpostgis.sql -d &#60;your_database&#62; UPDATE 1 (2010-10-22): With the last release (r6095) it&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=413&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <del datetime="2010-10-01T15:19:08+00:00">WKT</del> PostGIS raster code is now part of <a href="http://svn.osgeo.org/postgis/trunk/">PostGIS trunk</a>. Quick install instructions (from PostGIS sources):</p>
<ol>
<li><del>./configure &#8211;with-raster</del></li>
<li><del>make</del></li>
<li><del>make rt-all</del></li>
<li><del>make install</del></li>
<li><del>make rt-install</del></li>
<li><del>createdb &lt;your_database&gt;</del></li>
<li><del>createlang plpgsql &lt;your_database&gt;</del></li>
<li><del>psql -f postgis/postgis.sql -d &lt;your_database&gt;</del></li>
<li><del>psql -f spatial_ref_sys.sql -d &lt;your_database&gt;</del></li>
<li><del>psql -f raster/rt_pg/rtpostgis.sql -d &lt;your_database&gt;</del></li>
</ol>
<p>UPDATE 1 (2010-10-22): With the last release (r6095) it&#8217;s an easier process:</p>
<ol>
<li>./configure &#8211;with-raster</li>
<li>make</li>
<li>make install</li>
<li>createdb &lt;your_database&gt;</li>
<li>createlang plpgsql &lt;your_database&gt;</li>
<li>psql -U &lt;your_user&gt; -f postgis/postgis.sql -d &lt;your_database&gt;</li>
<li>psql -U &lt;your user&gt; -f spatial_ref_sys.sql -d &lt;your_database&gt;</li>
<li>psql -U &lt;your user&gt; -f raster/rt_pg/rtpostgis.sql -d &lt;your_database&gt;</li>
</ol>
<p>In case your user requires a password, add -W as psql flag, and you&#8217;ll be prompted for the password. Further information in <a href="http://svn.osgeo.org/postgis/trunk/README.postgis">README.postgis</a> and <a href="http://svn.osgeo.org/postgis/trunk/README.raster">README.raster</a> files.</p>
<p>And of course, I&#8217;m working on <a href="http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html">GDAL PostGIS Raster driver</a>. I&#8217;ll add the new specifications ASAP.</p>
<p>UPDATE 2 (2010-10-21): New version of the driver committed to repository.  Now its name is <strong>postgisraster</strong>, instead the old one: <span style="text-decoration:line-through;"><strong>wktraster</strong></span>. Further information in the link above.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gis4free.wordpress.com/413/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gis4free.wordpress.com/413/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gis4free.wordpress.com/413/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gis4free.wordpress.com/413/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gis4free.wordpress.com/413/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gis4free.wordpress.com/413/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gis4free.wordpress.com/413/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gis4free.wordpress.com/413/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gis4free.wordpress.com/413/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gis4free.wordpress.com/413/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gis4free.wordpress.com/413/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gis4free.wordpress.com/413/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gis4free.wordpress.com/413/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gis4free.wordpress.com/413/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=413&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gis4free.wordpress.com/2010/10/01/wkt-raster-is-now-postgis-raster/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15a5354814d778a1cdf5b9c5699f791d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gis4free</media:title>
		</media:content>
	</item>
		<item>
		<title>Comparing Oracle GeoRaster with PostGIS WKT Raster (II)</title>
		<link>http://gis4free.wordpress.com/2010/09/01/oracle-georaster-part-ii/</link>
		<comments>http://gis4free.wordpress.com/2010/09/01/oracle-georaster-part-ii/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 23:08:26 +0000</pubDate>
		<dc:creator>jorgearevalo</dc:creator>
				<category><![CDATA[PostGIS Raster]]></category>

		<guid isPermaLink="false">http://gis4free.wordpress.com/?p=343</guid>
		<description><![CDATA[In the previous post, I installed and configured Oracle GeoRaster, and did some basic stuff: load a shapefile, load raster data, view these data and export them, using PL/SQL and Java. We compared some points I consider Oracle GeoRaster&#8217;s weak points with PostGIS WKT Raster. Now, I&#8217;d like to reproduce the Pierre Racine&#8217;s tutorial, but [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=343&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In the <a href="http://gis4free.wordpress.com/2010/07/19/oracle-georaster-part-i/">previous post</a>, I installed and configured Oracle GeoRaster, and did some basic stuff: load a shapefile, load raster data, view these data and export them, using PL/SQL and Java. We compared some points I consider Oracle GeoRaster&#8217;s weak points with PostGIS WKT Raster.</p>
<p>Now, I&#8217;d like to reproduce the <a href="http://trac.osgeo.org/postgis/wiki/WKTRasterTutorial01">Pierre Racine&#8217;s tutorial</a>, but using Oracle GeoRaster. Will it be possible? Let&#8217;s see it&#8230;</p>
<h3>PREVIOUS STEPS</h3>
<p>We&#8217;re going to use <a href="http://www.openjump.org/">OpenJUMP</a>, to see the results of our queries. So, we first install it. Easy task. But now, we need a plugin that allows OpenJUMP to retrieve geographic information from our Oracle Database. The plugin I used was <a href="http://jumpdbqplugin.sourceforge.net/">JUMP DB Query Plugin</a>.</p>
<p>The instructions are pretty clear, so, I only had to:</p>
<ol>
<li>Unzip the plugin files into the OpenJUMP lib/ext folder</li>
<li>Download and unzip the correct Oracle JDBC driver for my Oracle Enterprise Database version (11.1.0.6.0) in the OpenJUMP lib/ext folder.</li>
<li>Run openjump.bat</li>
</ol>
<p>And that&#8217;s all. Ready to start.</p>
<h3>Loading shapefiles (caribou distribution shapefiles)</h3>
<p>I used the cariboupoint table generated in PostGIS, just as described in the tutorial. Using pgsql2shp, I dumped the table data into a shapefile.</p>
<div id="attachment_346" class="wp-caption aligncenter" style="width: 710px"><a href="http://gis4free.files.wordpress.com/2010/08/pgsql2shp.png"><img class="size-full wp-image-346" title="Dumping cariboupoints table" src="http://gis4free.files.wordpress.com/2010/08/pgsql2shp.png?w=600" alt=""   /></a><p class="wp-caption-text">Dumping cariboupoints table</p></div>
<p>Then, using shp2sdo again, I converted my data to SDO format:</p>
<div id="attachment_345" class="wp-caption aligncenter" style="width: 602px"><a href="http://gis4free.files.wordpress.com/2010/08/shp2sdo_2.png"><img class="size-full wp-image-345" title="Transforming cariboupoints SHP to SDO format" src="http://gis4free.files.wordpress.com/2010/08/shp2sdo_2.png?w=600" alt=""   /></a><p class="wp-caption-text">Transforming cariboupoints SHP to SDO format</p></div>
<p>Of course, I could create the data using a PL/SQL procedure, just like Pierre did in his tutorial. But the procedure was created only for providing a shapefile to work with, in case you don&#8217;t have access to real caribou distribution data. We can use the same file.</p>
<h3>Visualizing the caribou point in OpenJUMP</h3>
<p>Now, from OpenJUMP, run the query select geom from cariboupoints. The result, here:</p>
<div id="attachment_347" class="wp-caption aligncenter" style="width: 710px"><a href="http://gis4free.files.wordpress.com/2010/08/openjump_1.png"><img class="size-full wp-image-347" title="Viewing cariboupoints table from Oracle in OpenJUMP" src="http://gis4free.files.wordpress.com/2010/08/openjump_1.png?w=600" alt=""   /></a><p class="wp-caption-text">Viewing cariboupoints table from Oracle in OpenJUMP</p></div>
<h3>Loading raster data</h3>
<p>As we showed in the previous post, we need to insert 4 GeoTIFF files, covering the whole area of Spain. Specifically, 4 SRTM 90m DEM files. There are 2 more files, covering the area of Canary Islands, but they are not continuous with the rest of the data. As Oracle GeoRaster uses a one-georeference-by-layer georeference schema instead of one-georeference-by-raster one, you can&#8217;t store non-continuous raster data in the same raster data table. For the purposes of this tutorial, we only need the 4 files covering Spain area.</p>
<p>So, as we saw in previous post, we first reformat and reblock GeoTIFF images, to ensure they don&#8217;t have BSQ interleaving:</p>
<pre>gdal_translate -of GTiff -a_srs epsg:4326 -anodata -32768 -co “TFW=YES” -co “INTERLEAVE=PIXEL”
-co “TILED=YES” -co "BLOCKXSIZE=50" -co "BLOCKYSIZE=50" image.tif image_new.tif</pre>
<p>&nbsp;<br />
Options used:</p>
<ul>
<li>-of Gtiff: The output format for the reformatted files. GeoTIFF again.</li>
<li>-a_srs epsg:4326: This is the srid for the data. The same than input files.</li>
<li>-anodata -32768: This is the NODATA value for bands. We can get this value using gdalinfo over the original files.</li>
<li>-co &#8220;TFW=YES&#8221;: This forces gdal_translate to create an output tfw file, with georeference data.</li>
<li>-co &#8220;INTERLEAVE=PIXEL&#8221;: Forces pixel interleaving in the output files, the only allowed interleaving schema.</li>
<li>-co &#8220;TILED=yes&#8221;: Forces the creation of stripped TIFF files.</li>
<li>-co &#8220;BLOCKXSIZE=50&#8243;, -co BLOCKYSIZE=50&#8243;: Dimensions for tiles. The same used in WKT Raster tutorial.</li>
</ul>
<p>Further information about GeoTIFF driver for GDAL <a href="http://www.gdal.org/frmt_gtiff.html">here</a>. Now, we have to repit this with every single file we&#8217;re going to load. Once done, we can load the files in Oracle GeoRaster, using SDO_GEOR.importFrom procedure as follows:</p>
<pre>DECLARE
geor SDO_GEORASTER;
BEGIN
-- Initialize an empty GeoRaster object into which the external image
-- is to be imported.
INSERT INTO spain_images
values( 1, 'Spain_TIFF_1', sdo_geor.init('spain_images_rdt') );
-- Import the TIFF image.
SELECT image INTO geor FROM spain_images
WHERE image_id = 1 FOR UPDATE;
sdo_geor.importFrom(geor, 'blocksize=(50,50) spatialExtent=TRUE', 'TIFF', 
'file', 'C:\orcl_tut\srtm_35_04_new.tif',
'WORLDFILE', 'FILE', 'C:\orcl_tut\srtm_35_04_new.tfw');
UPDATE spain_images SET image = geor WHERE image_id = 1;
END;</pre>
<p>&nbsp;<br />
Three comments here:</p>
<ul>
<li>The option &#8216;<em>blocksize=(50,50)</em>&#8216; is not really needed. As we can read in the <a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28398/geor_intro.htm#CHDIJFCD">Oracle Spatial Developer&#8217;s guide, storage parameters section</a>, &#8220;If you specify neither <code>blocking</code> nor <code>blockSize</code>, default values are derived from the source GeoRaster object: that is, if the original data is not blocked, the data in the output GeoRaster object is by default not blocked; and if the original data is blocked, the data in the output GeoRaster object is blocked with the same blocking scheme&#8221;. As long as we specified block size when reformatting GeoTIFF files, we wouldn&#8217;t need to use that option now.</li>
<li>The option &#8216;<em>spatialExtent=TRUE</em>&#8216; will be necessary later. Anyway, if we omit this option, we can generate the spatial extent of the raster objects by <em>SDO_GEOR.generateSpatialExtent</em> procedure, once raster data are loaded. Further information on generating and setting spatial extents in the <a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28398/geor_operations.htm#CIHGGAIG">Oracle Georaster Developer&#8217;s Guide, section 3.6</a></li>
<li>We provide, as additional arguments, the World File, with georeference information.</li>
</ul>
<div>Now, we can see the extent coordinates in the correct reference system:</div>
<div>
<div id="attachment_361" class="wp-caption aligncenter" style="width: 651px"><a href="http://gis4free.files.wordpress.com/2010/08/srtm_spatial_extent_ok1.png"><img class="size-full wp-image-361" title="GeoRaster spatial extent ok" src="http://gis4free.files.wordpress.com/2010/08/srtm_spatial_extent_ok1.png?w=600" alt=""   /></a><p class="wp-caption-text">GeoRaster spatial extent ok</p></div>
</div>
<p>As you can see, the extent of the raster is represented as a polygon in SDO_GEOMETRY format. For me, looks complicated&#8230; If you want to know more about the meaning of all fields of the SDO_GEOMETRY object, you can check it <a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28400/sdo_objrelschema.htm#i1004087">here</a>.</p>
<p>What is the reason of keeping a representation format so complicated? Ok, it could be my impression. After all, I&#8217;m new in this world. Anyway, I started a <a href="http://postgis.refractions.net/pipermail/postgis-devel/2010-August/009951.html">thread </a>on PostGIS devel list, asking for this. One important topic that came up in conversation is Oracle has a <a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28399/toc.htm">topological storage model</a>. But if you want to work with this model, you must use the SDO_TOPO package. And there&#8217;s probably no one tool able to work with this model, apart from Oracle itself, of course.</p>
<p>Take into account, in this particular case, the SDO_GEORASTER table is composed of 4 objects, because we had 4 GeoTIFF files. So, the extent is calculated for each object, not for the whole coverage. If we want only one object, we should:</p>
<ul>
<li>Merge the files before loading them.</li>
<li>Use <a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28398/geor_ref.htm#CACCIGJA"><em>SDO_GEOR.mergeLayers</em></a></li>
</ul>
<p>But, honestly, I didn&#8217;t try these solutions yet.</p>
<p>The last thing we have to do with raster data is&#8230; create and index. As we can read in <a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28398/geor_operations.htm#CIHEHBJB">Oracle GeoRaster developer&#8217;s guide, section 3.7</a>, &#8220;the most important index you can create on a GeoRaster object is a spatial index on the spatial extent (footprint) geometry of the GeoRaster object&#8221;. And we need to take one more thing into account&#8230; According to the <a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28400/sdo_objindex.htm#i78196">documentation (chapter 18)</a>, one of the prerequisites for creating an spatial index over a geometry column is &#8220;The USER_SDO_GEOM_METADATA view must contain an entry with the dimensions and coordinate boundary information for the table column to be spatially indexed&#8221;. And again, in the <a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28400/sdo_objrelschema.htm#i1001937">documentation (chapter 2, section 2.8)</a>: &#8220;Spatial users are responsible for populating these views. For each spatial column, you must insert an appropriate row into the USER_SDO_GEOM_METADATA view. Oracle Spatial ensures that the ALL_SDO_GEOM_METADATA view is also updated to reflect the rows that you insert into USER_SDO_GEOM_METADATA.&#8221; .</p>
<p>So, let&#8217;s do it:</p>
<pre>DELETE FROM user_sdo_geom_metadata WHERE table_name = 'spain_images' AND 
column_name = 'IMAGE.SPATIALEXTENT';
INSERT INTO user_sdo_geom_metadata VALUES ('spain_images', 'IMAGE.SPATIALEXTENT', 
SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', -180, 180, .00000005),
SDO_DIM_ELEMENT('Y', -90, 90, .00000005)), 4326);
DROP INDEX spain_images_sidx;
CREATE INDEX spain_images_sidx ON spain_images(image.spatialExtent) INDEXTYPE IS mdsys.spatial_index;</pre>
<p>&nbsp;</p>
<p>Once done, our raster data is ready to work.</p>
<p><span style="color:#ff0000;">And WKT Raster?</span>: All things we&#8217;ve done to load our raster data in Oracle GeoRaster and create an index, can be done in PostGIS WKT Raster by executing these two lines:</p>
<pre>&gt; gdal2wktraster.py" -r C:\orcl_tut\*.tif -t spain_images -s 4326 -k 50x50 -I 
-o C:\orcl_tut\srtm.sql
&gt; psql -d tutorial01 -f C:\orcl_tut\srtm.sql</pre>
<p>&nbsp;<br />
Of course, you need to install all the PostGIS stuff. You have an useful tutorial on how to do this <a href="http://blog.geoprocessamento.net/2010/07/postgis-wkt-raster/">here</a> (in Portuguese, but I think it&#8217;s easy to follow. If you find it difficult, you can read <a href="http://trac.osgeo.org/postgis/wiki/WKTRaster/Documentation01">WKT Raster documentation</a> or ask in the <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users">PostGIS users list</a>.</p>
<p>So far, I find too difficult the simple operation of loading GeoTIFF data in Oracle GeoRaster, comparing it with the same operation done with PostGIS WKT Raster. Of course you can always ask in <a href="http://forums.oracle.com/forums/forum.jspa?forumID=76&amp;start=0">Oracle Spatial forum</a> (register required). The questions I&#8217;ve asked were quickly answered. Really great people in these forums.</p>
<p>Another important difference between both extensions are the indexes. Oracle GeoRaster creates spatial indexes over the footprint of raster data, and WKT Raster creates GiST indexes over the raster data itself. Just a newbie guessing: as far as I know, the operations you can do with raster data itself in Oracle GeoRaster are rather limited. Spatial operations, like intersections, can only be done with the MBR of the data, so, that&#8217;s the reason the indexes are created over the footprint. On the other hand, in PostGIS WKT Raster, you can do really heavy operations with raster data, like <a href="http://postgis.refractions.net/documentation/manual-svn/RT_ST_DumpAsPolygons.html">ST_DumpAsPolygons</a>. Then, create an index over these raster data has more sense.</p>
<p>And if you want to interact with real raster data in Oracle GeoRaster? You can use the <a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28398/geor_operations.htm#CIHIICDF">functionalities </a>provided by SDO_GEOR package or directly <em>attack </em>the data blobs, using <em><a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_lob.htm#BABDDFDH">DBMS_LOB </a></em><a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_lob.htm#BABDDFDH">package</a>. But this last option is a <em>blind</em> attack over raw binary data.</p>
<p>About the spatial extent of the raster data, in WKT Raster the spatial extent of a raster is calculated during the loading process, using GDAL provided raster dimensions, and calculating the georeferenced coordinates for the upper and lower corners. But in this case, the spatial extent of the raster is the enclosing geometry in its model space coordinate system. In Oracle GeoRaster, this is not necessarily in this way. Better idea? Worse idea? Honestly, I don&#8217;t know. An expert may surely provide and smarter point than mine. Reference: <a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28398/geor_operations.htm#CIHGGAIG">Oracle Georaster Developer&#8217;s Guide, section 3.6</a></p>
<h3>Making buffers around the caribou points</h3>
<p>Next step is to make 1km buffers around the caribou points, and reproject our buffers to WGS84, as our raster coverage. We&#8217;ll later use the buffers as sampling window for calculating statistics over an area of the GeoRaster data using <em>SDO_GEOR.generateStatistics. </em>We use a sampling window with Oracle GeoRaster because we can&#8217;t intersect vector and raster data. The closer operation is the one performed by <em>SDO_GEOR.generateStatistics</em>, or <em>SDO_GEOR.subset</em>. This is, select a window to clip an area of the raster and get statistics or raster data over this area.</p>
<p><span style="color:#ff0000;">Problem:</span> The cariboupoints table doesn&#8217;t have a valid SRID. I forgot to specify it when dumping the table from PostGIS. We can set the SRID now:</p>
<div id="attachment_366" class="wp-caption aligncenter" style="width: 478px"><a href="http://gis4free.files.wordpress.com/2010/08/cariboupoints_update.png"><img class="size-full wp-image-366" title="Cariboupoints table update" src="http://gis4free.files.wordpress.com/2010/08/cariboupoints_update.png?w=600" alt=""   /></a><p class="wp-caption-text">Cariboupoints table update</p></div>
<p>We have to update the metadata too:</p>
<div id="attachment_367" class="wp-caption aligncenter" style="width: 652px"><a href="http://gis4free.files.wordpress.com/2010/08/cariboupoints_metadata_update.png"><img class="size-full wp-image-367" title="Cariboupoints metadata update" src="http://gis4free.files.wordpress.com/2010/08/cariboupoints_metadata_update.png?w=600" alt=""   /></a><p class="wp-caption-text">Cariboupoints metadata update</p></div>
<p><span style="color:#ff0000;">Problem:</span> As we can read in <em><a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28398/geor_ref.htm#CHEDCICI">SDO_GEOR.generateStatistics </a></em><a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28398/geor_ref.htm#CHEDCICI">documentation</a>, the sampling window must be <strong>rectangular</strong>, so, we can&#8217;t create round buffers around the cariboupoints. My solution: use the MBR of the buffers as sampling window.</p>
<div id="attachment_393" class="wp-caption aligncenter" style="width: 710px"><a href="http://gis4free.files.wordpress.com/2010/08/buffers_with_mbr.png"><img class="size-full wp-image-393" title="Round buffers with MBR" src="http://gis4free.files.wordpress.com/2010/08/buffers_with_mbr.png?w=600" alt=""   /></a><p class="wp-caption-text">Round buffers with MBR</p></div>
<p>This is the SQL code for creating the table with rectangular buffers around cariboupoints elements:</p>
<pre>create table cariboupoint_buffers_wgs AS
select <a href="http://t.id/" target="_blank">t.id</a>, sdo_geom.sdo_mbr(sdo_geom.sdo_buffer(sdo_cs.transform(t.geom,
4326), 1000, 1)) geom
from cariboupoints t;</pre>
<p>&nbsp;<br />
Now, we create an index over the polygons:</p>
<pre>DELETE FROM user_sdo_geom_metadata WHERE table_name = 'cariboupoint_buffers_wgs' AND 
column_name = 'geom';
INSERT INTO user_sdo_geom_metadata VALUES ('cariboupoints_buffers_wgs', 'geom', 
SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', -180, 180, .00000005),
SDO_DIM_ELEMENT('Y', -90, 90, .00000005)), 4326);
DROP INDEX spain_images_sidx;
CREATE INDEX cariboupoints_buffers_wgs_gidx ON cariboupoints_buffers_wgs(geom) 
INDEXTYPE IS mdsys.spatial_index;</pre>
<p>&nbsp;<br />
<span style="color:#ff0000;">And in PostGIS?</span>: As in Oracle Spatial, when you create a new table, you can create a GiST index over the spatial column (or a R-Tree index, but <a href="http://postgis.refractions.net/docs/ch04.html#id2794434">GiST indexes are recommended</a>). However, I think the process in PostGIS is simpler: you only have to create the table and then the index.  In Oracle, you first have to update the metadata view, as seen. And you need to know not only the srid of your spatial data (easy to get) but the dimensions limits, and provide a <em><a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28400/sdo_intro.htm#i884589">tolerance</a></em>, one concept you doesn&#8217;t need to necesarily know in Oracle&#8217;s context.</p>
<p>Let&#8217;s continue. Now, we show in OpenJump 2 layers:</p>
<ul>
<li>One layer with the extent of our rasters (we can&#8217;t polygonize them with Oracle GeoRaster, like in <a href="http://postgis.refractions.net/documentation/manual-svn/RT_ST_DumpAsPolygons.html">PostGIS WKT Raster</a>). SRID 4326.</li>
<li>One layer with 1 KM rectangular buffers around cariboupoints. srid 4326.</li>
</ul>
<div id="attachment_392" class="wp-caption aligncenter" style="width: 710px"><a href="http://gis4free.files.wordpress.com/2010/08/buffers_and_spatial_extent.png"><img class="size-full wp-image-392" title="Rectangular Buffers and spatial extent of the raster data" src="http://gis4free.files.wordpress.com/2010/08/buffers_and_spatial_extent.png?w=600" alt=""   /></a><p class="wp-caption-text">Rectangular Buffers and spatial extent of the raster data</p></div>
<p>Closer screenshot</p>
<div id="attachment_396" class="wp-caption aligncenter" style="width: 710px"><a href="http://gis4free.files.wordpress.com/2010/08/intersections2.png"><img class="size-full wp-image-396" title="Extents with intersections (closer)" src="http://gis4free.files.wordpress.com/2010/08/intersections2.png?w=600" alt=""   /></a><p class="wp-caption-text">Extents with intersections (closer)</p></div>
<h3>Intersecting the caribou buffers with the elevation rasters</h3>
<p><span style="color:#ff0000;">Big Problem</span>: As said,<strong> you can&#8217;t intersect vector raster data with Oracle Database</strong>. Oracle Spatial has some <a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28400/sdo_operat.htm#i76448">spatial operators</a>, and a <a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28400/sdo_objgeom.htm#i865398">geometry package</a>, and you can perform some spatial operations. But Oracle GeoRaster doesn&#8217;t have this capability.</p>
<p>The solution adopted was to:</p>
<ol>
<li>Calculate what are the buffers that intersects the spatialExtent of the GeoRaster objects.</li>
<li>Using these buffers as sampling windows, generate statistics for each pair buffer-georaster object, and store these statistics in a table</li>
<li>Using the statistics generated, calculate the weighted mean elevation of the raster areas delimited by the buffers, and store the results in another table.</li>
</ol>
<p>We can see these 3 steps in the next piece of PL/SQL code:</p>
<pre style="padding-left:30px;">declare
cellCoordinate mdsys.sdo_geometry;
ret varchar2(256);
generated_statistics sdo_number_array;
gr sdo_georaster;
begin</pre>
<pre style="padding-left:30px;">-- create statistics table
create table srtm_caribou_inter_statistics (
id number, -- buffer id
rid number,
statistics sdo_number_array
);</pre>
<pre style="padding-left:30px;">-- Intersects spatial extent of the rasters with the buffers
for intersection in
(select <a href="http://t.id/" target="_blank"><span style="color:#000000;">t.id</span></a>, t.geom, r.image_id as rid from spain_images r,
cariboupoint_buffers_wgs t
where sdo_geom.sdo_intersection(r.image.spatialExtent, t.geom, 0.005)
is not null)</pre>
<pre style="padding-left:30px;">loop
-- Get georaster image
select image into gr from spain_images where image_id
= intersection.rid for update;</pre>
<pre style="padding-left:30px;">-- First, we need geom coordinates in raster space coordinates
sdo_geor.getCellCoordinate(gr, 0, intersection.geom,
cellCoordinate);</pre>
<pre style="padding-left:30px;">-- Generate statistics for a given georaster object
ret := sdo_geor.generateStatistics(gr,
'samplingFactor=1', cellCoordinate, 'FALSE', '1-1', 'TRUE', NULL,
'TRUE');</pre>
<pre style="padding-left:30px;">-- update object
update spain_images r set r.image = gr where
r.image_id = intersection.rid;</pre>
<pre style="padding-left:30px;">-- commit changes
commit;</pre>
<pre style="padding-left:30px;">-- get generated statistics
generated_statistics := sdo_geor.getStatistics(gr, 1);</pre>
<pre style="padding-left:30px;">-- insert them in statistics table
insert into srtm_caribou_inter_statistics(id, rid, statistics) values
(<a href="http://intersection.id/" target="_blank"><span style="color:#000000;">intersection.id</span></a>, intersection.rid, generated_statistics);</pre>
<pre style="padding-left:30px;">end loop;
commit;
end;
/</pre>
<p>&nbsp;<br />
The code can be improved, as Jeffrey Xie suggested in <a href="http://forums.oracle.com/forums/thread.jspa?threadID=1121361&amp;tstart=0">this post</a>, by using the result of the intersection operation as sampling window.  Anyway, this code runs very fasts. Less than 2 minutes. Only 212 buffers of the 814 intersects with the raster extents. Here, we can see a screenshot of the raster data and the intersecting buffers only (212). We can compare it with the previous OpenJUMP screenshot, with all the points (814).</p>
<div id="attachment_395" class="wp-caption aligncenter" style="width: 710px"><a href="http://gis4free.files.wordpress.com/2010/08/intersections1.png"><img class="size-full wp-image-395" title="Extents with intersections" src="http://gis4free.files.wordpress.com/2010/08/intersections1.png?w=600" alt=""   /></a><p class="wp-caption-text">Extents with intersections</p></div>
<p><span style="color:#ff0000;">And WKT Raster?</span>: In WKT Raster we can create round buffers, and really<a href="http://postgis.refractions.net/documentation/manual-svn/RT_ST_Intersection.html"> intersects these polygons with the raster data</a>. But the intersection is much slower, for 2 reasons:</p>
<ol>
<li>To really intersects vector and raster data (NOT vector with raster MBRs), we have to polygonize the raster, and then intersects these polygons with the vector data. This is a really heavy operation. In Oracle, you only check intersection betweem MBR, and only 212 of the 814 buffers intersect with the raster</li>
<li>The sampling windows used in Oracle GeoRaster for intersection are rectangular. The buffers intersected with the raster data in WKT Raster are not rectangular.</li>
</ol>
<h3>Summarizing the elevation values for each buffer and exporting the table to CSV</h3>
<p>As Pierre did, our last step is to compute the weighted mean elevation raster.  We&#8217;ll do in four steps:</p>
<ul>
<li> Create a table to store the mean elevation data. The SQL code is:
<pre>create table means_table(id number, rid number, mean number)</pre>
</li>
<li>Fill the table. We have a problem here, because the varray field (the statistics obtained by SDO_GEOR.generateStatistics) must be cast to a nested table to access its fields, like we can read <a href="http://forums.oracle.com/forums/thread.jspa?threadID=358862">here</a>. The PL/SQL code to do this is:</li>
</ul>
<pre style="text-align:justify;padding-left:60px;">declare</pre>
<pre style="text-align:justify;padding-left:90px;">st_array sdo_number_array;</pre>
<pre style="text-align:justify;padding-left:90px;">sql_stmt varchar(256);</pre>
<pre style="text-align:justify;padding-left:60px;">begin</pre>
<pre style="padding-left:90px;">for c1 in (select * from srtm_caribou_inter_statistics) loop</pre>
<pre style="padding-left:120px;">for i in c1.stats_array.FIRST..c1.stats_array.LAST loop¡</pre>
<pre style="padding-left:150px;">if i = 3 then</pre>
<p style="padding-left:60px;">
<pre style="padding-left:180px;">sql_stmt := 'insert into means_table values (:1, :2, :3)';</pre>
<pre style="padding-left:180px;">execute immediate sql_stmt using <a href="http://c1.id" target="_blank"><span style="color:#000000;">c1.id</span></a>, c1.rid, c1.stats_array(i);</pre>
<pre style="padding-left:150px;">end if;</pre>
<pre style="padding-left:120px;">end loop;</pre>
<pre style="padding-left:90px;">end loop;</pre>
<pre style="padding-left:90px;">commit;</pre>
<pre style="text-align:justify;padding-left:60px;">end;</pre>
<p>&nbsp;</p>
<ul>
<li>Generate mean elevation data, by this query:</li>
</ul>
<ul style="padding-left:60px;"></ul>
<pre style="padding-left:60px;">select <a href="http://m.id" target="_blank">m.id</a>, m.mean*sdo_geom.sdo_area(sdo_cs.transform(cpb.geom,
32198), 1)  / sdo_geom.sdo_area(sdo_cs.transform(cpb.geom, 32198), 1)
as meanelev from means_table m, cariboupoint_buffers_wgs cpb where <a href="http://cpb.id" target="_blank">cpb.id</a> = <a href="http://m.id" target="_blank">m.id</a>;</pre>
<p>&nbsp;</p>
<ul>
<li>Export the data to a CSV file. We need more PL/SQL for this. In <a href="http://pandazen.wordpress.com/2008/02/01/export-oracle-query-result-to-csv/">this page</a> there is an excellent method to dump query results in a csv file.</li>
</ul>
<ul style="padding-left:60px;"></ul>
<h3>Conclussions</h3>
<p>With Oracle GeoRaster you can do a basic raster/vector overlay analysis: compute pixel value statistics on areas delimited by vector polygons. But, in my opinion, it&#8217;s a hard task, because of non-intuitive tools and operations, and the fact Oracle GeoRaster wasn&#8217;t thought for spatial analysis, but mainly for raster data storage. And even using it for raster data storage, I think it&#8217;s a bit difficult. On the other hand, with PostGIS WKT Raster, you can perform this kind of operations in an easier and more intuitive way, at least for a non-experienced user, like me. </p>
<p>Next post: comparing the <em>ideal</em> raster-on-database support with both extensions: Oracle GeoRaster and PostGIS WKT Raster</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gis4free.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gis4free.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gis4free.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gis4free.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gis4free.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gis4free.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gis4free.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gis4free.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gis4free.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gis4free.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gis4free.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gis4free.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gis4free.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gis4free.wordpress.com/343/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=343&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gis4free.wordpress.com/2010/09/01/oracle-georaster-part-ii/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15a5354814d778a1cdf5b9c5699f791d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gis4free</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/08/pgsql2shp.png" medium="image">
			<media:title type="html">Dumping cariboupoints table</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/08/shp2sdo_2.png" medium="image">
			<media:title type="html">Transforming cariboupoints SHP to SDO format</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/08/openjump_1.png" medium="image">
			<media:title type="html">Viewing cariboupoints table from Oracle in OpenJUMP</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/08/srtm_spatial_extent_ok1.png" medium="image">
			<media:title type="html">GeoRaster spatial extent ok</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/08/cariboupoints_update.png" medium="image">
			<media:title type="html">Cariboupoints table update</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/08/cariboupoints_metadata_update.png" medium="image">
			<media:title type="html">Cariboupoints metadata update</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/08/buffers_with_mbr.png" medium="image">
			<media:title type="html">Round buffers with MBR</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/08/buffers_and_spatial_extent.png" medium="image">
			<media:title type="html">Rectangular Buffers and spatial extent of the raster data</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/08/intersections2.png" medium="image">
			<media:title type="html">Extents with intersections (closer)</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/08/intersections1.png" medium="image">
			<media:title type="html">Extents with intersections</media:title>
		</media:content>
	</item>
		<item>
		<title>Comparing Oracle GeoRaster with PostGIS WKT Raster (I)</title>
		<link>http://gis4free.wordpress.com/2010/07/19/oracle-georaster-part-i/</link>
		<comments>http://gis4free.wordpress.com/2010/07/19/oracle-georaster-part-i/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 21:39:33 +0000</pubDate>
		<dc:creator>jorgearevalo</dc:creator>
				<category><![CDATA[PostGIS Raster]]></category>

		<guid isPermaLink="false">http://gis4free.wordpress.com/?p=184</guid>
		<description><![CDATA[UPDATE 2010-08-08: I&#8217;ve rewritten this post, with more interesting stuff. Pierre Racine wrote an excellent tutorial on PostGIS WKT Raster working with raster and vector data. As I&#8217;m involved in the development of WKT Raster extension, I&#8217;d like to know about similar solutions. The closest one is Oracle GeoRaster [PDF], in the sense is a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=184&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>UPDATE 2010-08-08: I&#8217;ve rewritten this post, with more interesting stuff.</p>
<p>Pierre Racine wrote an <a href="http://trac.osgeo.org/postgis/wiki/WKTRasterTutorial01">excellent tutorial on PostGIS WKT Raster working with raster and vector data</a>. As I&#8217;m involved in the development of WKT Raster extension, I&#8217;d like to know about similar solutions. The closest one is <a href="http://www.oracle.com/technology/products/spatial/pdf/11gr2_collateral/spatial11gr2_georaster_twp.pdf">Oracle GeoRaster [PDF]</a>, in the sense is a raster-on-database solution.</p>
<p>I thought: &#8220;Could I repit the Pierre&#8217;s tutorial with Oracle GeoRaster? would it be easier, harder?&#8221;. Now, my impressions:</p>
<ul>
<li>My machine: Intel Core 2 Duo 3 GHz, 3 GB RAM</li>
<li>My Operating System: Windows XP SP3</li>
<li>My Oracle version: Oracle Database 11g Release 1 Enterprise Edition (11.1.0.6.0)</li>
</ul>
<h3><strong>PREVIOUS STEPS</strong></h3>
<p>First step: Install <a href="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html">Oracle Database</a></p>
<p><span style="color:#ff0000;">Problem:</span> After installing the software in my machine, it takes a loooooong time to start. Ok, Oracle Database Enterprise is a really powerful software, and is thought for lots of things PostGIS WKT Raster isn&#8217;t. It&#8217;s only for people simply looking for a raster-in-database solution, this one could be as using a sledgehammer to crack a nut. Only first impression.</p>
<p><span style="color:#ff0000;">And WKT Raster?:</span> The installation of PostgreSQL + PostGIS + WKT Raster is much lighter than the installation of Oracle Database 11g Enterprise. But Oracle Database has more components. We can&#8217;t compare both things. The point is, if you only need a raster-on-database solution, WKT Raster is a lighter one.</p>
<p>Now, we&#8217;re going to create a new user. We execute a command shell and open SQL*Plus as sysdba (using  sys user):</p>
<pre>sqlplus sys/password as sysdba</pre>
<p>Once identified, execute:</p>
<pre>create user jorge identified by jorgejorgedefault tablespace users quota unlimited on</pre>
<pre>users temporary tablespace temp; grant create session to jorge;</pre>
<p>When we create a new user, a new schema is automatically created, to store all the stuff generated by the new user. In this case, the schema is created in the <em>users</em> tablespace. We need to ensure the new user has the <em>create session</em> privilege granted, to start session in the Oracle backend.</p>
<p>Next step, grant the new user enough privileges to create and manage tables. The easy way:</p>
<pre>grant all privileges to jorge</pre>
<p>Now, let&#8217;s see how to load shapefiles into Oracle Database.</p>
<h3><strong>LOAD SHAPEFILES INTO ORACLE DATABASE USING ORACLE SPATIAL</strong></h3>
<p><span style="color:#ff0000;">Problem: </span>To import shapefiles into an Oracle Database, you must convert them to SDO format using Oracle Shapefile Converter.</p>
<p><span style="color:#ff0000;">And PostGIS?: </span> The <a href="http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf">ESRI Shapefile Format [PDF]</a> is the format accepted by the <a href="http://postgis.refractions.net/docs/ch04.html#shp2pgsql_usage">PostGIS loader</a>. So, you have to transform your data to this format if you want to use it, just like Oracle&#8217;s case. In both cases, instead of official loader you can use <a href="http://www.gdal.org/ogr2ogr.html">ogr2ogr</a> to directly load the data into the database.</p>
<p>Download Oracle Shapefile Converter <a href="http://www.oracle.com/technology/software/products/spatial/htdocs/xplatformsoft.html">here</a>. The last version is from 2005, and the examples of the <a href="http://www.oracle.com/technology/software/products/spatial/files/text_files/using_shp2sdo.txt">README </a>file were made using Oracle 9, but still work. I converted a shapefile of the Ibiza island (in Spain) to SDO format. Here, the line:</p>
<div>
<div id="attachment_287" class="wp-caption aligncenter" style="width: 655px"><a href="http://gis4free.files.wordpress.com/2010/07/shp2sdo.png"><img class="size-full wp-image-287" title="shp2sdo" src="http://gis4free.files.wordpress.com/2010/07/shp2sdo.png?w=600" alt=""   /></a><p class="wp-caption-text">Oracle Shapefile Loader</p></div>
</div>
<p>The shapefile is in UTM system, SRID 23030. You can find the x and y bounds <a href="http://spatialreference.org/ref/epsg/23030">here</a>. As result, shp2sdo generates 2 files:</p>
<div>
<ul>
<li>SQL file: With the Ibiza&#8217;s table and the metadata</li>
<li>CTL file: With the data and control sentences for SQL*Loader</li>
</ul>
</div>
<p>Time to load the SDO file in database. We use SQL*Loader:</p>
<div id="attachment_288" class="wp-caption aligncenter" style="width: 475px"><a href="http://gis4free.files.wordpress.com/2010/07/sqlplus.png"><img class="size-full wp-image-288" title="sqlplus" src="http://gis4free.files.wordpress.com/2010/07/sqlplus.png?w=600" alt=""   /></a><p class="wp-caption-text">SQL*Plus loading file</p></div>
<div id="attachment_289" class="wp-caption aligncenter" style="width: 523px"><a href="http://gis4free.files.wordpress.com/2010/07/sqlldr.png"><img class="size-full wp-image-289" title="sqlldr" src="http://gis4free.files.wordpress.com/2010/07/sqlldr.png?w=600" alt=""   /></a><p class="wp-caption-text">SQL*LDR loading control file</p></div>
<p>We now have a new table created: <em>IBIZA_COVERAGE:</em></p>
<div id="attachment_290" class="wp-caption aligncenter" style="width: 288px"><a href="http://gis4free.files.wordpress.com/2010/07/shapefile_loaded.png"><img class="size-full wp-image-290" title="shapefile_loaded" src="http://gis4free.files.wordpress.com/2010/07/shapefile_loaded.png?w=600" alt=""   /></a><p class="wp-caption-text">Shapefile loaded in Oracle</p></div>
<p>Now, let&#8217;s work with raster data</p>
<h3><strong>LOAD RASTER DATA INTO ORACLE DATABASE USING ORACLE GEORASTER</strong></h3>
<p>We&#8217;ll need <a href="http://srtm.csi.cgiar.org/SELECTION/inputCoord.asp">raster data</a>. I&#8217;ve downloaded GeoTIFF files from Spain and Canary Island, by selecting them in the map. 6 files: <a href="ftp://srtm.csi.cgiar.org/SRTM_V41/SRTM_Data_GeoTiff/srtm_35_04.zip">srtm_35_04.tif</a>, <a href="ftp://srtm.csi.cgiar.org/SRTM_V41/SRTM_Data_GeoTiff/srtm_35_05.zip">srtm_35_05.tif</a>, <a href="ftp://srtm.csi.cgiar.org/SRTM_V41/SRTM_Data_GeoTiff/srtm_36_04.zip">srtm_36_04.tif</a>, <a href="ftp://srtm.csi.cgiar.org/SRTM_V41/SRTM_Data_GeoTiff/srtm_36_05.zip">srtm_36_05.tif</a>, <a href="ftp://srtm.csi.cgiar.org/SRTM_V41/SRTM_Data_GeoTiff/srtm_33_07.zip">srtm_33_07.tif</a>, <a href="ftp://srtm.csi.cgiar.org/SRTM_V41/SRTM_Data_GeoTiff/srtm_34_07.zip">srtm_34_07.tif</a>.</p>
<p><span style="color:#ff0000;">Problem:</span> The GeoRaster loader does not support source raster files in BSQ interleaving, and it might raise memory errors if the files are too big (how much is &#8220;too big&#8221;?). To avoid this problems, the Oracle GeoRaster developers guide recommends <a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28398/geor_operations.htm#CHDIGEHG">reformat and reblock the images</a> using <em><a href="http://www.gdal.org/gdal_translate.html">gdal_translate</a>:</em></p>
<pre>gdal_translate -of GTiff -co “TFW=YES” -co “INTERLEAVE=PIXEL” -co “TILED=YES”
image.tif image_new.tif</pre>
<p>This line creates a stripped <em>image_new.tif</em> file based in the original <em>image.tif</em>, but with pixel interleaving. After applying this filter to the six images,  they&#8217;re ready for loading in Oracle GeoRaster.</p>
<p><span style="color:#ff0000;">And WKT Raster?</span> The storage used for bands in WKT Raster is BSQ, but you don&#8217;t have to take care of the band interleaving of the raster you want to load. As the loader is based in GDAL, GDAL takes care of this.</p>
<p><span style="color:#ff0000;">Problem:</span> We need to first create the tables to store the raster data. These data are stored as a relationship between two tables. One table stores the metadata, and another one stores the raster data itself. And you need two tables for each raster you want to store. The software doesn&#8217;t provide an automatic tool to perform the <em>create-needed-tables-and-load-data</em> operation in one step.</p>
<p><span style="color:#ff0000;">And WKT Raster?</span> The loader creates the needed tables, the indexes (if specified in command line options) and store the data in them. To be honest, the loader generates a SQL file that you can load on Postgres, and makes all the stuff. Anyway, is easier.</p>
<p>Let&#8217;s create the needed tables to store the downloaded GeoTIFF images of Spain:</p>
<pre>CREATE TABLE spain_images (image_id NUMBER PRIMARY KEY,
image_description VARCHAR2(50), image SDO_GEORASTER);</pre>
<pre>CREATE TABLE spain_images_rdt OF SDO_RASTER
(PRIMARY KEY (rasterID, pyramidLevel, bandBlockNumber, rowBlockNumber, columnBlockNumber))
TABLESPACE users LOB(rasterBlock) STORE AS SECUREFILE lobseg (NOCACHE);</pre>
<p>Two important things to remark here:</p>
<ul>
<li>We&#8217;re using <em>LOB secure files</em> storage schema. See <em><a href="http://www.oracle.com/pls/db112/to_toc?pathname=appdev.112%2Fe10645%2Ftoc.htm&amp;remark=portal+%28Books%29">Oracle Database SecureFiles and Large Objects Developer&#8217;s Guide</a></em> and <em><a href="http://www.oracle.com/pls/db112/to_toc?pathname=server.112%2Fe10592%2Ftoc.htm&amp;remark=portal+%28Books%29">Oracle Database SQL Language Reference</a></em> for further information on this topic.</li>
<li>When we create the primary key for this table, a B-Tree index over data table is automatically created. PostGIS WKT Raster creates a GiST index for the same purpose.</li>
</ul>
<p>Once tables have been created, we have three options for loading the raster data:</p>
<ul>
<li>Use the PL/SQL loader</li>
<li>Use the Java loader</li>
<li>Use the Java-based GeoRaster visualizator.</li>
</ul>
<p><span style="color:#ff0000;">Problem</span>: The two last options require to download and install the <a href="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/111060-win32soft-099267.html">Oracle Database 11g examples</a>. About 500MB to download. Again, this <em>using a sledgehammer to crack a nut </em>impression.</p>
<p><span style="color:#ff0000;">And WKT Raster?</span> When you install the WKT Raster extension on a PostGIS-enabled database, you have all you need. Even some test code. Again, Oracle Database Enterprise is much bigger. So, you can&#8217;t compare both solutions in this sense.</p>
<p>Anoter important issue: One important advantage of WKT Raster over Oracle GeoRaster is the georeferencing approach. In case of non-rectangular raster coverages, this is particularly clear. Better to see with this two images:</p>
<div id="attachment_339" class="wp-caption aligncenter" style="width: 575px"><a href="http://gis4free.files.wordpress.com/2010/07/oracle_georaster_approach.png"><img class="size-full wp-image-339" title="Oracle GeoRaster approach" src="http://gis4free.files.wordpress.com/2010/07/oracle_georaster_approach.png?w=600" alt=""   /></a><p class="wp-caption-text">Oracle GeoRaster approach</p></div>
<div id="attachment_340" class="wp-caption aligncenter" style="width: 572px"><a href="http://gis4free.files.wordpress.com/2010/07/postgis_wktraster_approach.png"><img class="size-full wp-image-340" title="PostGIS WKT Raster approach" src="http://gis4free.files.wordpress.com/2010/07/postgis_wktraster_approach.png?w=600" alt=""   /></a><p class="wp-caption-text">PostGIS WKT Raster approach</p></div>
<p>That basically means that Oracle GeoRaster requires one raster data table for each raster data file loaded, if these raster files are from an irregular raster coverage. PostGIS WKT Raster allows only one table for all kinds of raster coverages. Regular or not. You can get further information in the <a href="http://postgis.refractions.net/documentation/manual-svn/RT_FAQ.html#id3095635">WKT Raster FAQ</a></p>
<h4>Load raster data using PL/SQL loader</h4>
<p>The first step is to grant permissions to our user and to MDSYS for reading the file we want to load, using a Java-based program.</p>
<pre>call dbms_java.grant_permission(‘JORGE’, ‘SYS:java.io.FilePermission’,
‘C:\orcl_tut\image_new.tif’, ‘read’);</pre>
<pre>call dbms_java.grant_permission(‘MDSYS’, ‘SYS:java.io.FilePermission’,
‘C:\orcl_tut\image_new.tif’, ‘read’);</pre>
<p>We repit the same operation with the rest of the files. Then, we can load the images, using a little PL/SQL code.  Here, a real executed piece of code:</p>
<pre>DECLARE
geor SDO_GEORASTER;</pre>
<pre>BEGIN</pre>
<pre>-- Initialize an empty GeoRaster object into which the external image</pre>
<pre>-- is to be imported.</pre>
<pre>INSERT INTO spain_images</pre>
<pre>values( 1, 'Spain_TIFF_1', sdo_geor.init('spain_images_rdt') );</pre>
<pre>-- Import the TIFF image.</pre>
<pre>SELECT image INTO geor FROM spain_images</pre>
<pre>WHERE image_id = 1 FOR UPDATE;</pre>
<pre>sdo_geor.importFrom(geor, 'blocksize=(256,256)', 'TIFF', 'file', 'C:\orcl_tut\srtm_35_04_new.tif');</pre>
<pre>UPDATE spain_images SET image = geor WHERE image_id = 1;
END;</pre>
<p>You have to repit the same insert-select-update cycle for all the images you want to load. Is striking you first have to insert an empty value in the data table, and then call a PL/SQL procedure to store the data in it.</p>
<p><span style="color:#ff0000;">Problem:</span> There are only a few<a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28398/geor_ref.htm#CHECBJCD"> image formats accepted.</a> Only TIFF, GIF, PNG, BMP and GeoTIFF. JPEG is not supported by this method, but you can use <a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28398/geor_intro.htm#CHDHHFHJ">Java loader</a> for importing JPEG images.</p>
<p><span style="color:#ff0000;">And WKT Raster?</span> The raster formats allowed for loading are the ones allowed for your version of GDAL. You can check the GDAL accepted raster formats <a href="http://www.gdal.org/formats_list.html">here</a>. Anyway, for sure you can use more than six formats with a default installation of GDAL.</p>
<p>Now, you have all your images loaded into database. We can use the <em>validategeoraster</em> procedure to ensure the information is correctly stored:</p>
<div id="attachment_291" class="wp-caption aligncenter" style="width: 658px"><a href="http://gis4free.files.wordpress.com/2010/07/georaster_tables_count.png"><img class="size-full wp-image-291" title="georaster_tables_count" src="http://gis4free.files.wordpress.com/2010/07/georaster_tables_count.png?w=600" alt=""   /></a><p class="wp-caption-text">GeoRaster data correctly loaded</p></div>
<h4>Load raster data using Java loader</h4>
<p>If you want to use the Java loader, you need to download the database examples from <a href="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/111060-win32soft-099267.html">Oracle site</a>. Take care of downloading the file that matchs your database version. Once installed, you&#8217;ll see a new <em>md/demo </em>folder inside your %ORACLE_HOME% directory ($ORACLE_HOME in Linux. This variable is set during Oracle Database installation). In that folder, there&#8217;s a lot of examples of all the technologies present in Oracle Database Enterprise. We are interested in the <em>Georaster</em> folder.</p>
<div id="attachment_292" class="wp-caption aligncenter" style="width: 254px"><a href="http://gis4free.files.wordpress.com/2010/07/georaster_examples.png"><img class="size-full wp-image-292" title="georaster_examples" src="http://gis4free.files.wordpress.com/2010/07/georaster_examples.png?w=600" alt=""   /></a><p class="wp-caption-text">GeoRaster examples folders</p></div>
<p>Inside this <em>Georaster</em> folder, there are two more folders:</p>
<ul>
<li>plsql: Some pieces of PL/SQL code to create GeoRaster tables, delete them, modify them, insert values, etc. Simple examples, resembling the code above.</li>
<li>java: here you hava the image loader, the image exporter and the image viewer. There&#8217;s a <em>README </em>file, explaining how to use them.</li>
</ul>
<p>To execute the java code, we first have to add some jar files to the CLASSPATH enviroment variable:</p>
<pre>CLASSPATH=%CLASSPATH%;%ORACLE_HOME%/ord/jlib/jai_codec.jar;%ORACLE_HOME%/ord/jlib/jai_core.jar;
%ORACLE_HOME%/jdbc/lib/ojdbc5.jar;%ORACLE_HOME%/rdbms/jlib/xdb.jar;%ORACLE_HOME%/lib/xmlparserv2.jar;
%ORACLE_HOME%/lib/xmlcomp.jar;%ORACLE_HOME%/lib/xschema.jar;%ORACLE_HOME%/jlib/jewt4.jar;
%ORACLE_HOME%/md/jlib/sdoapi.jar;%ORACLE_HOME%/md/jlib/sdoutl.jar;
%ORACLE_HOME%/md/demo/georaster/java/georaster_tools.jar</pre>
<p>Additionally, we&#8217;ll add <em><a href="http://sourceforge.net/projects/xtiff-jai/files/">xtiff-jai.jar</a></em> and <em><a href="http://sourceforge.net/projects/geotiff-jai/files/">geotiff-jai.jar</a></em>, because we want to load and export GeoTIFF images. We download these files, put them into a folder, and add the path to that folder to the CLASSPATH enviroment variable.</p>
<p><span style="color:#ff0000;">Problem</span>: In the README file, the JDBC driver is referred as <em>ojdbc14.jar</em>, and old version. But the driver available with this installation of Oracle is the newer <em>ojdbc5.jar</em>. An error caused by copy&amp;paste of an older version of <em>README</em>, I guess.</p>
<p>Now, we can execute the loader with one of the files:</p>
<pre>java oracle.spatial.georaster.tools.GeoRasterLoader localhost orcl 1521 jorge <em>mypassword </em>
thin 32 T images image "blocking=true,blockSize=(256,256),geotiff=true,srid=4326"
"srtm_34_05_new.tif,1,rdt1,srtm_34_05_new.tfw,4326"</pre>
<p>Remember we blocked the image with <em>gdal_translate.</em> And the SRID of the files can be fetched with <em><a href="http://www.gdal.org/gdalinfo.html">gdalinfo</a></em>. The image formats accepted are the same than with PL/SQL loader plus JPEG and JP2.</p>
<p><span style="color:#ff0000;">Problem</span>: This happened when loading with PL/SQL, but in this case, I find it even less intuitive. If you want to add raster data, you first have to create an empty entry in data table, and then provide the name of this table and the id of the new record to the Java loader (in the example, the raster data table is <em>rdt1</em>, and the id is <em>1</em>).</p>
<p><span style="color:#ff0000;">And WKT Raster?</span> As said, the whole process of create needed tables and insert data, can be performed in one step with WKT Raster. Much simpler.</p>
<p>So, before calling the loader, you&#8217;ll have to execute an INSERT sentence like this:</p>
<pre>INSERT INTO images
values( 1, sdo_geor.init('image', 1) );</pre>
<p>The important thing here is you can provide an id to <em><a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28398/geor_ref.htm#CHEBCACB">sdo_geor.init</a></em> procedure, and this will be the id you&#8217;ll have to use with the new image when calling the loader. If you don&#8217;t provide an id number as second argument of <em>sdo_geor.init</em> procedure, the system will choose the first free one. Write it down, to use it when calling the loader. Not very clear, in my opinion.</p>
<p><span style="color:#ff0000;">Minor problem: </span>There is a parameter, the eighth one, that has always the same value: <em>T </em>(interpreted as <em>true</em>, according with documentation). I suppose it&#8217;ll be used in future releases, or it will be deleted.</p>
<h4>Load raster data using GeoRaster visualizator</h4>
<p>The GeoRaster visualizator is a program written in Java that allows to load, view and export GeoRaster data. You can execute the visualizator by running the script <em>startGeoRasterViewer.bat</em> (or <em>startGeoRasterViewer.sh</em> if you&#8217;re in a UNIX enviroment).</p>
<p><span style="color:#ff0000;">Problem: </span>The Windows script (<em>startGeoRasterViewer.bat</em>) has 1 error. I had to fix it manually: At the beggining of the script, there&#8217;s a <em>goto</em> sentence that drives the code to an unexsistent tag (<em>gotHome</em>). The correct tag is <em>moreCheck2.</em></p>
<p>Now, we can execute the script file and load the GeoRaster viewer. As we can see, the images can be loaded from a disk file or retrieved from database.</p>
<div id="attachment_293" class="wp-caption aligncenter" style="width: 710px"><a href="http://gis4free.files.wordpress.com/2010/07/georaster_viewer2.png"><img class="size-full wp-image-293" title="georaster_viewer2" src="http://gis4free.files.wordpress.com/2010/07/georaster_viewer2.png?w=600" alt=""   /></a><p class="wp-caption-text">GeoRaster viewer</p></div>
<p>We are interesting in fetching images from database, so, we provide our credentials. The viewer loads the GeoRaster data found in our schema. Here, a screenshot</p>
<div id="attachment_296" class="wp-caption aligncenter" style="width: 710px"><a href="http://gis4free.files.wordpress.com/2010/07/georaster_viewer3.png"><img class="size-full wp-image-296" title="georaster_viewer3" src="http://gis4free.files.wordpress.com/2010/07/georaster_viewer3.png?w=600" alt=""   /></a><p class="wp-caption-text">GeoRaster viewer showing tables</p></div>
<p>In the menu bar, the third button from the right is the loading button. If we push it, a dialog will ask us for needed data, as host name, port number, database name, user name, password (yes, again). It will ask for the table and column name where we want to load our data. And for the raster id and the raster data table&#8230;</p>
<div id="attachment_297" class="wp-caption aligncenter" style="width: 510px"><a href="http://gis4free.files.wordpress.com/2010/07/georaster_viewer_importing1.png"><img class="size-full wp-image-297" title="georaster_viewer_importing1" src="http://gis4free.files.wordpress.com/2010/07/georaster_viewer_importing1.png?w=600" alt=""   /></a><p class="wp-caption-text">GeoRaster viewer importing</p></div>
<p><span style="color:#ff0000;">Problem:</span> As happened when using java loader, you first have to create a new entry in raster data table by calling <em>sdo_geor.init</em> PL/SQL procedure, and be careful with raster id. Not very intuitive.</p>
<h3>VIEW RASTER DATA FROM ORACLE GEORASTER</h3>
<p>To view the raster data loaded into the database, you can use GeoRaster viewer. Of course you can use any other tools that allow connection with Oracle, but I want to know which tools are provided during a common installation of Oracle Database.</p>
<p><span style="color:#ff0000;">Problem:</span> There are two things I don&#8217;t like about GeoRaster viewer:</p>
<ul>
<li>In README file states that Oracle GeoRaster provides, among others, the following feature: &#8220;supporting box selection on the GeoRaster object in the image panel, and allowing user to export  the selected window to the image file in the local file system&#8221;.  Well, I can&#8217;t find the way of doing it. It&#8217;s possible, when you export data, to specify init and end row and column, but not to directly select parts of the image in the viewer.</li>
<li>There&#8217;s a <em>None</em> option in the menu <em>Image</em> that seems to be a kind of  <em>undo</em> option, but I&#8217;m not sure.  A bit confusing option. See the screenshot:</li>
</ul>
<div id="attachment_298" class="wp-caption aligncenter" style="width: 710px"><a href="http://gis4free.files.wordpress.com/2010/07/georaster_viewer_strange_option.png"><img class="size-full wp-image-298" title="georaster_viewer_strange_option" src="http://gis4free.files.wordpress.com/2010/07/georaster_viewer_strange_option.png?w=600" alt=""   /></a><p class="wp-caption-text">GeoRaster viewer &quot;None&quot; option</p></div>
<p>Apart from this, the viewer is an acceptably useful tool for doing some basic operations on rasters</p>
<p><span style="color:#ff0000;">And WKT Raster?</span> WKT Raster doesn&#8217;t have a GUI, or a visualizator distributed packed with the code. Using <a href="http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html">GDAL WKT Raster driver</a> (basic version right now, read only. It&#8217;s in my TODO list) you can connect WKT Raster with any program that uses GDAL for raster reading, but honestly, I haven&#8217;t tested it. It&#8217;s planned to work in this point.</p>
<h3>EXPORT RASTER DATA FROM ORACLE GEORASTER</h3>
<p>Again, we have three ways of exporting data from Oracle GeoRaster:</p>
<ul>
<li>Using PL/SQL exporter</li>
<li>Using Java-based exporter</li>
<li>Using Java GeoRaster viewer</li>
</ul>
<h4>Export raster data using PL/SQL exporter</h4>
<p>As in the importing option, the first step is, as sysdba, grant permissions to our user, and to MDSYS. Write permissions, this time:</p>
<pre>call dbms_java.grant_permission(‘JORGE’, ‘SYS:java.io.FilePermission’,
‘C:\orcl_tut\export\fichero.tif’, ‘write’);</pre>
<pre>call dbms_java.grant_permission(‘MDSYS’, ‘SYS:java.io.FilePermission’,
‘C:\orcl_tut\export\fichero.tif’, ‘write’);</pre>
<p>Now, a bit of real PL/SQL again:</p>
<pre>DECLARE</pre>
<pre>geor SDO_GEORASTER;</pre>
<pre>BEGIN</pre>
<p><span style="color:#000000;"> </span></p>
<pre>SELECT image INTO geor FROM spain_images WHERE image_id = 1;</pre>
<p><span style="color:#000000;"> </span></p>
<pre>-- Export the whole GeoRaster object into a GeoTIFF file.</pre>
<pre>sdo_geor.exportTo(geor,NULL, 'GeoTIFF', 'file',</pre>
<pre>'C:\orcl_tut\export\image_exported_by_plsql');</pre>
<pre>END;</pre>
<p><span style="color:#ff0000;">Problem:</span> Formats accepted for image exporting using this method are only TIFF, BMP, GeoTiff or PNG. If you want JPEG or GIF, you have to use the Java exporter.</p>
<p><span style="color:#ff0000;">And WKT Raster?</span> As for reading, the formats allowed for writting are GDAL-dependent. You can use <a href="http://www.gdal.org/gdal_translate.html">gdal_translate</a> for exporting data, but as I&#8217;ve said, the GDAL WKT Raster driver is still a basic one. Needs more work and testing. Apart from this, there are <a href="http://trac.osgeo.org/postgis/wiki/WKTRaster/SpecificationWorking01#Objective0.1.6f-BeingabletoreturnaJPEGaTIFForaPNG.">JPEG and TIFF</a> exporters planned, internally builded, not GDAL dependent.</p>
<p><span style="font-family:Arial, sans-serif;font-size:small;">Executing this code, we get&#8230;</span></p>
<div id="attachment_299" class="wp-caption aligncenter" style="width: 654px"><a href="http://gis4free.files.wordpress.com/2010/07/georaster_export_plsql_error1.png"><img class="size-full wp-image-299" title="georaster_export_plsql_error1" src="http://gis4free.files.wordpress.com/2010/07/georaster_export_plsql_error1.png?w=600" alt=""   /></a><p class="wp-caption-text">GeoRaster exporting error with PL/SQL</p></div>
<p>&#8230; yes, a memory error.</p>
<p><span style="color:#ff0000;">Problem:</span> In the <em>Oracle GeoRaster developers guide</em>, we <a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28398/geor_ref.htm#CHEDHBII">read </a>that &#8220;The maximum amount of GeoRaster data that can be exported in a single operation is 67 megabytes&#8221;. Our raster data are greater than this (files of 75MB). But the most strange thing is during the import operation we didn&#8217;t have that problem.</p>
<p><span style="color:#ff0000;">And WKT Raster?</span> The export size limits are determined by the file format itself, and the operating system/file system capabilities. This is, again, a GDAL issue. WKT Raster itself doesn&#8217;t impose a limitation. Further information <a href="http://www.gdal.org/formats_list.html">here</a>.</p>
<p>Ok, we can export only a fragment of the data. Using the viewer, we get init and end row and column, to see a significative part of our files. Let&#8217;s try it again, this time with the <em>cropArea</em> option:</p>
<pre>DECLARE</pre>
<pre>geor SDO_GEORASTER;</pre>
<pre>BEGIN</pre>
<p><span style="color:#000000;"> </span></p>
<pre>SELECT image INTO geor FROM spain_images WHERE image_id = 1;</pre>
<p><span style="color:#000000;"> </span></p>
<pre>-- Export the whole GeoRaster object into a GeoTIFF file.</pre>
<pre>sdo_geor.exportTo(geor, ’cropArea=(2024,951,2831,1663)’, 'GeoTIFF', 'file',</pre>
<pre>'C:\orcl_tut\export\image_exported_by_plsql’);</pre>
<pre>END;</pre>
<p>The file name without extension. Now the export operation finishes. Here, the result:</p>
<div id="attachment_300" class="wp-caption aligncenter" style="width: 710px"><a href="http://gis4free.files.wordpress.com/2010/07/georaster_export_plsql_result.png"><img class="size-full wp-image-300" title="georaster_export_plsql_result" src="http://gis4free.files.wordpress.com/2010/07/georaster_export_plsql_result.png?w=600" alt=""   /></a><p class="wp-caption-text">GeoRaster image exported with PL/SQL</p></div>
<p>I personally think  this is a severe limitation. Are 67 MB too much megabytes for Oracle GeoRaster?, why?</p>
<h4>Export raster data using Java-based exporter</h4>
<p>The Java exporter works in a similar way than the Java importer.</p>
<p><span style="color:#ff0000;">Problem</span>: We have to provide some parameters, like raster data table and raster id, that could be not very intuitive. We have to remember the raster data table name and the raster id we used when loading the data if we want to export the data loaded from the original files.</p>
<p><span style="color:#ff0000;">And WKT Raster?</span> As said, for data exporting, you use gdal_translate. Not well tested yet. But the needed options are clearly explained <a href="http://www.gdal.org/gdal_translate.html">here</a></p>
<p><span style="color:#ff0000;">Minor problem:</span> In the README file, by the way, there is a minor typo when explaining the exporter calling method. There&#8217;s a repeated parameter in parameter list. Not very important, but it should be fixed in next releases.</p>
<p>Then, the instruction to export one of the raster previously imported is:</p>
<pre>java oracle.spatial.georaster.tools.GeoRasterExporter localhost 1521 user password thin
32 T images image "1,rdt1" "GEOTIFF" "export_file.tif"</pre>
<p>This time, the file name with extension, not like in the PL/SQL example. The formats accepted are the same than with the Java importer: TIFF, GeoTIFF, JPEG, BMP, GIF, PNG and JP2. After executing this line, we get&#8230;</p>
<div id="attachment_301" class="wp-caption aligncenter" style="width: 653px"><a href="http://gis4free.files.wordpress.com/2010/07/georaster_exporter_memory_error.png"><img class="size-full wp-image-301" title="georaster_exporter_memory_error" src="http://gis4free.files.wordpress.com/2010/07/georaster_exporter_memory_error.png?w=600" alt=""   /></a><p class="wp-caption-text">GeoRaster Java exporter memory error</p></div>
<p>&#8230; yes, a memory error again.</p>
<p><span style="color:#ff0000;">Problem:</span> The raster is too big to be exported. The maximum size is, again, 67 MB. And we didn&#8217;t have this problem while loading with the Java importer.</p>
<p>But this time, we have another solution, to get the whole raster exported, instead of using the <em>cropArea</em> method: the Java VM <em>-Xmx</em> option.</p>
<div id="attachment_302" class="wp-caption aligncenter" style="width: 653px"><a href="http://gis4free.files.wordpress.com/2010/07/georaster_exporter.png"><img class="size-full wp-image-302" title="georaster_exporter" src="http://gis4free.files.wordpress.com/2010/07/georaster_exporter.png?w=600" alt=""   /></a><p class="wp-caption-text">GeoRaster Java exporter ok with more heap memory</p></div>
<p>Then, if we increase the maximum heap size for our Java VM, we can get the whole raster data. I think it shouldn&#8217;t be necessary. I didn&#8217;t find these limitations working with GDAL and PostGIS WKT Raster.</p>
<h4>Export raster data using Java GeoRaster viewer</h4>
<p>Finally, we can export our data by using the Java GeoRaster Viewer. In the screenshot, the menu options available for doing this operation are marked in red</p>
<div id="attachment_303" class="wp-caption aligncenter" style="width: 710px"><a href="http://gis4free.files.wordpress.com/2010/07/georaster_viewer_exporting.png"><img class="size-full wp-image-303" title="georaster_viewer_exporting" src="http://gis4free.files.wordpress.com/2010/07/georaster_viewer_exporting.png?w=600" alt=""   /></a><p class="wp-caption-text">GeorRaster viewer exporting</p></div>
<p>Then, we provide some basic parameters (see screenshot)</p>
<div id="attachment_304" class="wp-caption aligncenter" style="width: 510px"><a href="http://gis4free.files.wordpress.com/2010/07/georaster_exporter_menu.png"><img class="size-full wp-image-304" title="georaster_exporter_menu" src="http://gis4free.files.wordpress.com/2010/07/georaster_exporter_menu.png?w=600" alt=""   /></a><p class="wp-caption-text">GeoRaster viewer exporting parameters</p></div>
<p><span style="color:#ff0000;">Problem</span>: If we choose GeoTIFF as format, we don&#8217;t need a World File. The program should inform about this, because while importing with the GeoRaster viewer, we have such option.</p>
<p>Ok, we accept the options and then&#8230;</p>
<p><span style="color:#ff0000;">Big problem: </span>Yes, memory problem again. But the thing is the program doesn&#8217;t inform us about this problem. Actually, says the data were exported correctly! And the file has not been exported. I think this is an important problem, and must be fixed. See screenshot</p>
<div id="attachment_305" class="wp-caption aligncenter" style="width: 710px"><a href="http://gis4free.files.wordpress.com/2010/07/georaster_export_java_error.png"><img class="size-full wp-image-305" title="georaster_export_java_error" src="http://gis4free.files.wordpress.com/2010/07/georaster_export_java_error.png?w=600" alt=""   /></a><p class="wp-caption-text">GeoRaster viewer exporting error</p></div>
<p>In case of selecting any different format from GeoTIFF, and tell the viewer to generate a World File, it&#8217;s correctly generated, but the image file, as we&#8217;ve seen, doesn&#8217;t. The parameters of the World File are generated using scientific notation, but are correct.</p>
<p>Of course, we can execute the GeoRaster viewer using <em>-Xmx</em> parameter, or export only an area of the raster, but I think this is not a good solution.</p>
<h3>CONCLUSSIONS:</h3>
<p>With Oracle GeoRaster, you can have a basic <em>raster-in-database</em> support, but I&#8217;m surprised to find bugs, important limitations and non-intuitive tools in an extension of a commercial software like this. Problems that, in most cases, WKT Raster has solved, or never suffered from them.</p>
<p>The Oracle GeoRaster project seems to be something left since 2007. Next days, I&#8217;m going to delve into the tool, comparing its functionality with PostGIS WKT Raster, following the <a href="http://trac.osgeo.org/postgis/wiki/WKTRasterTutorial01">Pierre&#8217;s tutorial</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gis4free.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gis4free.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gis4free.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gis4free.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gis4free.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gis4free.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gis4free.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gis4free.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gis4free.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gis4free.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gis4free.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gis4free.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gis4free.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gis4free.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gis4free.wordpress.com&amp;blog=13838197&amp;post=184&amp;subd=gis4free&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gis4free.wordpress.com/2010/07/19/oracle-georaster-part-i/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/15a5354814d778a1cdf5b9c5699f791d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gis4free</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/shp2sdo.png" medium="image">
			<media:title type="html">shp2sdo</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/sqlplus.png" medium="image">
			<media:title type="html">sqlplus</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/sqlldr.png" medium="image">
			<media:title type="html">sqlldr</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/shapefile_loaded.png" medium="image">
			<media:title type="html">shapefile_loaded</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/oracle_georaster_approach.png" medium="image">
			<media:title type="html">Oracle GeoRaster approach</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/postgis_wktraster_approach.png" medium="image">
			<media:title type="html">PostGIS WKT Raster approach</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/georaster_tables_count.png" medium="image">
			<media:title type="html">georaster_tables_count</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/georaster_examples.png" medium="image">
			<media:title type="html">georaster_examples</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/georaster_viewer2.png" medium="image">
			<media:title type="html">georaster_viewer2</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/georaster_viewer3.png" medium="image">
			<media:title type="html">georaster_viewer3</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/georaster_viewer_importing1.png" medium="image">
			<media:title type="html">georaster_viewer_importing1</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/georaster_viewer_strange_option.png" medium="image">
			<media:title type="html">georaster_viewer_strange_option</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/georaster_export_plsql_error1.png" medium="image">
			<media:title type="html">georaster_export_plsql_error1</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/georaster_export_plsql_result.png" medium="image">
			<media:title type="html">georaster_export_plsql_result</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/georaster_exporter_memory_error.png" medium="image">
			<media:title type="html">georaster_exporter_memory_error</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/georaster_exporter.png" medium="image">
			<media:title type="html">georaster_exporter</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/georaster_viewer_exporting.png" medium="image">
			<media:title type="html">georaster_viewer_exporting</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/georaster_exporter_menu.png" medium="image">
			<media:title type="html">georaster_exporter_menu</media:title>
		</media:content>

		<media:content url="http://gis4free.files.wordpress.com/2010/07/georaster_export_java_error.png" medium="image">
			<media:title type="html">georaster_export_java_error</media:title>
		</media:content>
	</item>
	</channel>
</rss>
