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

<channel>
	<title>iphone and gis development notes &#187; GIS</title>
	<atom:link href="http:///wordpress/category/gis-general/feed/" rel="self" type="application/rss+xml" />
	<link>/wordpress</link>
	<description>By Rupert</description>
	<lastBuildDate>Sun, 29 Aug 2010 22:44:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Postgres PostGIS CheatSheet v2</title>
		<link>/wordpress/2008/08/postgres-postgis-cheatsheet-v2/</link>
		<comments>/wordpress/2008/08/postgres-postgis-cheatsheet-v2/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 05:10:32 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[postgis]]></category>
		<category><![CDATA[postgres]]></category>

		<guid isPermaLink="false">/wordpress/?p=229</guid>
		<description><![CDATA[This is a quick-command list of Postres. If you want detailed instructions, please visit the Postgres Manual. How do I Show all databases? 1. Using &#8220;psql -l&#8221; 2. Using postgres=# \l List of databases Name &#124; Owner &#124; Encoding ------------------+----------+---------- postgis &#124; postgres &#124; UTF8 postgres &#124; postgres &#124; UTF8 template0 &#124; postgres &#124; UTF8]]></description>
			<content:encoded><![CDATA[<p>This is a quick-command list of Postres. If you want detailed instructions, please visit the Postgres Manual.</p>
<p><strong>How do I Show all databases? </strong><br />
1. Using &#8220;psql -l&#8221;</p>
<p>2. Using</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">postgres</span>=<span style="color: #666666; font-style: italic;"># \l</span>
List of databases
Name       <span style="color: #000000; font-weight: bold;">|</span>  Owner   <span style="color: #000000; font-weight: bold;">|</span> Encoding
------------------+----------+----------
postgis          <span style="color: #000000; font-weight: bold;">|</span> postgres <span style="color: #000000; font-weight: bold;">|</span> UTF8
postgres         <span style="color: #000000; font-weight: bold;">|</span> postgres <span style="color: #000000; font-weight: bold;">|</span> UTF8
template0        <span style="color: #000000; font-weight: bold;">|</span> postgres <span style="color: #000000; font-weight: bold;">|</span> UTF8
template1        <span style="color: #000000; font-weight: bold;">|</span> postgres <span style="color: #000000; font-weight: bold;">|</span> UTF8
template_postgis <span style="color: #000000; font-weight: bold;">|</span> postgres <span style="color: #000000; font-weight: bold;">|</span> UTF8
<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">5</span> rows<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Note: Do not drop template databases if not necessary.</p>
<p><strong>How do I run a script from the prompt?</strong><br />
<code>psql -d cybersoftbj -u user -f myfile.sql</code></p>
<p>Its very useful in reloading user-defined functions.</p>
<p><strong>How do I create a user/role?</strong><br />
<code><br />
CREATE ROLE lbs WITH LOGIN PASSWORD 'mypassword' SUPERUSER INHERIT CREATEDB CREATEROLE;<br />
</code></p>
<p><strong>How do I change the password for a user/role?</strong><br />
<code><br />
ALTER ROLE lbs PASSWORD 'mynewpassword';<br />
</code></p>
<p><strong>How to provide/restrict access privileges to tables?</strong><br />
<code><br />
GRANT SELECT ON TABLE table TO user;<br />
REVOKE SELECT ON TABLE table FROM user;<br />
</code></p>
<p><strong>How to dump database in a text file?</strong><br />
<code><br />
pg_dump -U lbs -d cybersoftbjv1 -h 127.0.0.1 -W &gt; cybersoftbjv1.sql<br />
</code></p>
<p><strong>How to dump database cleanly?</strong><br />
<code><br />
pg_dump -c  -d -E UTF8 -h 127.0.0.1 -U lbs -W platform_v1 &gt; platform_v1.sql<br />
</code></p>
<p><strong>How to rename a database?</strong><br />
<code><br />
ALTER DATABASE beijing_app RENAME TO beijing_app_20080801;<br />
</code></p>
<p><strong>How to update using two tables?</strong><br />
<code><br />
UPDATE road_for_update u<br />
SET the_geom = r.the_geom<br />
FROM roads r<br />
WHERE r.rd_id = u.rd_id;<br />
</code></p>
<p><strong>How to change a column type with Cast?</strong><br />
<code><br />
ALTER TABLE roads ALTER COLUMN class_new TYPE integer USING class_new::integer;<br />
</code></p>
<p><strong>How to add a geometry column to a table?</strong><br />
EXAMPLE: SELECT AddGeometryColumn(&#8216;public&#8217;, &#8216;poi&#8217;, &#8216;the_geom&#8217;, 4326, &#8216;POINT&#8217;, 2)</p>
<p><strong>Changing column names with spaces?</strong><br />
<code>ALTER TABLE class_aroundme RENAME "level 1" TO level_1;</code> </p>
<p><strong>Setting kernel shmmax for postgres</strong><br />
<code>sysctl -w kernel.shmmax=134217728</code><br />
Note: For permanent changes see /etc/sysctl.cfg<strong>11. How to backup table(s) from pg_dump?</strong><br />
pg_dump poi_beijing -t class -t poi_class -f $BACKUPDIR/test_$MYDATE.sql</p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/08/postgres-postgis-cheatsheet-v2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using GDALWARP to reproject raster that will fit with Google Satellite</title>
		<link>/wordpress/2008/07/using-gdalwarp-to-reproject-raster-that-will-fit-with-google-satellite/</link>
		<comments>/wordpress/2008/07/using-gdalwarp-to-reproject-raster-that-will-fit-with-google-satellite/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 12:48:21 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[GDAL/OGR]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[maserver]]></category>
		<category><![CDATA[openlayers]]></category>
		<category><![CDATA[tilecache]]></category>

		<guid isPermaLink="false">/wordpress/?p=208</guid>
		<description><![CDATA[Just a couple of notes to onself using gdal: Use gdalwarp to reproject your GeoTIFF files! I wanted to use my own satellite images acquired from GeoEye, however, on some areas I wanted to use google sat images as well since I don&#8217;t have the coverage. In order to do so, I need to reproject]]></description>
			<content:encoded><![CDATA[<p>Just a couple of notes to onself using gdal: Use <em>gdalwarp</em> to reproject your GeoTIFF files! I wanted to use my own satellite images acquired from GeoEye, however, on some areas I wanted to use google sat images as well since I don&#8217;t have the coverage. In order to do so, I need to reproject the sat images to 900913. Note you need to specify this in your epsg file in my previous post.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rupert:beijing_900913_satellite rupert$ gdalinfo Mosaic_RGB.tif
Driver: GTiff<span style="color: #000000; font-weight: bold;">/</span>GeoTIFF
Files: Mosaic_RGB.tif
Size is <span style="color: #000000;">4248</span>, <span style="color: #000000;">4553</span>
Coordinate System is:
GEOGCS<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;WGS 84&quot;</span>,
    DATUM<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;WGS_1984&quot;</span>,
        SPHEROID<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;WGS 84&quot;</span>,<span style="color: #000000;">6378137</span>,<span style="color: #000000;">298.2572235630016</span>,
            AUTHORITY<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;EPSG&quot;</span>,<span style="color: #ff0000;">&quot;7030&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,
        AUTHORITY<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;EPSG&quot;</span>,<span style="color: #ff0000;">&quot;6326&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,
    PRIMEM<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;Greenwich&quot;</span>,<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,
    UNIT<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;degree&quot;</span>,<span style="color: #000000;">0.0174532925199433</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,
    AUTHORITY<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;EPSG&quot;</span>,<span style="color: #ff0000;">&quot;4326&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
Origin = <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">116.291476140000000</span>,<span style="color: #000000;">40.025198500000002</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
Pixel Size = <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0.000046860000000</span>,-<span style="color: #000000;">0.000035970000000</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
Metadata:
  <span style="color: #007800;">AREA_OR_POINT</span>=Area
  <span style="color: #007800;">TIFFTAG_XRESOLUTION</span>=<span style="color: #000000;">100</span>
  <span style="color: #007800;">TIFFTAG_YRESOLUTION</span>=<span style="color: #000000;">100</span>
Image Structure Metadata:
  <span style="color: #007800;">INTERLEAVE</span>=BAND
Corner Coordinates:
Upper Left  <span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #000000;">116.2914761</span>,  <span style="color: #000000;">40.0251985</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>116d17<span style="color: #ff0000;">'29.31&quot;E, 40d 1'</span><span style="color: #000000;">30.71</span><span style="color: #ff0000;">&quot;N)
Lower Left  ( 116.2914761,  39.8614271) (116d17'29.31&quot;</span>E, 39d51<span style="color: #ff0000;">'41.14&quot;N)
Upper Right ( 116.4905374,  40.0251985) (116d29'</span><span style="color: #000000;">25.93</span><span style="color: #ff0000;">&quot;E, 40d 1'30.71&quot;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Lower Right <span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #000000;">116.4905374</span>,  <span style="color: #000000;">39.8614271</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>116d29<span style="color: #ff0000;">'25.93&quot;E, 39d51'</span><span style="color: #000000;">41.14</span><span style="color: #ff0000;">&quot;N)
Center      ( 116.3910068,  39.9433128) (116d23'27.62&quot;</span>E, 39d56<span style="color: #ff0000;">'35.93&quot;N)
Band 1 Block=4248x1 Type=Byte, ColorInterp=Red
Band 2 Block=4248x1 Type=Byte, ColorInterp=Green
Band 3 Block=4248x1 Type=Byte, ColorInterp=Blue</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rupert:beijing_900913_satellite rupert$ gdalwarp -s_srs epsg:<span style="color: #000000;">4326</span> -t_srs epsg:<span style="color: #000000;">900913</span> Mosaic_RGB.tif sat_4m_rgb.tif
Creating output <span style="color: #c20cb9; font-weight: bold;">file</span> that is 4245P x 4556L.
Processing input <span style="color: #c20cb9; font-weight: bold;">file</span> Mosaic_RGB.tif.
0...10...20...30...40...50...60...70...80...90...100 - done.</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rupert:beijing_900913_satellite rupert$ gdalinfo sat_4m_rgb.tif
Driver: GTiff<span style="color: #000000; font-weight: bold;">/</span>GeoTIFF
Files: sat_4m_rgb.tif
Size is <span style="color: #000000;">4245</span>, <span style="color: #000000;">4556</span>
Coordinate System is:
PROJCS<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;Google Maps Global Mercator&quot;</span>,
    GEOGCS<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;WGS 84&quot;</span>,
        DATUM<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;WGS_1984&quot;</span>,
            SPHEROID<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;WGS 84&quot;</span>,<span style="color: #000000;">6378137</span>,<span style="color: #000000;">298.2572235630016</span>,
                AUTHORITY<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;EPSG&quot;</span>,<span style="color: #ff0000;">&quot;7030&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,
            AUTHORITY<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;EPSG&quot;</span>,<span style="color: #ff0000;">&quot;6326&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,
        PRIMEM<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;Greenwich&quot;</span>,<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,
        UNIT<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;degree&quot;</span>,<span style="color: #000000;">0.0174532925199433</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,
        AUTHORITY<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;EPSG&quot;</span>,<span style="color: #ff0000;">&quot;4326&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,
    PROJECTION<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;Mercator_1SP&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,
    PARAMETER<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;central_meridian&quot;</span>,<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,
    PARAMETER<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;scale_factor&quot;</span>,<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,
    PARAMETER<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;false_easting&quot;</span>,<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,
    PARAMETER<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;false_northing&quot;</span>,<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,
    UNIT<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;metre&quot;</span>,<span style="color: #000000;">1</span>,
        AUTHORITY<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;EPSG&quot;</span>,<span style="color: #ff0000;">&quot;9001&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
Origin = <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">12945507.907502911984921</span>,<span style="color: #000000;">4869604.732793668285012</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
Pixel Size = <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">5.219801430503303</span>,-<span style="color: #000000;">5.219801430503303</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
Metadata:
  <span style="color: #007800;">AREA_OR_POINT</span>=Area
Image Structure Metadata:
  <span style="color: #007800;">INTERLEAVE</span>=PIXEL
Corner Coordinates:
Upper Left  <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">12945507.908</span>, <span style="color: #000000;">4869604.733</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>116d17<span style="color: #ff0000;">'29.31&quot;E, 40d12'</span><span style="color: #000000;">53.10</span><span style="color: #ff0000;">&quot;N)
Lower Left  (12945507.908, 4845823.317) (116d17'29.31&quot;</span>E, 40d <span style="color: #000000;">3</span><span style="color: #ff0000;">'2.78&quot;N)
Upper Right (12967665.965, 4869604.733) (116d29'</span><span style="color: #000000;">25.89</span><span style="color: #ff0000;">&quot;E, 40d12'53.10&quot;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Lower Right <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">12967665.965</span>, <span style="color: #000000;">4845823.317</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>116d29<span style="color: #ff0000;">'25.89&quot;E, 40d 3'</span><span style="color: #000000;">2.78</span><span style="color: #ff0000;">&quot;N)
Center      (12956586.936, 4857714.025) (116d23'27.60&quot;</span>E, 40d <span style="color: #000000;">7</span><span style="color: #ff0000;">'58.12&quot;N)
Band 1 Block=4245x1 Type=Byte, ColorInterp=Red
Band 2 Block=4245x1 Type=Byte, ColorInterp=Green
Band 3 Block=4245x1 Type=Byte, ColorInterp=Blue</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/07/using-gdalwarp-to-reproject-raster-that-will-fit-with-google-satellite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Mapserver on MacOSX (by source)</title>
		<link>/wordpress/2008/07/installing-mapserver-on-macosx-by-source/</link>
		<comments>/wordpress/2008/07/installing-mapserver-on-macosx-by-source/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 04:03:16 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[mapserver]]></category>
		<category><![CDATA[leopard]]></category>

		<guid isPermaLink="false">/wordpress/?p=195</guid>
		<description><![CDATA[Just noticed that William of kyngchaos has updated the mapserver binary for MacOSX. But right now, I need to tile these images bought from GeoEye, so I need TIFF support. Below is a summary of getting Mapserver installed by source. Note that I have the necessary GEOS, GDAL from kyngchaos as well from this ealier]]></description>
			<content:encoded><![CDATA[<p>Just noticed that <a href="http://www.kyngchaos.com/wiki/software:mapserver">William of kyngchaos has updated the mapserver binary</a> for MacOSX.</p>
<p>But right now, I need to tile these images bought from GeoEye, so I need TIFF support. Below is a summary of getting Mapserver installed by source. Note that I have the necessary GEOS, GDAL from kyngchaos as well from this ealier post.</p>
<p>1. Download the ff files:<br />
<code>-rw-r--r--@ 1 rupert  admin   564313 Jul 26 10:32 agg-2.5.tar.gz<br />
-rw-r--r--@ 1 rupert  admin  1345700 Jul 26 10:22 gd-2.0.35.tar.gz<br />
-rw-r--r--@ 1 rupert  admin   613261 Jul 26 10:22 jpegsrc.v6b.tar.gz<br />
-rw-r--r--@ 1 rupert  admin   796551 Jul 26 10:22 libpng-1.2.29.tar.gz<br />
-rw-r--r--@ 1 rupert  admin  1948751 Jul 26 09:55 mapserver-5.2.0.tar.gz<br />
-rw-r--r--@ 1 rupert  admin  1336295 Jul 26 11:11 tiff-3.8.2.tar.gz</code></p>
<p>2. Install in the ff order:</p>
<p>- <a href="http://www.sfr-fresh.com/unix/misc/jpegsrc.v6b.tar.gz">jpegsrc</a><br />
- <a href="http://libpng.sourceforge.net/">libpng</a><br />
- <a href="http://www.libgd.org/Downloads">gd</a> (if you have trouble installing gd, then follow this pdf:<a href='/wordpress/wp-content/uploads/2008/07/installing_gd2_on_os_x_server.pdf'>installing_gd2_on_os_x_server</a>)<br />
- <a href="http://www.antigrain.com/agg-2.5.tar.gz">agg</a> (<em>make</em> only)<br />
- <a href="http://www.libtiff.org/">tiff</a><br />
- mapserver</p>
<p>3. For mapserver, please install using the ff configure switches:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure \
<span style="color: #660033;">--with-agg</span>=<span style="color: #000000; font-weight: bold;">/</span>myhome<span style="color: #000000; font-weight: bold;">/</span>rupert<span style="color: #000000; font-weight: bold;">/</span>mapserver<span style="color: #000000; font-weight: bold;">/</span>agg-<span style="color: #000000;">2.5</span> \
<span style="color: #660033;">--with-jpeg</span> \
<span style="color: #660033;">--with-gd</span> \
<span style="color: #660033;">--with-freetype</span> \
<span style="color: #660033;">--with-png</span> \
<span style="color: #660033;">--with-ogr</span> \
<span style="color: #660033;">--with-proj</span> \
<span style="color: #660033;">--with-gd</span> \
<span style="color: #660033;">--with-httpd</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>httpd \
<span style="color: #660033;">--with-tiff</span> \
<span style="color: #660033;">--with-wfs</span> \
<span style="color: #660033;">--with-wcs</span> \
<span style="color: #660033;">--with-sos</span> \
<span style="color: #660033;">--with-wmsclient</span> \
<span style="color: #660033;">--with-wfsclient</span> \
<span style="color: #660033;">--with-tiff</span> \
<span style="color: #660033;">--with-gdal</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gdal<span style="color: #000000; font-weight: bold;">/</span>gdal-config \
<span style="color: #660033;">--with-geos</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>geos-config \
<span style="color: #660033;">--with-postgis</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>pgsql<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>pg_config</pre></div></div>

<p>4. Mapserver output</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rupert:mapserver-5.2.0 rupert$ .<span style="color: #000000; font-weight: bold;">/</span>mapserv <span style="color: #660033;">-v</span>
MapServer version 5.2.0 <span style="color: #007800;">OUTPUT</span>=GIF <span style="color: #007800;">OUTPUT</span>=PNG <span style="color: #007800;">OUTPUT</span>=JPEG <span style="color: #007800;">OUTPUT</span>=WBMP <span style="color: #007800;">OUTPUT</span>=SVG <span style="color: #007800;">SUPPORTS</span>=PROJ <span style="color: #007800;">SUPPORTS</span>=AGG <span style="color: #007800;">SUPPORTS</span>=FREETYPE <span style="color: #007800;">SUPPORTS</span>=ICONV <span style="color: #007800;">SUPPORTS</span>=WMS_SERVER <span style="color: #007800;">SUPPORTS</span>=WMS_CLIENT <span style="color: #007800;">SUPPORTS</span>=WFS_SERVER <span style="color: #007800;">SUPPORTS</span>=WFS_CLIENT <span style="color: #007800;">SUPPORTS</span>=WCS_SERVER <span style="color: #007800;">SUPPORTS</span>=SOS_SERVER <span style="color: #007800;">SUPPORTS</span>=GEOS <span style="color: #007800;">INPUT</span>=TIFF <span style="color: #007800;">INPUT</span>=EPPL7 <span style="color: #007800;">INPUT</span>=POSTGIS <span style="color: #007800;">INPUT</span>=OGR <span style="color: #007800;">INPUT</span>=GDAL <span style="color: #007800;">INPUT</span>=SHAPEFILE</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/07/installing-mapserver-on-macosx-by-source/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postgres PostGis PostInstall</title>
		<link>/wordpress/2008/06/postgres-postgis-postinstall/</link>
		<comments>/wordpress/2008/06/postgres-postgis-postinstall/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 23:34:36 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[postgis]]></category>
		<category><![CDATA[postgres]]></category>

		<guid isPermaLink="false">/wordpress/index.php/2008/06/07/postgres-postgis-postinstall/</guid>
		<description><![CDATA[1. Edit pg_hba.conf # &#34;local&#34; is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/32 md5 host all all 192.168.1.0 255.255.255.0 md5 # IPv6 local connections: #host all all ::1/128 trust 2. Edit postgres.conf 55 56 listen_addresses = '*' # what IP address(es) to listen on;]]></description>
			<content:encoded><![CDATA[<p>1. Edit pg_hba.conf</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># &quot;local&quot; is for Unix domain socket connections only</span>
<span style="color: #7a0874; font-weight: bold;">local</span>   all         all                               trust
<span style="color: #666666; font-style: italic;"># IPv4 local connections:</span>
host    all         all         127.0.0.1<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">32</span>          md5
host    all         all         192.168.1.0 255.255.255.0       md5
<span style="color: #666666; font-style: italic;"># IPv6 local connections:</span>
<span style="color: #666666; font-style: italic;">#host    all         all         ::1/128               trust</span></pre></div></div>

<p>2. Edit postgres.conf</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">55</span>
<span style="color: #000000;">56</span> listen_addresses = <span style="color: #ff0000;">'*'</span> <span style="color: #666666; font-style: italic;"># what IP address(es) to listen on;</span>
<span style="color: #000000;">57</span> <span style="color: #666666; font-style: italic;"># comma-separated list of addresses;</span>
<span style="color: #000000;">58</span> <span style="color: #666666; font-style: italic;"># defaults to 'localhost', '*' = all</span>
<span style="color: #000000;">59</span> <span style="color: #666666; font-style: italic;"># (change requires restart)</span></pre></div></div>

<p>4. For CentOS5.1, create symbolic links:<br />
  ln -s /usr/local/lib/libproj.so.0 /usr/lib/libproj.so.0<br />
  ln -s /usr/local/lib/libgeos_c.so.1 /usr/lib/libgeos_c.so.1<br />
  ldconfig<br />
  /etc/init.d/postgresql stop<br />
  /etc/init.d/postgresql start</p>
<p>3. Postgis Post Install</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">createdb <span style="color: #660033;">-E</span> utf8 template_routing
createlang plpgsql template_routing
psql <span style="color: #660033;">-d</span> template_routing <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>postgresql-<span style="color: #000000;">8.3</span>-postgis<span style="color: #000000; font-weight: bold;">/</span>lwpostgis.sql 
psql <span style="color: #660033;">-d</span> template_routing <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>postgresql-<span style="color: #000000;">8.3</span>-postgis<span style="color: #000000; font-weight: bold;">/</span>spatial_ref_sys.sql 
psql <span style="color: #660033;">-d</span> template_routing <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>postlbs<span style="color: #000000; font-weight: bold;">/</span>routing_core.sql 
psql <span style="color: #660033;">-d</span> template_routing <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>postlbs<span style="color: #000000; font-weight: bold;">/</span>routing_core_wrappers.sql</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/06/postgres-postgis-postinstall/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Postgresql, Postgis, pgRouting on Debian</title>
		<link>/wordpress/2008/05/installing-postgresql-postgis-pgrouting-on-debian/</link>
		<comments>/wordpress/2008/05/installing-postgresql-postgis-pgrouting-on-debian/#comments</comments>
		<pubDate>Sun, 25 May 2008 03:55:57 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[postgis]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[routing]]></category>
		<category><![CDATA[pgRouting]]></category>

		<guid isPermaLink="false">/wordpress/index.php/2008/05/25/installing-postgresql-postgis-pgrouting-on-debian/</guid>
		<description><![CDATA[Operating System: Debian sid Versions: postgres 8.3.1 postgis 1.3.3 pgRouting1.02 1. Install base system and ssh #vi /etc/apt/sources.list to include deb http://debian.cn99.com/debian etch main deb-src http://debian.cn99.com/debian etch main #apt-get update #apt-get upgrade libc6 2. Install the required packages for postgres8.3 and postgis1.3.3 #apt-get install sudo nmap telnet #apt-get install python2.5 python2.5-dev python-setuptools #apt-get install g++]]></description>
			<content:encoded><![CDATA[<p>Operating System: Debian sid</p>
<p>Versions:</p>
<ul>
<li>postgres 8.3.1</li>
<li>postgis 1.3.3</li>
<li>pgRouting1.02</li>
</ul>
<p>1. Install base system and ssh</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#vi /etc/apt/sources.list to include</span>
deb http:<span style="color: #000000; font-weight: bold;">//</span>debian.cn99.com<span style="color: #000000; font-weight: bold;">/</span>debian etch main
deb-src http:<span style="color: #000000; font-weight: bold;">//</span>debian.cn99.com<span style="color: #000000; font-weight: bold;">/</span>debian etch main
<span style="color: #666666; font-style: italic;">#apt-get update</span>
<span style="color: #666666; font-style: italic;">#apt-get upgrade libc6</span></pre></div></div>

<p>2. Install the required packages for postgres8.3 and postgis1.3.3</p>
<pre lang="bash" xml:lang="bash">
#apt-get install sudo nmap telnet
#apt-get install python2.5 python2.5-dev python-setuptools
#apt-get install g++
#apt-get install build-essential cmake ibboost-graph-dev
#apt-get install libreadline5 libreadline5-dev
#apt-get install zlib-bin zlib1g-dev
#apt-get install libkrb5-dev
#apt-get install libcurl3
#apt-get install libssl-dev
#apt-get install postgresql-8.3
#apt-get install postgresql-8.3-postgis
#apt-get install postgresql-server-dev-8.3
</pre>
<p>3. Installing pgRouting</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># tar -zxvf pgRouting-1.02.tgz</span>
<span style="color: #666666; font-style: italic;"># cmake .</span>
<span style="color: #666666; font-style: italic;"># make </span>
<span style="color: #666666; font-style: italic;"># make install</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/05/installing-postgresql-postgis-pgrouting-on-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jpeg decoder problem on TileCache on MacOSX Leopard</title>
		<link>/wordpress/2008/05/jpeg-decoder-problem-on-tilecache-on-macosx-leopard/</link>
		<comments>/wordpress/2008/05/jpeg-decoder-problem-on-tilecache-on-macosx-leopard/#comments</comments>
		<pubDate>Mon, 12 May 2008 09:26:07 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[tilecache]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">/wordpress/?p=184</guid>
		<description><![CDATA[There is a problem with a &#8220;jpeg decoder&#8221; because Python Imaging Library (PIL) cannot find the jpeg libraries. Remember that we installed kyngchaos UnixIO libraries, therefore the PIL setup.py script should point to use those libraries. Actually, I even installed the jpegsrc manually. I believe there is no need to do this, since UnixIO Image]]></description>
			<content:encoded><![CDATA[<p>There is a problem with a <em>&#8220;jpeg decoder&#8221;</em> because <a href="http://www.pythonware.com/products/pil/">Python Imaging Library (PIL)</a> cannot find the jpeg libraries. Remember that we installed <a href="http://www.kyngchaos.com/wiki/software:frameworks">kyngchaos UnixIO libraries</a>, therefore the PIL setup.py script should point to use those libraries. </p>
<p>Actually, I even installed the jpegsrc manually. I believe there is no need to do this, since UnixIO Image libraries is sufficient enough for PIL to install. What is important is to ensure that python tests succeeded. Once you get passed that, then installing PIL should work.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">1. Extract Imaging-1.1.6.tar.gz
2. Edit setup.py to reflect:
<span style="color: #007800;">JPEG_ROOT</span>=<span style="color: #ff0000;">&quot;/Library/Frameworks/UnixImageIO.framework/unix&quot;</span>
3. python setup.py build_ext <span style="color: #660033;">-i</span>
4. If no <span style="color: #7a0874; font-weight: bold;">test</span> fails, <span style="color: #000000; font-weight: bold;">then</span> go ahead and <span style="color: #c20cb9; font-weight: bold;">install</span>
5. python setup.py <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/05/jpeg-decoder-problem-on-tilecache-on-macosx-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Mapserver on MacOSX Leopard (the easy way)</title>
		<link>/wordpress/2008/05/installing-mapserver-on-macosx-leopard-the-easy-way/</link>
		<comments>/wordpress/2008/05/installing-mapserver-on-macosx-leopard-the-easy-way/#comments</comments>
		<pubDate>Tue, 06 May 2008 13:01:09 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[mapserver]]></category>
		<category><![CDATA[leopard]]></category>

		<guid isPermaLink="false">/wordpress/?p=178</guid>
		<description><![CDATA[The easiest way to install mapserver on your Leopard is by downloading and installing dmg files from www.kyngchaos.com (courtesy of William Kyngesburye). These binaries were also noted from Mapserver&#8217;s Download Page. 1. Download the ff binaries in order (please note the version numbers at the time of writing): 1. UnixImageIO_Framework-1.0.22a.dmg 2. FreeType_Framework-2.3.5-3.dmg 3. GEOS_Framework-3.0.0-2.dmg 4.]]></description>
			<content:encoded><![CDATA[<p>The easiest way to install mapserver on your Leopard is by downloading and installing dmg files from <a href="http://http://www.kyngchaos.com/wiki/software:mapserver">www.kyngchaos.com (courtesy of William Kyngesburye)</a>. These binaries were also noted from <a href="http://mapserver.gis.umn.edu/download/current">Mapserver&#8217;s Download Page.</a></p>
<p>1. Download the ff binaries in order (please note the version numbers at the time of writing):</p>
<p>1. <a href="http://www.kyngchaos.com/files/software/unixport/UnixImageIO_Framework-1.0.22a.dmg">UnixImageIO_Framework-1.0.22a.dmg</a><br />
2. <a href="http://www.kyngchaos.com/files/software/unixport/FreeType_Framework-2.3.5-3.dmg">FreeType_Framework-2.3.5-3.dmg</a><br />
3. <a href="http://www.kyngchaos.com/files/software/unixport/GEOS_Framework-3.0.0-2.dmg">GEOS_Framework-3.0.0-2.dmg</a><br />
4. <a href="http://www.kyngchaos.com/files/software/unixport/PROJ_Framework-4.6.0-1.dmg">PROJ_Framework-4.6.0-1.dmg</a><br />
5. <a href="http://www.kyngchaos.com/files/software/unixport/SQLite3_Framework-3.5.7-1.dmg">SQLite3_Framework-3.5.7-1.dmg</a><br />
6. <a href="http://www.kyngchaos.com/files/software/unixport/MapServer-5.0.2-2.dmg">MapServer-5.0.2-2.dmg</a></p>
<p>2. Once installed, you can copy the mapserv binaries to your apache cgi-bin</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>WebServer<span style="color: #000000; font-weight: bold;">/</span>CGI-Executables<span style="color: #000000; font-weight: bold;">/</span>mapserv <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>cgi-bin<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>3. Check the mapserv output</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rupert:~ rupert$ <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>cgi-bin<span style="color: #000000; font-weight: bold;">/</span>mapserv <span style="color: #660033;">-v</span>
MapServer version 5.0.2 <span style="color: #007800;">OUTPUT</span>=GIF <span style="color: #007800;">OUTPUT</span>=PNG <span style="color: #007800;">OUTPUT</span>=JPEG <span style="color: #007800;">OUTPUT</span>=WBMP <span style="color: #007800;">OUTPUT</span>=SWF <span style="color: #007800;">OUTPUT</span>=SVG <span style="color: #007800;">SUPPORTS</span>=PROJ <span style="color: #007800;">SUPPORTS</span>=AGG <span style="color: #007800;">SUPPORTS</span>=FREETYPE <span style="color: #007800;">SUPPORTS</span>=WMS_SERVER <span style="color: #007800;">SUPPORTS</span>=WMS_CLIENT <span style="color: #007800;">SUPPORTS</span>=WFS_SERVER <span style="color: #007800;">SUPPORTS</span>=WFS_CLIENT <span style="color: #007800;">SUPPORTS</span>=WCS_SERVER <span style="color: #007800;">SUPPORTS</span>=SOS_SERVER <span style="color: #007800;">SUPPORTS</span>=FASTCGI <span style="color: #007800;">SUPPORTS</span>=GEOS <span style="color: #007800;">INPUT</span>=EPPL7 <span style="color: #007800;">INPUT</span>=POSTGIS <span style="color: #007800;">INPUT</span>=OGR <span style="color: #007800;">INPUT</span>=GDAL <span style="color: #007800;">INPUT</span>=SHAPEFILE</pre></div></div>

<p>This is actually the first time I was able to install mapserver NOT BY SOURCE and still achieve the same binaries that I wanted (with AGG support). Full credit should be given to William.</p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/05/installing-mapserver-on-macosx-leopard-the-easy-way/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Interesting Location Technologies</title>
		<link>/wordpress/2008/04/interesting-location-technologies/</link>
		<comments>/wordpress/2008/04/interesting-location-technologies/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 02:32:46 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[routing]]></category>
		<category><![CDATA[lbs]]></category>

		<guid isPermaLink="false">/wordpress/?p=170</guid>
		<description><![CDATA[Been very busy for the past few days/weeks in the office. Just read this one from Google Reader, Nokia develops navigating system based on image recognition, landmarks. In summary, base from Nokia&#8217;s Palo Alto Research center, providing direction guiding varies from gender and culture. However, providing examples such as &#8220;Turn Right after the next gas]]></description>
			<content:encoded><![CDATA[<p>Been very busy for the past few days/weeks in the office. Just read this one from Google Reader, <a href="http://www.thestandard.com/news/2008/04/11/nokia-develops-navigating-system-based-image-recognition-landmarks">Nokia develops navigating system based on image recognition, landmarks</a>. In summary, base from <a href="http://research.nokia.com/locations/palo-alto/">Nokia&#8217;s Palo Alto Research center</a>, providing direction guiding varies from gender and culture. However, providing examples such as &#8220;<em>Turn Right after the next gas station</em>&#8221; seems to be a universal and a normal behavior of providing directions, the person can relate more to the advice than providing line routes above synthetic maps.</p>
<p><img class="alignleft size-medium wp-image-171" title="nokiascreen7-300x206" src="http://www.gisnotes.com/wordpress/wp-content/uploads/2008/04/nokiascreen7-300x206.jpg" alt="" width="300" height="206" /></p>
<p>This is interesting facts as it supports our theory in Call Center Directed Guiding. Although, a <a href="www.mapjack.com">360 or panoramic view</a> of any point along the line would be ideal, an easier and more realistic approach for the time being would be to include <strong>important landmark</strong> snapshots along the route.  However, I believe our organisation&#8217;s project is one step ahead since we have a warm body who already gave a summary of the route during the conversation. This means the caller have an idea of the route complexity beforehand.  Then, we could also send this landmark images to the subscriber&#8217;s mobile as his future reference (which means additional VAS).</p>
<p>Another interesting location technology, fruitful for direction guiding, would be <a href="http://www.i-spatialtech.com/iPointer.htm">iPointer</a>. I believe, base on the coordinates and orientation, the server could algorithmically predict which POI you are looking at or infront of. They mentioned they have a thin client on the mobile device, so I guess the S60 client tries to get the orientation base on the <strong>bearing</strong>. Also check this one out, <a href="http://www.geovector.com/press/mls.html">&#8220;users can now walk down the street anywhere in Japan and point at over 700,000 objects such as buildings, shops, restaurants, banks, historical sites and instantly retrieve information on what they are looking at or find what they are looking for just by pointing their phone.&#8221;</a>. Niche eh? Just compells me more to start up our mobile pursuit&#8230;</p>
<p>But what rocked me the most was <a href="http://geothought.blogspot.com/2008/04/ubisense-location-tracking-to-be.html">indoor tracking by Ubisense</a> using ultrawideband technology which is close to a foot?!?. This I have to see, as it opens new business cases for direction guiding indoors such as big malls, etc. Imagine mapjack views inside malls with Ubisense technology. Sweet. </p>
<p>Other References:<br />
<a href="http://www.openlandmark.com/">http://www.openlandmark.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/04/interesting-location-technologies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using TileCache, OpenLayers, Mapserver for Projection 900913</title>
		<link>/wordpress/2008/04/using-tilecache-openlayers-mapserver-for-projection-900913/</link>
		<comments>/wordpress/2008/04/using-tilecache-openlayers-mapserver-for-projection-900913/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 01:50:12 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[mapserver]]></category>
		<category><![CDATA[openlayers]]></category>
		<category><![CDATA[tilecache]]></category>

		<guid isPermaLink="false">http://www.gisnotes.com/wordpress/?p=166</guid>
		<description><![CDATA[I had a few problems with TileCache the other week which I am eager to blog about, since I knew for sure that later on, I might encounter the same. I don&#8217;t have the exact errors with me right now, so I&#8217;m jotting this down from my head&#8230; Classic Resolutions problem. Use extent_type=loose Can not]]></description>
			<content:encoded><![CDATA[<p>I had a few problems with <a href="www.tilecache.org">TileCache</a> the other week which I am eager to blog about, since I knew for sure that later on, I might encounter the same. I don&#8217;t have the exact errors with me right now, so I&#8217;m jotting this down from my head&#8230;</p>
<ol>
<li>Classic Resolutions problem. Use extent_type=loose</li>
<li>Can not set image type</li>
</ol>
<p>UPDATED (JAN 11, 2010): Classic Resolutions problem:</p>
<p>How are resolutions calculated? Assuming we have:</p>
<p>Original:<br />
	Lower Left (LL) or minx, miny: 12453557, -5434940<br />
	Upper Right (UR) or max, maxy: 16980842, -1180729</p>
<p>maxResolution = (max &#8211; minx)/tilesize = (16980842 &#8211; 12453557)/512 = 8842.353<br />
	where tilesize = 512.</p>
<p>Therefore, we can set/guess for max so that we have maxResolution as a whole number.</p>
<p>Adjusted:<br />
	minx, miny: 12453557, -5434940<br />
	maxx, maxy: 16980661, -1180729</p>
<p>gives a maxResolution (whole number) of 8842.</p>
<p>Now, you can use 8842 in both the TileCache.cfg and OpenLayers Javascript.<span id="more-166"></span><br />
<strong>A. Google BaseLayer + Road WMS Overlay = Validation approach before we proceed to TC.</strong></p>
<p>1. OpenLayers (OL) Code: <a href="http://www.gisnotes.com/platform/docs/examples/GoogleWMSRoads.cfm">http://www.gisnotes.com/platform/docs/examples/GoogleWMSRoads.cfm</a></p>
<p>2. Map File Configuration: <code>/home/map/beijing/new/beijing_google_roads</code></p>
<p>Well the above files are not exactly for TC, but it is a good demonstration that we could overlay our custom layers (WMS) on top of Google as the base layer. For a more detailed explanation regarding Google + OL, please read my previous <a href="/wordpress/index.php/2007/12/22/openlayers-google-spherical-mercator-example/">gisnote</a>. Also, this is a good test to see if our <a href="">Mapserver <em>mapfile</em> configuration</a> is correct. I do suggest not to proceed with OL + TC not unless you have validated the mapfile through OL (Google + WMS).</p>
<p><strong>B. Google900913 Tilecache as baselayer</strong></p>
<p>Ok.. so here it is..</p>
<p>1. OpenLayers Code: <a href="http://www.gisnotes.com/platform/docs/examples/TilecacheGoogle900913Base.cfm">http://www.gisnotes.com/platform/docs/examples/TilecacheGoogle900913Base.cfm</a></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">        window.<span style="color: #000066;">onload</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> options <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
                        projection<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Projection</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;EPSG:900913&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                        units<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;m&quot;</span><span style="color: #339933;">,</span>
&nbsp;
                        <span style="color: #006600; font-style: italic;">//maxResolution: 156543.0339,</span>
                        resolutions <span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #CC0000;">156543.03390000001</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">78271.516950000005</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">39135.758475000002</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">19567.879237500001</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">9783.9396187500006</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">4891.9698093750003</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2445.9849046875001</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1222.9924523437501</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">611.49622617187504</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">305.74811308593752</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">152.87405654296876</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">76.43702827148438</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">38.21851413574219</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">19.109257067871095</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">9.5546285339355475</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">4.7773142669677737</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2.3886571334838869</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1.1943285667419434</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0.59716428337097172</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0.29858214168548586</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
                        <span style="color: #006600; font-style: italic;">//zoom: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] @ numZoomLevels: 20</span>
                        numZoomLevels<span style="color: #339933;">:</span> <span style="color: #CC0000;">20</span><span style="color: #339933;">,</span>
                        <span style="color: #006600; font-style: italic;">//maxExtent: new OpenLayers.Bounds(12823075.86334, 4800551.12375, 13101918.14248, 5021301.26141)</span>
                        <span style="color: #006600; font-style: italic;">//maxExtent: new OpenLayers.Bounds(12823075, 4800551, 13101918, 5021301)</span>
                        <span style="color: #006600; font-style: italic;">//maxExtent: new OpenLayers.Bounds(12848138, 4785083, 13080212, 5021118.5)</span>
                        maxExtent<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Bounds</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">20037508</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">20037508</span><span style="color: #339933;">,</span><span style="color: #CC0000;">20037508</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">20037508.34</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
            OpenLayers.<span style="color: #660066;">IMAGE_RELOAD_ATTEMPTS</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">3</span><span style="color: #339933;">;</span>
            OpenLayers.<span style="color: #660066;">Util</span>.<span style="color: #660066;">onImageLoadErrorColor</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;transparent&quot;</span><span style="color: #339933;">;</span>
&nbsp;
            map <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Map</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mapdiv'</span><span style="color: #339933;">,</span>options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #003366; font-weight: bold;">var</span> serverURL <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;/tilecache/tilecache.py&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #006600; font-style: italic;">// start custom layer here</span>
            <span style="color: #003366; font-weight: bold;">var</span> layer_obj <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Layer</span>.<span style="color: #660066;">WMS</span><span style="color: #009900;">&#40;</span>
                <span style="color: #3366CC;">&quot;Beijing&quot;</span><span style="color: #339933;">,</span>
                serverURL<span style="color: #339933;">,</span>
                <span style="color: #009900;">&#123;</span>
                    layers<span style="color: #339933;">:</span> <span style="color: #3366CC;">'beijing_900913'</span><span style="color: #339933;">,</span>
                    map<span style="color: #339933;">:</span> <span style="color: #3366CC;">'/home/map/beijing/new/beijing_900913/beijing.map'</span><span style="color: #339933;">,</span>
                    format<span style="color: #339933;">:</span> <span style="color: #3366CC;">'image/jpg'</span><span style="color: #339933;">,</span>
                    <span style="color: #3366CC;">'transparent'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'off'</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            layer_obj.<span style="color: #660066;">setIsBaseLayer</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            layer_obj.<span style="color: #660066;">setVisibility</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            map.<span style="color: #660066;">addLayer</span><span style="color: #009900;">&#40;</span>layer_obj<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>2. TileCache Configuration: /wwwroot/tilecache/tilecache.cfg</p>

<div class="wp_syntax"><div class="code"><pre class="cnf" style="font-family:monospace;">[beijing_900913]
type=WMSLayer
url=http://127.0.0.1/cgi-bin/mapserv?map=/home/map/beijing/new/beijing_900913/beijing.map
layers=beijing_900913
metatile=true
extension=jpg
levels=20
resolutions=156543.03390000001, 78271.516950000005, 39135.758475000002, 19567.879237500001, 9783.9396187500006, 4891.9698093750003, 2445.9849046875001, 1222.9924523437501, 611.49622617187504, 305.74811308593752, 152.87405654296876, 76.43702827148438, 38.21851413574219, 19.109257067871095, 9.5546285339355475, 4.7773142669677737, 2.3886571334838869, 1.1943285667419434, 0.59716428337097172, 0.29858214168548586
srs=EPSG:900913
bbox=-20037508, -20037508, 20037508, 20037508.34
#maxResolution=156543.0339
extent_type=loose
debug=on</pre></div></div>

<p>You can either set resolutions or maxResolutions. I always wanted to be explicit, so setting the <strong>resolutions</strong> is my preference.</p>
<p>3. MapFile Configuration: <code>/home/map/beijing/new/beijing_900913/beijing.map</code><br />
I have a long mapfile, and using <a href="http://mapserver.gis.umn.edu/docs/reference/mapfile/Include">includes</a> helped a lot, see my previous <a href="/wordpress/index.php/2007/08/19/103/">gisnote</a>.  For debugging your mapfile, read this <a href="/wordpress/index.php/2007/08/24/mapserver-debug-output/">post.</a></p>
<p><strong>Always Remember&#8230;I believe when they made TC, I presume they always tested on WGS84(lonlat), this means if you don&#8217;t set anything explicit, it would <em>implicitly</em> set settings in WGS84(lon/lat)&#8230;</strong></p>
<ul>
<li>Ensure that you have the vector data in the necessary projection, in my case it&#8217;s 900913.</li>
<p><br/> </p>
<li>Ensure that the <em>resolutions</em> from OL (B.1) is reflected in TC configuration (B.2).</li>
<p><br/></p>
<li>Ensure that the <em>maxextents</em> from OL (B.1) is reflected in TC configuration (B.2) as <em>bbox</em>.</li>
<p><br/>
</ul>
<p><strong>C. Still can&#8217;t get it running?</strong></p>
<p>1. Narrow down the error.</p>
<p>2. <strong>tail -f /var/log/apache2/error.log</strong> and <strong>access.log</strong> is your bestfriend. It&#8217;s a good starting point to trace down what went wrong.  If you can&#8217;t see it from Apache&#8217;s error.log then ensure that <a href="/wordpress/index.php/2007/07/25/installing-tilecache/">python debugging is turned on.</a></p>
<p>3. Sometimes TC <strong>[a]</strong> gives you an obvious error or <strong>[b]</strong> its just a link to the mapserv request. </p>
<p>Examples of <strong>[a]</strong>:</p>
<ul>
<li><em>Classic Resolution problem stated above. </em>- If you followed my final notes above, then this should not happen. If you&#8217;ve set up things correctly but it&#8217;s still broken and you want to pull your hair out, then do a clean test stated below in D.</li>
<li><em>Cannot set image type</em> &#8211; Check the extensions from the mapfile and TC config. Are they both in jpg&#8217;s?</li>
</ul>
<p>The latter <strong>[b]</strong> is harder to debug. Most likely its a mapserver mapfile mishap and the easiest way to hunt this down is only thru your error.log (note: you need mapserver to have a debug=true when you compiled it, that&#8217;s another story.)</p>
<p><strong>D. Doing a clean test as always</strong><br />
1. Always disable any caching when testing. Disable cache from your browser, for FF I use the webdeveloper toolbar. It&#8217;s as easy as Disable -> Disable Cache.</p>
<p>2. Stop/Start Apache. Hoping Python get&#8217;s a clean start as well. If you found any pyc (python compiled) under TC source directory&#8230; then stop Apache; remove the pycs; start Apache.</p>
<p>3. Seeing the same images? Always remove the image caches! rm -Rf /data/tilecache/beijing_900913</p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/04/using-tilecache-openlayers-mapserver-for-projection-900913/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Mapserver on Debian (reprise)</title>
		<link>/wordpress/2008/03/installing-mapserver-on-debian-reprise/</link>
		<comments>/wordpress/2008/03/installing-mapserver-on-debian-reprise/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 11:31:43 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mapserver]]></category>

		<guid isPermaLink="false">http://www.gisnotes.com/wordpress/index.php/2008/03/28/installing-mapserver-on-debian-reprise/</guid>
		<description><![CDATA[As noted from my previous blog post regarding Mapserver on Debian, you don&#8217;t get AGG with Mapserver when installing directly from Debian packages. Thus, it would be better to install Mapserver by source. However, debian still helps because it would install all the necessary libraries needed for compiling mapserver. ./configure \ --with-agg \ --with-jpeg \]]></description>
			<content:encoded><![CDATA[<p>As noted from my <a href="/wordpress/index.php/2007/08/01/debian-howto-installing-mapserver/">previous blog post regarding Mapserver on Debian</a>, you don&#8217;t get AGG with Mapserver when installing directly from Debian packages. Thus, it would be better to <a href="http://mapserver.gis.umn.edu/download/current">install Mapserver by source.</a> However, debian still helps because it would install all the necessary libraries needed for compiling mapserver.<span id="more-165"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure \
<span style="color: #660033;">--with-agg</span> \
<span style="color: #660033;">--with-jpeg</span> \
<span style="color: #660033;">--with-gd</span> \
<span style="color: #660033;">--with-freetype</span> \
<span style="color: #660033;">--with-png</span> \
<span style="color: #660033;">--with-ogr</span> \
<span style="color: #660033;">--with-proj</span> \
<span style="color: #660033;">--with-gdal</span> \
<span style="color: #660033;">--with-httpd</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>apache2 \
<span style="color: #660033;">--with-tiff</span> \
<span style="color: #660033;">--with-wfs</span> \
<span style="color: #660033;">--with-wcs</span> \
<span style="color: #660033;">--with-threads</span> \
<span style="color: #660033;">--with-wmsclient</span> \
<span style="color: #660033;">--with-wfsclient</span> \
<span style="color: #660033;">--with-geos</span> \
<span style="color: #660033;">--with-postgis</span> \
<span style="color: #660033;">--enable-debug</span></pre></div></div>

<p>When I started installing yesterday, I did not know which packages/libraries are installed in my box. I dove off immediately by running my configure.sh above and received an error: <font color="red"><code>Could not find gd.h or libgd.a/libgd.so in /usr/local..</code></font></p>
<p>The best way to figure out if you&#8217;re ready is reading thru the <em>configure</em> output.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">checking <span style="color: #000000; font-weight: bold;">for</span> gcc... <span style="color: #c20cb9; font-weight: bold;">gcc</span>
checking <span style="color: #000000; font-weight: bold;">for</span> C compiler default output <span style="color: #c20cb9; font-weight: bold;">file</span> name... a.out
checking whether the C compiler works... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking whether we are cross compiling... no
checking <span style="color: #000000; font-weight: bold;">for</span> suffix of executables...
checking <span style="color: #000000; font-weight: bold;">for</span> suffix of object files... o
checking whether we are using the GNU C compiler... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking whether <span style="color: #c20cb9; font-weight: bold;">gcc</span> accepts -g... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #c20cb9; font-weight: bold;">gcc</span> option to accept ANSI C... none needed
checking <span style="color: #000000; font-weight: bold;">for</span> g++... <span style="color: #c20cb9; font-weight: bold;">g++</span>
checking whether we are using the GNU C++ compiler... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking whether <span style="color: #c20cb9; font-weight: bold;">g++</span> accepts -g... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> ranlib... ranlib
checking <span style="color: #000000; font-weight: bold;">for</span> flex... no
checking <span style="color: #000000; font-weight: bold;">for</span> lex... no
checking <span style="color: #000000; font-weight: bold;">for</span> yywrap <span style="color: #000000; font-weight: bold;">in</span> -lfl... no
checking <span style="color: #000000; font-weight: bold;">for</span> yywrap <span style="color: #000000; font-weight: bold;">in</span> -ll... no
checking <span style="color: #000000; font-weight: bold;">for</span> bison... no
checking <span style="color: #000000; font-weight: bold;">for</span> byacc... no
checking <span style="color: #000000; font-weight: bold;">if</span> compiler supports -R... no
checking <span style="color: #000000; font-weight: bold;">if</span> compiler supports -Wl,-rpath,... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> exp <span style="color: #000000; font-weight: bold;">in</span> -lm... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> __gxx_personality_v0 <span style="color: #000000; font-weight: bold;">in</span> -lstdc++... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking how to run the C preprocessor... <span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #660033;">-E</span>
checking <span style="color: #000000; font-weight: bold;">for</span> egrep... <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-E</span>
checking <span style="color: #000000; font-weight: bold;">for</span> ANSI C header files... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> strcasecmp... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> strncasecmp... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> strdup... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> strlcat... no
checking <span style="color: #000000; font-weight: bold;">for</span> vsnprintf... <span style="color: #c20cb9; font-weight: bold;">yes</span>
MapServer Version from mapserver.h: <span style="color: #ff0000;">'5.0.2'</span>
configure: checking where FreeType 2.x is installed...
checking <span style="color: #000000; font-weight: bold;">for</span> freetype-config... <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>freetype-config
        using libfreetype from <span style="color: #660033;">-lfreetype</span> <span style="color: #660033;">-lz</span>
checking <span style="color: #000000; font-weight: bold;">for</span> FT_Init_FreeType <span style="color: #000000; font-weight: bold;">in</span> -lfreetype... <span style="color: #c20cb9; font-weight: bold;">yes</span>
        using libfreetype <span style="color: #660033;">-lfreetype</span> from system libs.
configure: checking where Zlib is installed...
checking <span style="color: #000000; font-weight: bold;">for</span> zlibVersion <span style="color: #000000; font-weight: bold;">in</span> -lz... <span style="color: #c20cb9; font-weight: bold;">yes</span>
        using libz from system libs <span style="color: #7a0874; font-weight: bold;">&#40;</span>-DUSE_ZLIB<span style="color: #7a0874; font-weight: bold;">&#41;</span>.
configure: checking where PNG is installed...
checking <span style="color: #000000; font-weight: bold;">for</span> png_init_io <span style="color: #000000; font-weight: bold;">in</span> -lpng... <span style="color: #c20cb9; font-weight: bold;">yes</span>
        using libpng from system libs.
configure: checking whether we should include JPEG support...
checking <span style="color: #000000; font-weight: bold;">for</span> jpeg_read_header <span style="color: #000000; font-weight: bold;">in</span> -ljpeg... <span style="color: #c20cb9; font-weight: bold;">yes</span>
        using libjpeg from system libs.
configure: checking where libXpm is installed...
checking <span style="color: #000000; font-weight: bold;">for</span> XpmFreeXpmImage <span style="color: #000000; font-weight: bold;">in</span> -lXpm... <span style="color: #c20cb9; font-weight: bold;">yes</span>
        using libXpm from system libs.
configure: checking where libiconv is installed...
checking <span style="color: #000000; font-weight: bold;">for</span> iconv_open <span style="color: #000000; font-weight: bold;">in</span> -lc... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> libiconv_open <span style="color: #000000; font-weight: bold;">in</span> -liconv... no
        using libiconv from system libs.
        libiconv found. Enabling internationalization <span style="color: #7a0874; font-weight: bold;">&#40;</span>-DUSE_ICONV<span style="color: #7a0874; font-weight: bold;">&#41;</span>
configure: checking <span style="color: #000000; font-weight: bold;">for</span> GD 2.0.16 or higher...
checking <span style="color: #000000; font-weight: bold;">for</span> gdFontCacheSetup <span style="color: #000000; font-weight: bold;">in</span> -lgd... <span style="color: #c20cb9; font-weight: bold;">yes</span>
        using libgd 2.0.16 <span style="color: #7a0874; font-weight: bold;">&#40;</span>or higher<span style="color: #7a0874; font-weight: bold;">&#41;</span> from system libs <span style="color: #7a0874; font-weight: bold;">&#40;</span>-L<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib <span style="color: #660033;">-lgd</span> <span style="color: #660033;">-ljpeg</span> <span style="color: #660033;">-lfreetype</span> <span style="color: #660033;">-lpng</span> <span style="color: #660033;">-lz</span> <span style="color: #660033;">-lXpm</span> <span style="color: #660033;">-lX11</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>.
checking <span style="color: #000000; font-weight: bold;">for</span> gdImageCreate <span style="color: #000000; font-weight: bold;">in</span> -lgd... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> gdImageGif <span style="color: #000000; font-weight: bold;">in</span> -lgd... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> gdImagePng <span style="color: #000000; font-weight: bold;">in</span> -lgd... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> gdImageJpeg <span style="color: #000000; font-weight: bold;">in</span> -lgd... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> gdImageWBMP <span style="color: #000000; font-weight: bold;">in</span> -lgd... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> gdImageStringFT <span style="color: #000000; font-weight: bold;">in</span> -lgd... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> gdImageOpenPolygon <span style="color: #000000; font-weight: bold;">in</span> -lgd... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> gdImageGifPtr <span style="color: #000000; font-weight: bold;">in</span> -lgd... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> gdFontGetTiny <span style="color: #000000; font-weight: bold;">in</span> -lgd... <span style="color: #c20cb9; font-weight: bold;">yes</span>
        using GD <span style="color: #7a0874; font-weight: bold;">&#40;</span> -DUSE_GD_GIF -DUSE_GD_PNG -DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT -DGD_HAS_FTEX_XSHOW -DGD_HAS_GDIMAGEGIFPTR -DGD_HAS_GETBITMAPFONTS<span style="color: #7a0874; font-weight: bold;">&#41;</span> from system libs.
configure: checking whether we should include PDF support...
checking <span style="color: #000000; font-weight: bold;">for</span> PDF_setlinewidth <span style="color: #000000; font-weight: bold;">in</span> -lpdf... no
checking <span style="color: #000000; font-weight: bold;">for</span> PDF_setrgbcolor <span style="color: #000000; font-weight: bold;">in</span> -lpdf... no
checking <span style="color: #000000; font-weight: bold;">for</span> PDF_moveto <span style="color: #000000; font-weight: bold;">in</span> -lpdf... no
checking <span style="color: #000000; font-weight: bold;">for</span> PDF_curveto <span style="color: #000000; font-weight: bold;">in</span> -lpdf... no
checking <span style="color: #000000; font-weight: bold;">for</span> PDF_show_xy <span style="color: #000000; font-weight: bold;">in</span> -lpdf... no
checking <span style="color: #000000; font-weight: bold;">for</span> PDF_load_font <span style="color: #000000; font-weight: bold;">in</span> -lpdf... no
        libpdf not found or too old... PDF support not included.
checking <span style="color: #000000; font-weight: bold;">if</span> AGG support requested... looking <span style="color: #000000; font-weight: bold;">for</span> agg libs <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>usr
using libagg from <span style="color: #000000; font-weight: bold;">/</span>usr
using libaggfontfreetype from <span style="color: #000000; font-weight: bold;">/</span>usr
configure: checking whether we should include EPPL7 support...
        including EPPL7 support.
configure: checking whether we should include PROJ.4 support...
checking <span style="color: #000000; font-weight: bold;">for</span> pj_init <span style="color: #000000; font-weight: bold;">in</span> -lproj... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> pj_transform <span style="color: #000000; font-weight: bold;">in</span> -lproj... <span style="color: #c20cb9; font-weight: bold;">yes</span>
        using PROJ.4 from system libs.
configure: checking whether we should include thread safe support...
checking <span style="color: #000000; font-weight: bold;">for</span> pthread_create <span style="color: #000000; font-weight: bold;">in</span> -lpthread... <span style="color: #c20cb9; font-weight: bold;">yes</span>
        using <span style="color: #660033;">-lpthread</span> from system libs.
configure: checking whether we should include ESRI SDE support...
        ESRI SDE support not requested.
checking <span style="color: #000000; font-weight: bold;">if</span> GEOS support requested... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> geos-config... <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>geos-config
checking <span style="color: #000000; font-weight: bold;">for</span> GEOS version <span style="color: #000000; font-weight: bold;">&amp;</span>gt;= 2.2.2... yes. Found version 2.2.3
configure: checking whether we should include OGR support...
checking <span style="color: #000000; font-weight: bold;">for</span> gdal-config... <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gdal-config
        OGR enabled <span style="color: #7a0874; font-weight: bold;">&#40;</span>-DUSE_OGR<span style="color: #7a0874; font-weight: bold;">&#41;</span>.
checking <span style="color: #000000; font-weight: bold;">if</span> GDAL support requested... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking checking ms JPEG output... no we, have GDAL available.
configure: checking whether we should include TIFF support...
checking <span style="color: #000000; font-weight: bold;">for</span> TIFFOpen <span style="color: #000000; font-weight: bold;">in</span> -ltiff... <span style="color: #c20cb9; font-weight: bold;">yes</span>
        using libtiff from system libs.
checking <span style="color: #000000; font-weight: bold;">if</span> PostGIS support requested... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> pg_config... <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>pg_config
<span style="color: #c20cb9; font-weight: bold;">yes</span>, user supplied pg_config
checking <span style="color: #000000; font-weight: bold;">if</span> MyGIS support requested... no
checking <span style="color: #000000; font-weight: bold;">if</span> OracleSpatial support requested... no
checking <span style="color: #000000; font-weight: bold;">if</span> MING<span style="color: #000000; font-weight: bold;">/</span>Flash support requested... no
configure: checking whether we should include WMS Server support...
        OGC WMS compatibility enabled <span style="color: #7a0874; font-weight: bold;">&#40;</span>-DUSE_WMS_SVR<span style="color: #7a0874; font-weight: bold;">&#41;</span>.
configure: checking whether we should include WFS Server support...
        OGC WFS Server support enabled <span style="color: #7a0874; font-weight: bold;">&#40;</span>-DUSE_WFS_SVR<span style="color: #7a0874; font-weight: bold;">&#41;</span>.
configure: checking whether we should include WCS Server support...
        OGC WCS Server support enabled <span style="color: #7a0874; font-weight: bold;">&#40;</span>-DUSE_WCS_SVR<span style="color: #7a0874; font-weight: bold;">&#41;</span>.
configure: checking whether we should include WMS Client Connections support...
configure: checking whether we should include WFS Client Connections support...
configure: checking whether we should include OGC SOS Server support...
configure: checking <span style="color: #000000; font-weight: bold;">for</span> curl-config...
checking <span style="color: #000000; font-weight: bold;">for</span> curl-config... <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>curl-config
        found libcurl version 7.18.0
        OGC WMS Client Connections enabled <span style="color: #7a0874; font-weight: bold;">&#40;</span>-DUSE_WMS_LYR<span style="color: #7a0874; font-weight: bold;">&#41;</span>.
        OGC WFS Client Connections enabled <span style="color: #7a0874; font-weight: bold;">&#40;</span>-DUSE_WFS_LYR<span style="color: #7a0874; font-weight: bold;">&#41;</span>.
configure: checking <span style="color: #000000; font-weight: bold;">for</span> xml2-config...
configure: checking whether FastCGI support should be enabled...
        FastCGI support not enabled.
configure: checking HTTPD server <span style="color: #7a0874; font-weight: bold;">&#40;</span>Apache<span style="color: #7a0874; font-weight: bold;">&#41;</span> version...
        using user-supplied httpd <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>apache2 version is Apache<span style="color: #000000; font-weight: bold;">/</span>2.2.8 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">2002008</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>.
        Your system is apparently running Apache<span style="color: #000000; font-weight: bold;">/</span>2.2.8.  Setting stderr to non-blocking <span style="color: #000000; font-weight: bold;">for</span> msDebug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> due to Apache 2.x bug <span style="color: #7a0874; font-weight: bold;">&#40;</span>see MapServer bug <span style="color: #000000;">458</span> or Apache bug <span style="color: #000000;">22030</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>.
Compiling with fast MS_NINT
checking compiler warnings... basic
configure: checking whether we should <span style="color: #7a0874; font-weight: bold;">enable</span> debug features...
        Enabling debug features: <span style="color: #660033;">-g</span> <span style="color: #000000; font-weight: bold;">in</span> CFLAGS.
configure: checking <span style="color: #000000; font-weight: bold;">for</span> PHP<span style="color: #000000; font-weight: bold;">/</span>MapScript module options...
        PHP<span style="color: #000000; font-weight: bold;">/</span>MapScript module not configured.
checking <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #c20cb9; font-weight: bold;">g++</span> <span style="color: #660033;">-shared</span> ... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #660033;">--enable-runpath</span> requested... no
checking <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #660033;">--with-java-include-os-name</span> specified... no, autodetected linux
configure: creating .<span style="color: #000000; font-weight: bold;">/</span>config.status
config.status: creating Makefile
config.status: creating mapscript<span style="color: #000000; font-weight: bold;">/</span>java<span style="color: #000000; font-weight: bold;">/</span>Makefile
config.status: creating mapscript<span style="color: #000000; font-weight: bold;">/</span>csharp<span style="color: #000000; font-weight: bold;">/</span>Makefile
&nbsp;
MapServer is now configured <span style="color: #000000; font-weight: bold;">for</span>
&nbsp;
 <span style="color: #660033;">--------------</span> Compiler Info <span style="color: #660033;">-------------</span>
  C compiler:                <span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #660033;">-g</span> <span style="color: #660033;">-O2</span> <span style="color: #660033;">-fPIC</span> <span style="color: #660033;">-Wall</span>
  C++ compiler:              <span style="color: #c20cb9; font-weight: bold;">g++</span> <span style="color: #660033;">-g</span> <span style="color: #660033;">-O2</span> <span style="color: #660033;">-fPIC</span> <span style="color: #660033;">-Wall</span>
  Debug:                     <span style="color: #660033;">-g</span>  -DNEED_NONBLOCKING_STDERR
  Generic NINT:
  Threading support:         -DUSE_THREAD
&nbsp;
 <span style="color: #660033;">--------------</span> Renderer Settings <span style="color: #660033;">---------</span>
  zlib support:              -DUSE_ZLIB
  png support:
  jpeg support:
  iconv support:             -DUSE_ICONV
  AGG support:               -DUSE_AGG
  AGG Freetype support:      <span style="color: #660033;">-laggfontfreetype</span>
  Ming<span style="color: #7a0874; font-weight: bold;">&#40;</span>flash<span style="color: #7a0874; font-weight: bold;">&#41;</span> support:
  PDFLib support:
&nbsp;
 <span style="color: #660033;">--------------</span> Data Format Drivers <span style="color: #660033;">-------</span>
  native tiff support:       -DUSE_TIFF
  PostGIS support:           -DUSE_POSTGIS
  Proj.4 support:            -DUSE_PROJ
  EPPL7 support:             -DUSE_EPPL
  ArcSDE support:
  OGR support:               -DUSE_OGR
  GDAL support:              -DUSE_GDAL
  GEOS support:              -DUSE_GEOS
  Oracle Spatial support:
  FastCGI support:
&nbsp;
 <span style="color: #660033;">--------------</span> OGC Services <span style="color: #660033;">--------------</span>
  WMS Server:                -DUSE_WMS_SVR
  WMS Client:                -DUSE_WMS_LYR
  WFS Server:                -DUSE_WFS_SVR
  WFS Client:                -DUSE_WMS_LYR
  WCS Server:                -DUSE_WCS_SVR
  SOS Server:
&nbsp;
 <span style="color: #660033;">--------------</span> MapScript <span style="color: #660033;">-----------------</span>
  PHP MapScript:             no</pre></div></div>

<p>I was able to weed out the problem above by checking on the libraries noted with &#8220;yes&#8221; above if they are installed or not. To overcome this, I needed to install the ff debian packages on &#8216;lenny(testing)&#8217;:</p>
<p><code>libagg-dev libgd2-xpm libgd2-xpm-dev libtiff4 libtiff4-dev libpng libpng-dev libxpm4 libxpm4-dev libfreetype6-dev libapache2-mod-python python-imaging </code></p>
<p>Results:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">debsexy:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>cgi-bin<span style="color: #666666; font-style: italic;"># ./mapserv -v</span>
MapServer version 5.0.2 <span style="color: #007800;">OUTPUT</span>=GIF <span style="color: #007800;">OUTPUT</span>=PNG <span style="color: #007800;">OUTPUT</span>=JPEG <span style="color: #007800;">OUTPUT</span>=WBMP <span style="color: #007800;">OUTPUT</span>=SVG <span style="color: #007800;">SUPPORTS</span>=PROJ <span style="color: #007800;">SUPPORTS</span>=AGG <span style="color: #007800;">SUPPORTS</span>=FREETYPE <span style="color: #007800;">SUPPORTS</span>=WMS_SERVER <span style="color: #007800;">SUPPORTS</span>=WMS_CLIENT <span style="color: #007800;">SUPPORTS</span>=WFS_SERVER <span style="color: #007800;">SUPPORTS</span>=WFS_CLIENT <span style="color: #007800;">SUPPORTS</span>=WCS_SERVER <span style="color: #007800;">SUPPORTS</span>=THREADS <span style="color: #007800;">SUPPORTS</span>=GEOS <span style="color: #007800;">INPUT</span>=TIFF <span style="color: #007800;">INPUT</span>=EPPL7 <span style="color: #007800;">INPUT</span>=POSTGIS <span style="color: #007800;">INPUT</span>=OGR <span style="color: #007800;">INPUT</span>=GDAL <span style="color: #007800;">INPUT</span>=SHAPEFILE</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/03/installing-mapserver-on-debian-reprise/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing PostGres8.3 and Postgis1.3.2 on Windows</title>
		<link>/wordpress/2008/03/installing-postgres83-and-postgis-on-windows/</link>
		<comments>/wordpress/2008/03/installing-postgres83-and-postgis-on-windows/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 00:15:05 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[postgis]]></category>
		<category><![CDATA[postgres]]></category>

		<guid isPermaLink="false">/wordpress/index.php/2008/03/04/installing-postgres83-and-postgis-on-windows/</guid>
		<description><![CDATA[It seems very nice for the new PostGres8.3 installer to bundle up third party libraries installation with the new admin pack feature. Using this feature, you can install PostGis, nPgsql, etc. The installation was painless and smooth this time. I have to backup all my data though using pg_dump. To lessen the learning curve on]]></description>
			<content:encoded><![CDATA[<p>It seems very nice for the new PostGres8.3 installer to bundle up third party libraries installation with the new <em>admin pack</em> feature. Using this feature, you can install PostGis, nPgsql, etc. The installation was painless and smooth this time. I have to backup all my data though using pg_dump.</p>
<p>To lessen the learning curve on installing PostGres + PostGis together, I made a <a href="http://www.gisnotes.com/wordpress/training/postgres-tut1.html" title="postgres-tut1.html">short flash movie</a> here.  There is no audio in the tutorial. The idea was to introduce PostGres to my Chinese staff.  I have to remove PostGreSQL 8.2 first before installing 8.3.</p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/03/installing-postgres83-and-postgis-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making GeoJSON outputs from PostGIS</title>
		<link>/wordpress/2008/02/making-geojson-outputs-from-postgis/</link>
		<comments>/wordpress/2008/02/making-geojson-outputs-from-postgis/#comments</comments>
		<pubDate>Sat, 23 Feb 2008 02:08:17 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[GeoJSON]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[postgis]]></category>

		<guid isPermaLink="false">/wordpress/index.php/2008/02/23/making-geojson-outputs-from-postgis/</guid>
		<description><![CDATA[I have an internet/web application sitting on top of OpenLayers, ExtJS, ColdFusion and PostGreSQL/PostGIS. I can query the geometry from PostGIS thru ColdFusion without any problems. If you are in ColdFusion 7, then you need a postgresql driver installed, but I do suggest you use ColdFusion 8 as the driver is built-in. To display the]]></description>
			<content:encoded><![CDATA[<p>I have an internet/web application sitting on top of OpenLayers, ExtJS, ColdFusion and PostGreSQL/PostGIS. I can query the geometry from PostGIS thru ColdFusion without any problems. If you are in ColdFusion 7, then you need a postgresql driver installed, but I do suggest you use ColdFusion 8 as the driver is built-in.</p>
<p>To display the geometry, I typically use AsGML output from PostGIS and supply that path to OpenLayers. Although it works as expected, I need to invest in two (2) http calls to the server:</p>
<ul>
<li>1st Request: Call search.cfm and get the attributes (name, address, tel_no, etc&#8230;). Afterwards, display the results on an Ext.Window.</li>
<li>2nd Request: Display the geometries on OpenLayers using GML.</li>
</ul>
<p><span id="more-145"></span>We have decided in our organisation not to write out the javascript statements on AJAX calls but instead retrieve them as Data Objects (either XML or GeoJSON). Putting in javascript statements on AJAX calls seems harder to debug. GeoJSON is highly preferred for internet mapping applications since it has a unique ability to see the javascript objects quickly on the browser, making debugging easier.</p>
<p>I wrote a simple cfc below to be able to parse the geometry from PostGIS using AsText(geometry).  The function accepts a geometry as string and returns a structure containing the type and the coordinates.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfcomponent</span> displayname<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;GeoJSON&quot;</span> <span style="color: #0000FF;">hint</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;I am a GeoJSON Component. I parse a geometry and return it as JSON&quot;</span> output<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cffunction</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;init&quot;</span> <span style="color: #0000FF;">access</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;public&quot;</span> output<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #0000FF;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfreturn</span><span style="color: #0000FF;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfreturn</span><span style="color: #0000FF;">&gt;</span></span>	
&nbsp;
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cffunction</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cffunction</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;format&quot;</span> returntype<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;Struct&quot;</span> output<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #0000FF;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfargument</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;geomtext&quot;</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;String&quot;</span> <span style="color: #0000FF;">required</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;true&quot;</span><span style="color: #0000FF;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> geometry<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;StructNew()&quot;</span><span style="color: #0000FF;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> geometry.<span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;Mid(arguments.geomtext,&quot;</span><span style="color: #0000FF;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> geomreplacedbrackets<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;Replace(arguments.geomtext,&quot;</span><span style="color: #0000FF;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> geomreplacedbrackets<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;Replace(geomReplacedBrackets,&quot;</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfloop</span> <span style="color: #0000FF;">from</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;1&quot;</span> <span style="color: #0000FF;">to</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#Len(geomReplacedBrackets)#&quot;</span> <span style="color: #0000FF;">index</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;i&quot;</span><span style="color: #0000FF;">&gt;</span></span>
			<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> curchar<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;Mid(geomReplacedBrackets,&quot;</span><span style="color: #0000FF;">&gt;</span></span>
			<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span>
				<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> geometry.coordinates<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;geometry.coordinates&quot;</span><span style="color: #0000FF;">&gt;</span></span>
	    		<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> secchar<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;Mid(geomReplacedBrackets,&quot;</span><span style="color: #0000FF;">&gt;</span></span>
				<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span> <span style="color: #808080; font-style: italic;">&lt;!--- Get the next character from the current position and see if its numeric ---&gt;</span>
					<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> posi<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;i&quot;</span><span style="color: #0000FF;">&gt;</span></span> <span style="color: #808080; font-style: italic;">&lt;!--- Get the position of &quot;[&quot;---&gt;</span>
					<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> posj<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;find(']',&quot;</span><span style="color: #0000FF;">&gt;</span></span>
					<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> tempgeom<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;Mid(geomReplacedBrackets,&quot;</span><span style="color: #0000FF;">&gt;</span></span>
					<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> i<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;posJ&quot;</span><span style="color: #0000FF;">&gt;</span></span> <span style="color: #808080; font-style: italic;">&lt;!--- reinitialize i ---&gt;</span>
&nbsp;
					<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
					<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfloop</span> <span style="color: #0000FF;">list</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#tempGeom#&quot;</span> <span style="color: #0000FF;">index</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;tempGeomIndex&quot;</span> delimiters<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;,&quot;</span><span style="color: #0000FF;">&gt;</span></span>
						<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> tempvalue<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;[&quot;</span><span style="color: #0000FF;">&gt;</span></span>
						<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> geomreplaced<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;ListAppend(geomReplaced,&quot;</span><span style="color: #0000FF;">&gt;</span></span>
					<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfloop</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
					<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> geometry.coordinates<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;geometry.coordinates&quot;</span><span style="color: #0000FF;">&gt;</span></span>
				<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfloop</span><span style="color: #0000FF;">&gt;</span></span>
			<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfelseif</span><span style="color: #0000FF;">&gt;</span></span>
				<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> geometry.coordinates<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;geometry.coordinates&quot;</span><span style="color: #0000FF;">&gt;</span></span>
			<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfelseif</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> geometry.coordinates<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;Replace(geometry.coordinates,&quot;</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span>
			<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> geometry.coordinates<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;Replace(geometry.coordinates,&quot;</span><span style="color: #0000FF;">&gt;</span></span>
			<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> geometry.coordinates<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;Replace(geometry.coordinates,&quot;</span><span style="color: #0000FF;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfreturn</span><span style="color: #0000FF;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfreturn</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfset</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfargument</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cffunction</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfcomponent</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/02/making-geojson-outputs-from-postgis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ExtJS and OpenLayers</title>
		<link>/wordpress/2008/02/extjs-and-openlayers/</link>
		<comments>/wordpress/2008/02/extjs-and-openlayers/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 00:45:18 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[openlayers]]></category>

		<guid isPermaLink="false">/wordpress/index.php/2008/02/19/extjs-and-openlayers/</guid>
		<description><![CDATA[It seems that ExtJS and OpenLayers does not blend well together. One of the bug biters that hit me was the way ExtJS was handling arrays. It would be wise for OpenLayers to be agnostic of these frameworks. for&#40; var i in blocks &#41; should be transformed to for&#40; var i = 0; i &#38;lt;]]></description>
			<content:encoded><![CDATA[<p>It seems that ExtJS and OpenLayers does not blend well together. One of the bug biters that hit me was the way ExtJS was handling arrays.  It would be wise for OpenLayers to be agnostic of these frameworks.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #000066; font-weight: bold;">in</span> blocks <span style="color: #009900;">&#41;</span> should be transformed to <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> blocks.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>I believe <a href="http://trac.openlayers.org/ticket/1362">OpenLayers Ticket#1362</a> closely resembles this bug.  Thanks to pgiraud for pointing me to the right direction.</p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/02/extjs-and-openlayers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ExtJS QuickTip: Display other levels of a JSON object in a Grid</title>
		<link>/wordpress/2008/02/extjs-quicktip-display-other-levels-of-a-json-object-in-a-grid/</link>
		<comments>/wordpress/2008/02/extjs-quicktip-display-other-levels-of-a-json-object-in-a-grid/#comments</comments>
		<pubDate>Mon, 18 Feb 2008 15:08:39 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[GeoJSON]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">/wordpress/index.php/2008/02/18/extjs-quicktip-display-other-levels-of-a-json-object-in-a-grid/</guid>
		<description><![CDATA[You can display an item anywhere in a JSON heirarchy/level in a Grid by using dot notation. I am beginning to like JSON as it is simply practical and amazing. To fully understand, please see geometry.type as an example. &#123; &#34;type&#34;: &#34;FeatureCollection&#34;, &#34;recordcount&#34;:6, &#34;features&#34;: &#91; &#123; &#34;type&#34;:&#34;Feature&#34;, &#34;geometry&#34;:&#123; &#34;type&#34;: &#34;MULTIPOLYGON&#34;, &#34;coordinates&#34;: &#91;&#91;&#91;&#91;116.368603,39.944314&#93;,&#91;116.381069,39.94464&#93;,&#91;116.388765,39.940265&#93;,&#91;116.390376,39.939124&#93;,&#91;116.391203,39.934381&#93;,&#91;116.391784,39.930743&#93;,&#91;116.387262,39.930638&#93;,&#91;116.387507,39.93289&#93;,&#91;116.383032,39.932688&#93;,&#91;116.382581,39.933204&#93;,&#91;116.37197,39.940531&#93;,&#91;116.368603,39.944314&#93;&#93;&#93;&#93; &#125;, &#34;gid&#34;:16055, &#34;cn_name&#34;:&#34;后海&#34;,]]></description>
			<content:encoded><![CDATA[<p>You can display an item anywhere in a JSON heirarchy/level in a Grid by using <strong>dot notation</strong>. I am beginning to like JSON as it is simply practical and amazing. To fully understand, please see <em>geometry.type</em> as an example.<span id="more-146"></span></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#123;</span> <span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;FeatureCollection&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;recordcount&quot;</span><span style="color: #339933;">:</span><span style="color: #CC0000;">6</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;features&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span> <span style="color: #009900;">&#123;</span> <span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;Feature&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;geometry&quot;</span><span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span> <span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;MULTIPOLYGON&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;coordinates&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">116.368603</span><span style="color: #339933;">,</span><span style="color: #CC0000;">39.944314</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">116.381069</span><span style="color: #339933;">,</span><span style="color: #CC0000;">39.94464</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">116.388765</span><span style="color: #339933;">,</span><span style="color: #CC0000;">39.940265</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">116.390376</span><span style="color: #339933;">,</span><span style="color: #CC0000;">39.939124</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">116.391203</span><span style="color: #339933;">,</span><span style="color: #CC0000;">39.934381</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">116.391784</span><span style="color: #339933;">,</span><span style="color: #CC0000;">39.930743</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">116.387262</span><span style="color: #339933;">,</span><span style="color: #CC0000;">39.930638</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">116.387507</span><span style="color: #339933;">,</span><span style="color: #CC0000;">39.93289</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">116.383032</span><span style="color: #339933;">,</span><span style="color: #CC0000;">39.932688</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">116.382581</span><span style="color: #339933;">,</span><span style="color: #CC0000;">39.933204</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">116.37197</span><span style="color: #339933;">,</span><span style="color: #CC0000;">39.940531</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">116.368603</span><span style="color: #339933;">,</span><span style="color: #CC0000;">39.944314</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;gid&quot;</span><span style="color: #339933;">:</span><span style="color: #CC0000;">16055</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;cn_name&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;后海&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;py_name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;hou hai&quot;</span> <span style="color: #009900;">&#125;</span> <span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> <span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;Feature&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;geometry&quot;</span><span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span> <span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;MULTIPOLYGON&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;coordinates&quot;</span><span style="color: #339933;">:</span> ....<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Here is the DataStore&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">cs.<span style="color: #660066;">GridPlace</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> _placeDataStore <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">Store</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">// create reader that reads the Topic records</span>
        reader<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">JsonReader</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
            root<span style="color: #339933;">:</span> <span style="color: #3366CC;">'features'</span><span style="color: #339933;">,</span>
            totalProperty<span style="color: #339933;">:</span> <span style="color: #3366CC;">'recordcount'</span><span style="color: #339933;">,</span>
            id<span style="color: #339933;">:</span> <span style="color: #3366CC;">'gid'</span><span style="color: #339933;">,</span>
            fields<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
                <span style="color: #3366CC;">'cn_name'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'py_name'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'geometry.type'</span>
            <span style="color: #009900;">&#93;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// the column model has information about grid columns</span>
    <span style="color: #006600; font-style: italic;">// dataIndex maps the column to the specific data field in</span>
    <span style="color: #006600; font-style: italic;">// the data store</span>
    <span style="color: #003366; font-weight: bold;">var</span> cm <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">ColumnModel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#123;</span>
           id<span style="color: #339933;">:</span> <span style="color: #3366CC;">'gid'</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// id assigned so we can apply custom css (e.g. .x-grid-col-topic b { color:#333 })</span>
           header<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;CN_NAME&quot;</span><span style="color: #339933;">,</span>
           width<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">,</span>
           dataIndex<span style="color: #339933;">:</span> <span style="color: #3366CC;">'cn_name'</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span>
           id<span style="color: #339933;">:</span> <span style="color: #3366CC;">'gid'</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// id assigned so we can apply custom css (e.g. .x-grid-col-topic b { color:#333 })</span>
           header<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;PY_NAME&quot;</span><span style="color: #339933;">,</span>
           width<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">,</span>
           dataIndex<span style="color: #339933;">:</span> <span style="color: #3366CC;">'py_name'</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span>
           id<span style="color: #339933;">:</span> <span style="color: #3366CC;">'gid'</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// id assigned so we can apply custom css (e.g. .x-grid-col-topic b { color:#333 })</span>
           header<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;GEOMTYPE&quot;</span><span style="color: #339933;">,</span>
           width<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">,</span>
           dataIndex<span style="color: #339933;">:</span> <span style="color: #3366CC;">'geometry.type'</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/02/extjs-quicktip-display-other-levels-of-a-json-object-in-a-grid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reviving an old web map with Google Maps via OpenLayers</title>
		<link>/wordpress/2008/01/reviving-an-old-web-map-with-google-maps-via-openlayers/</link>
		<comments>/wordpress/2008/01/reviving-an-old-web-map-with-google-maps-via-openlayers/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 01:10:09 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[openlayers]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">/wordpress/?p=136</guid>
		<description><![CDATA[An old coworker and I worked on a travel portal for the Philippines called travelsite.ph about 4 years ago. We are now given a task of reviving the old web application and even adding mapping functionalities. Back then, the application was using ColdFusion 4.5 and MySQL 3. Fingers crossed we dropped the app in a]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gisnotes.com/wordpress/wp-content/uploads/2008/01/travelsite.jpg" title="Travelsite.ph with Google"><img src="http://www.gisnotes.com/wordpress/wp-content/uploads/2008/01/travelsite.jpg" alt="Travelsite.ph with Google" /></a></p>
<p>An old coworker and I worked on a travel portal for the Philippines called travelsite.ph about 4 years ago. We are now given a task of reviving the old web application and even adding mapping functionalities.  Back then, the application was using ColdFusion 4.5 and MySQL 3.</p>
<p>Fingers crossed we dropped the app in a ColdFusion 6/7/8 environment with no changes at all. The app still works! Awesome.. how CF really progressed through the years with backward compatibility.  The only changes we made was removing the registration/sign up for a quick demo. I just laughed at the oddities and the no brainer features (pertaining to security) that I made when I was starting out.</p>
<p>The database was also intact and have UTM coordinates. We dropped it to a Debian mysql 5 and works flawlessly since its MyISAM. I had the coordinates exported to lon/lat, so I could directly inject it to OpenLayers/Google.  After two hours of fiddling around, I got mapping embedded.. hehe.. courtesy of OpenLayers ofcourse.</p>
<p>Here&#8217;s a quick reminder to myself&#8230;</p>
<p>A. Google WGS 84 Example.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">	window.<span style="color: #000066;">onload</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> options <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
					projection<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;EPSG:4326&quot;</span><span style="color: #339933;">,</span>
					numZoomLevels<span style="color: #339933;">:</span> <span style="color: #CC0000;">19</span><span style="color: #339933;">,</span>
					maxExtent<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Bounds</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">120.8774</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">14.3684</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">121.1628</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">14.7931</span><span style="color: #009900;">&#41;</span>
&nbsp;
				<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #006600; font-style: italic;">// avoid pink tiles</span>
		OpenLayers.<span style="color: #660066;">IMAGE_RELOAD_ATTEMPTS</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">3</span><span style="color: #339933;">;</span>
		OpenLayers.<span style="color: #660066;">Util</span>.<span style="color: #660066;">onImageLoadErrorColor</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;transparent&quot;</span><span style="color: #339933;">;</span>
		map <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Map</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mapdiv'</span><span style="color: #339933;">,</span>options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		sat_wms <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Layer</span>.<span style="color: #660066;">Google</span><span style="color: #009900;">&#40;</span>
					<span style="color: #3366CC;">&quot;Layer&quot;</span><span style="color: #339933;">,</span>
					<span style="color: #009900;">&#123;</span>type<span style="color: #339933;">:</span> G_SATELLITE_MAP<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		map.<span style="color: #660066;">addLayer</span><span style="color: #009900;">&#40;</span>sat_wms<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		map.<span style="color: #660066;">addControl</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Control</span>.<span style="color: #660066;">MousePosition</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		map.<span style="color: #660066;">addControl</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Control</span>.<span style="color: #660066;">LayerSwitcher</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		map.<span style="color: #660066;">addControl</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Control</span>.<span style="color: #660066;">Scale</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">var</span> center <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">LonLat</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">121.06504</span><span style="color: #339933;">,</span><span style="color: #CC0000;">14.65495</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		map.<span style="color: #660066;">setCenter</span><span style="color: #009900;">&#40;</span>center<span style="color: #339933;">,</span> <span style="color: #CC0000;">16</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>

<p>B. Google Mercator Projection</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">		window.<span style="color: #000066;">onload</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #003366; font-weight: bold;">var</span> options <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
						projection<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;EPSG:900913&quot;</span><span style="color: #339933;">,</span>
						units<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;m&quot;</span><span style="color: #339933;">,</span>
						maxResolution<span style="color: #339933;">:</span> <span style="color: #CC0000;">156543.0339</span><span style="color: #339933;">,</span>
						numZoomLevels<span style="color: #339933;">:</span> <span style="color: #CC0000;">19</span><span style="color: #339933;">,</span>
						maxExtent<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Bounds</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">12823075.86334</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">4800551.12375</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">13101918.14248</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">5021301.26141</span><span style="color: #009900;">&#41;</span>
					<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #006600; font-style: italic;">// avoid pink tiles</span>
			OpenLayers.<span style="color: #660066;">IMAGE_RELOAD_ATTEMPTS</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">3</span><span style="color: #339933;">;</span>
			OpenLayers.<span style="color: #660066;">Util</span>.<span style="color: #660066;">onImageLoadErrorColor</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;transparent&quot;</span><span style="color: #339933;">;</span>
			map <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Map</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mapdiv'</span><span style="color: #339933;">,</span>options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			sat_wms <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Layer</span>.<span style="color: #660066;">Google</span><span style="color: #009900;">&#40;</span>
						<span style="color: #3366CC;">&quot;Layer&quot;</span><span style="color: #339933;">,</span>
						<span style="color: #009900;">&#123;</span>type<span style="color: #339933;">:</span> G_SATELLITE_MAP<span style="color: #339933;">,</span><span style="color: #3366CC;">'sphericalMercator'</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			map.<span style="color: #660066;">addLayer</span><span style="color: #009900;">&#40;</span>sat_wms<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #006600; font-style: italic;">// start custom layer here</span>
			<span style="color: #003366; font-weight: bold;">var</span> layer_obj <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Layer</span>.<span style="color: #660066;">WMS</span><span style="color: #009900;">&#40;</span>
				<span style="color: #3366CC;">&quot;Beijing&quot;</span><span style="color: #339933;">,</span>
				<span style="color: #3366CC;">&quot;http://127.0.0.1/cgi-bin/mapserv&quot;</span><span style="color: #339933;">,</span>
				<span style="color: #009900;">&#123;</span>
					layers<span style="color: #339933;">:</span> <span style="color: #3366CC;">'beijing_all'</span><span style="color: #339933;">,</span>
					map<span style="color: #339933;">:</span> <span style="color: #3366CC;">'/home/map/beijing/new/beijing_google.map'</span><span style="color: #339933;">,</span>
					format<span style="color: #339933;">:</span> <span style="color: #3366CC;">'AGG'</span><span style="color: #339933;">,</span>
					<span style="color: #3366CC;">'transparent'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'true'</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			layer_obj.<span style="color: #660066;">setIsBaseLayer</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			layer_obj.<span style="color: #660066;">setVisibility</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
&nbsp;
			map.<span style="color: #660066;">addLayer</span><span style="color: #009900;">&#40;</span>layer_obj<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			map.<span style="color: #660066;">addControl</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Control</span>.<span style="color: #660066;">MousePosition</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			map.<span style="color: #660066;">addControl</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Control</span>.<span style="color: #660066;">LayerSwitcher</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			map.<span style="color: #660066;">addControl</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Control</span>.<span style="color: #660066;">Scale</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #003366; font-weight: bold;">var</span> center <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">LonLat</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">12956625.68367</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">4852316.90682</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			map.<span style="color: #660066;">setCenter</span><span style="color: #009900;">&#40;</span>center<span style="color: #339933;">,</span> <span style="color: #CC0000;">18</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span></pre></div></div>

<p>What&#8217;s the difference between both snippets? Obviously projection is one. Since most of my point data is in lon/lat, then the WGS84 example is good if I don&#8217;t want to overlay custom precise data.  Remember the x shift problem in Google with Openlayers. The Google Mercator example is used when I want to overlay more custom data, particularly polygons/line that needs to fit on Google Layers. For more details, please see my previous <a href="/wordpress/?p=129">blog post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/01/reviving-an-old-web-map-with-google-maps-via-openlayers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Passing Parameters to Mapserver</title>
		<link>/wordpress/2008/01/passing-parameters-to-mapserver/</link>
		<comments>/wordpress/2008/01/passing-parameters-to-mapserver/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 22:27:19 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[mapserver]]></category>

		<guid isPermaLink="false">/wordpress/?p=131</guid>
		<description><![CDATA[I was bitten 4 hours searching for this in the mailing list. I have a postgis layer defined in mapserver map file as follows: LAYER NAME &#34;pois&#34; STATUS DEFAULT GROUP &#34;pois&#34; TYPE POINT &#160; CONNECTIONTYPE postgis PROCESSING &#34;CLOSE_CONNECTION=DEFER&#34; CONNECTION &#34;user=lbs password=xtlme15n dbname=beijing_stat host=192.168.1.211 port=5432&#34; #DATA &#34;the_geom from (SELECT poi_id, the_geom FROM poi WHERE new_block_id =]]></description>
			<content:encoded><![CDATA[<p>I was bitten 4 hours searching for this in the mailing list. I have a postgis layer defined in mapserver map file as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="conf" style="font-family:monospace;">LAYER
        NAME &quot;pois&quot;
        STATUS DEFAULT
		GROUP &quot;pois&quot;
        TYPE POINT
&nbsp;
		CONNECTIONTYPE postgis
		PROCESSING &quot;CLOSE_CONNECTION=DEFER&quot;
		CONNECTION &quot;user=lbs password=xtlme15n dbname=beijing_stat host=192.168.1.211 port=5432&quot;
		#DATA &quot;the_geom from (SELECT poi_id, the_geom FROM poi WHERE new_block_id = 7) as foo USING UNIQUE poi_id USING SRID=4326&quot;
		DATA &quot;the_geom from poi as foo USING UNIQUE poi_id USING SRID=4326&quot;
&nbsp;
		FILTER &quot;new_block_id=%myid%&quot;
&nbsp;
		CLASS
			NAME &quot;block-pois&quot;
    		        STYLE
				SYMBOL &quot;circle&quot;
     			        COLOR 255 0 0
				SIZE 10
   			END
  		END
END</pre></div></div>

<p>Traditionally, I could append and change the FILTER attribute by passing it to the Mapserver CGI as follows:<br />
<code>map.pois.filter=new_block_id%3D700</code>.</p>
<p>Apparently, this changed with Mapserver 5.0. Please see <a href="http://trac.osgeo.org/mapserver/browser/branches/branch-5-0/mapserver/MIGRATION_GUIDE.TXT">MapServer 4.10 to 5.0 Migration Guide</a>.  Thanks to this mailing list <a href="http://www.nabble.com/Changing-map-file-parameters-via-URL-td12932745.html#a12972957">thread</a>, it turned out that <strong>we need to pass a value to a custom variable set in the mapfile for <em>security reasons</em></strong>. Hope this one, goes in to the docs. I was hoping to comment out in the Mapserver Documentation but registration is holding me off with a &#8216;Connection Refused&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/01/passing-parameters-to-mapserver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenLayers + Google Spherical Mercator Example</title>
		<link>/wordpress/2007/12/openlayers-google-spherical-mercator-example/</link>
		<comments>/wordpress/2007/12/openlayers-google-spherical-mercator-example/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 11:42:18 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[openlayers]]></category>

		<guid isPermaLink="false">/wordpress/?p=129</guid>
		<description><![CDATA[I&#8217;ve been a dormant user of OpenLayers for months (4 months?) now and it was a surprise that the svn trunk had huge differences from what I remember OL (2.4/5?) to be. One of the cool features that and the OpenLayers community contributed was the Google Speherical Mercator hack. Below is a quick step tutorial]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gisnotes.com/wordpress/wp-content/uploads/2007/12/openlayers_google.jpg" title="Road Overlay on Google Vector in Forbidden City and Tiananmen, Beijing, China"><img src="http://www.gisnotes.com/wordpress/wp-content/uploads/2007/12/openlayers_google.jpg" alt="Road Overlay on Google Vector in Forbidden City and Tiananmen, Beijing, China" /></a></p>
<p>I&#8217;ve been a dormant user of OpenLayers for months (4 months?) now and it was a surprise that the <a href="http://svn.openlayers.org/trunk/openlayers/">svn trunk</a> had huge differences from what I remember OL (2.4/5?) to be. One of the cool features that <a href="http://labs.metacarta.com/"></a> and the <a href="http://trac.openlayers.org/">OpenLayers</a> community contributed was the Google Speherical Mercator hack. Below is a quick step tutorial on how I was able to overlay a custom WMS to Google (set as the baselayer). For this tutorial, I want to overlay a road layer on top of Google.</p>
<p>1. We need to convert our data to <a href="http://trac.osgeo.org/gdal/ticket/1868">Google Projection (Spatial Reference System: 900913)</a>. This applies to whatever kind of data (mine is vector stored both in Mapinfo and PostGis) we have.  For PostGis, we need to:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> spatial_ref_sys <span style="color: #66cc66;">&#40;</span>srid<span style="color: #66cc66;">,</span> auth_name<span style="color: #66cc66;">,</span> auth_srid<span style="color: #66cc66;">,</span> proj4text<span style="color: #66cc66;">,</span> srtext<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">900913</span><span style="color: #66cc66;">,</span> 
&nbsp;
<span style="color: #ff0000;">'spatialreference.org'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">900913</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 
&nbsp;
+x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'PROJCS
&nbsp;
[&quot;unnamed&quot;,GEOGCS[&quot;unnamed ellipse&quot;,DATUM[&quot;unknown&quot;,SPHEROID[&quot;unnamed&quot;,6378137,0]],PRIMEM
&nbsp;
[&quot;Greenwich&quot;,0],UNIT[&quot;degree&quot;,0.0174532925199433]],PROJECTION[&quot;Mercator_2SP&quot;],PARAMETER
&nbsp;
[&quot;standard_parallel_1&quot;,0],PARAMETER[&quot;central_meridian&quot;,0],PARAMETER
&nbsp;
[&quot;false_easting&quot;,0],PARAMETER[&quot;false_northing&quot;,0],UNIT[&quot;Meter&quot;,1],EXTENSION
&nbsp;
[&quot;PROJ4&quot;,&quot;+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 
&nbsp;
+units=m +nadgrids=@null +wktext  +no_defs&quot;]]'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #993333; font-weight: bold;">SELECT</span> AddGeometryColumn<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'public'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'roads'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'the_geom_google'</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">900913</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'LINESTRING'</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>; 
&nbsp;
<span style="color: #993333; font-weight: bold;">UPDATE</span> roads <span style="color: #993333; font-weight: bold;">SET</span> the_geom_google <span style="color: #66cc66;">=</span> Transform<span style="color: #66cc66;">&#40;</span>the_geom<span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">900913</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>2. MapFile Settings courtesy of <a href="http://spatialreference.org/ref/user/google-projection/">SpatialReference: Google Projection</a></p>

<div class="wp_syntax"><div class="code"><pre class="conf" style="font-family:monospace;">WEB
    #Other Web Config Settings goes here...
    &quot;wms_srs&quot;              &quot;EPSG:900913&quot;
END
&nbsp;
PROJECTION
    &quot;+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs&quot;
END</pre></div></div>

<p>3. By ensuring that Mapserver has the new 900913 projection, problems such as <em>&#8220;msWMSLoadGetMapParams(): WMS server error. Invalid SRS given : SRS must be valid for all requested layers.&#8221;</em> or <em><a href="http://mapserver.gis.umn.edu/docs/error/proj-init-file">&#8220;msProcessProjection(): Projection library error. no options found in &#8216;init&#8217; file&#8221;</a></em> will be avoided.</p>

<div class="wp_syntax"><div class="code"><pre class="conf" style="font-family:monospace;">cd /ms4w/proj/nad/
gvim epsg
# GCS Voirol 1875 Degree
&amp;lt;104304&amp;gt; +proj=longlat +a=6378249.2 +b=6356514.999904194  no_defs &amp;lt;&amp;gt;
# GCS Voirol Unifie 1960 Degree
&amp;lt;104305&amp;gt; +proj=longlat +ellps=clrk80  no_defs &amp;lt;&amp;gt;
# Google Spherical Mercator
. . .
&amp;lt;900913&amp;gt; +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs</pre></div></div>

<p>4. Below is an example WMS Request. Note: &#8220;SRS=EPSG 900913&#8243; is added; TRANSPARENT=true not TRANSPARENT=on; Check your BBOX settings for the correct extent.</p>

<div class="wp_syntax"><div class="code"><pre class="conf" style="font-family:monospace;">http://127.0.0.1/cgi-bin/mapserv?
LAYERS=beijing_all
&amp;amp;MAP=%2Fhome%2Fmap%2Fbeijing%2Fnew%2Fbeijing_google.map
&amp;amp;FORMAT=AGG
&amp;amp;TRANSPARENT=true
&amp;amp;SERVICE=WMS&amp;amp;VERSION=1.1.1&amp;amp;REQUEST=GetMap
&amp;amp;STYLES=
&amp;amp;EXCEPTIONS=application%2Fvnd.ogc.se_inimage
&amp;amp;SRS=EPSG%3A900913
&amp;amp;BBOX=12956687.788758555,4852222.554861524,12956993.536871642,4852528.30297461
&amp;amp;WIDTH=256&amp;amp;HEIGHT=256</pre></div></div>

<p>5. Requesting the WMS from OpenLayers.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">	<span style="color: #003366; font-weight: bold;">var</span> options <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
			projection<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;EPSG:900913&quot;</span><span style="color: #339933;">,</span>
			units<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;m&quot;</span><span style="color: #339933;">,</span>
			<span style="color: #006600; font-style: italic;">//maxResolution: 156543.0339,</span>
			numZoomLevels<span style="color: #339933;">:</span> <span style="color: #CC0000;">18</span><span style="color: #339933;">,</span>
			maxExtent<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Bounds</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">12823075.86334</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">4800551.12375</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">13101918.14248</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">021301.26141</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">// avoid pink tiles</span>
	OpenLayers.<span style="color: #660066;">IMAGE_RELOAD_ATTEMPTS</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">3</span><span style="color: #339933;">;</span>
	OpenLayers.<span style="color: #660066;">Util</span>.<span style="color: #660066;">onImageLoadErrorColor</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;transparent&quot;</span><span style="color: #339933;">;</span>
	map <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Map</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mapdiv'</span><span style="color: #339933;">,</span>options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	sat_wms <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Layer</span>.<span style="color: #660066;">Google</span><span style="color: #009900;">&#40;</span>
				<span style="color: #3366CC;">&quot;Layer&quot;</span><span style="color: #339933;">,</span>
				<span style="color: #009900;">&#123;</span>type<span style="color: #339933;">:</span> G_SATELLITE_MAP<span style="color: #339933;">,</span><span style="color: #3366CC;">'sphericalMercator'</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	map.<span style="color: #660066;">addLayer</span><span style="color: #009900;">&#40;</span>sat_wms<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">// start custom layer here</span>
	<span style="color: #003366; font-weight: bold;">var</span> layer_obj <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Layer</span>.<span style="color: #660066;">WMS</span><span style="color: #009900;">&#40;</span>
		<span style="color: #3366CC;">&quot;Beijing&quot;</span><span style="color: #339933;">,</span>
		<span style="color: #3366CC;">&quot;http://127.0.0.1/cgi-bin/mapserv&quot;</span><span style="color: #339933;">,</span>
		<span style="color: #009900;">&#123;</span>
			layers<span style="color: #339933;">:</span> <span style="color: #3366CC;">'beijing_all'</span><span style="color: #339933;">,</span>
			map<span style="color: #339933;">:</span> <span style="color: #3366CC;">'/home/map/beijing/new/beijing_google.map'</span><span style="color: #339933;">,</span>
			format<span style="color: #339933;">:</span> <span style="color: #3366CC;">'AGG'</span><span style="color: #339933;">,</span>
			<span style="color: #3366CC;">'transparent'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'true'</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	layer_obj.<span style="color: #660066;">setIsBaseLayer</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	layer_obj.<span style="color: #660066;">setVisibility</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
&nbsp;
        map.<span style="color: #660066;">addLayer</span><span style="color: #009900;">&#40;</span>layer_obj<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	map.<span style="color: #660066;">addControl</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Control</span>.<span style="color: #660066;">MousePosition</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	map.<span style="color: #660066;">addControl</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Control</span>.<span style="color: #660066;">LayerSwitcher</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	map.<span style="color: #660066;">addControl</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Control</span>.<span style="color: #660066;">Scale</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> center <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">LonLat</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">12956625.68367</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">4852316.90682</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	map.<span style="color: #660066;">setCenter</span><span style="color: #009900;">&#40;</span>center<span style="color: #339933;">,</span> <span style="color: #CC0000;">17</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>/wordpress/2007/12/openlayers-google-spherical-mercator-example/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>GIS 2.0</title>
		<link>/wordpress/2007/12/gis-20/</link>
		<comments>/wordpress/2007/12/gis-20/#comments</comments>
		<pubDate>Fri, 21 Dec 2007 02:48:10 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mapserver]]></category>
		<category><![CDATA[openlayers]]></category>
		<category><![CDATA[postgis]]></category>
		<category><![CDATA[postgres]]></category>

		<guid isPermaLink="false">/wordpress/?p=127</guid>
		<description><![CDATA[It&#8217;s been a long time since my previous blog post because I was caught up with numerous meetings and presentations with the recent development of &#8220;The Interface&#8220;. Developing the new beast during a 2.5 week code sprint is both enjoyable and a personal satisfaction. I have to give credit to Yahoo UI and ExtJS for]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a long time since my previous blog post because  I was caught up with numerous meetings and presentations with the recent development of <strong>&#8220;<em>The Interface</em>&#8220;</strong>.  Developing the new beast during a 2.5 week code sprint is both enjoyable and a personal satisfaction. I have to give credit to <a href="http://developer.yahoo.com/yui/">Yahoo UI</a> and <a href="http://www.extjs.com">ExtJS</a> for a wonderful javascript library that they opened to the public.  Without ExtJS, I don&#8217;t think it would be possible to create such an interactive, compelling and impressive interface for my demos.</p>
<p>Web 2.0 has given me a chance to wrap our traditional GIS processes/solutions into a high impact presentation for our marketing/business developments. Thus, it was not a suprise to see that <a href="http://trac.mapfish.org/">CamptoCamp&#8217;s Mapfish</a> is also using extjs. It has aided me very well in data analysis and visualisation.  It may just be a meaningless term to others, however I believe we just entered the start of GIS 2.0&#8230;</p>
<p>Reflecting&#8230; I believe it is worth investing in learning PostGIS in-depth.  Though it may appear fascinating to others that a group of small applications (which I called the core platform utilising <em>Nearest Neighbor Searching</em> and <em>Geometric Unions</em>) bundled together in a Web2.0 interface is impressive, I believe I only scratched the surface of <em>what</em> and <em>how</em> PostGIS should be used. I wanted to do more, but my busy work schedule begs to finish other components of our product.</p>
<p>To be continued&#8230;</p>
<p><a href="http://www.gisnotes.com/wordpress/wp-content/uploads/2007/12/interface-small.png" title="The Interface"><img src="http://www.gisnotes.com/wordpress/wp-content/uploads/2007/12/interface-small.png" alt="The Interface" /></a></p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2007/12/gis-20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Geometric Algorithms in GIS</title>
		<link>/wordpress/2007/11/geometric-algorithms-in-gis/</link>
		<comments>/wordpress/2007/11/geometric-algorithms-in-gis/#comments</comments>
		<pubDate>Fri, 16 Nov 2007 10:33:31 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[GIS]]></category>
		<category><![CDATA[gis]]></category>

		<guid isPermaLink="false">/wordpress/?p=122</guid>
		<description><![CDATA[Here is a couple of Geometric Algorithms used in GIS. Convex hull problem: for a set of points, determine the smallest convex set that contains all. Line segment intersection: for a set of line segments, determine all intersections. Voronoi diagram computation: for a set of points, determine the subdivision of the plane into cells such]]></description>
			<content:encoded><![CDATA[<p>Here is a couple of Geometric Algorithms used in GIS.</p>
<blockquote>
<ul>
<li><strong>Convex hull</strong> problem: for a set of points, determine the smallest convex set that contains all.</li>
<li><strong>Line segment intersection</strong>: for a set of line segments, determine all intersections.</li>
<li><strong>Voronoi diagram</strong> computation: for a set of points, determine the subdivision of the plane into cells such that inside some cell, one and the same point of the set is closest.</li>
<li><strong>Delaunay triangulation</strong>: for a set of points, determine a planar subdivision by creating edges between the input points in such a way that no two edges intersect, all faces are triangles, no more edges can be added with the given constraints, and no circumcircle of any triangle contains an input point in its interior.</li>
<li><strong>Minkowski sum</strong>: for two simple polygons P and Q, compute the shape that consist exactly of the sum of all points of P and all points of Q, where sum is interpreted as the vector sum.</li>
<li><strong>Rectangular range search</strong>: for a set of points in the plane, design a data structure on those points, such that for every axis-parallel query rectangle, all points in the data structure that lie in the query rectangle can be reported efficiently. Algorithms are needed for the construction of the data structure and for the execution of a query.</li>
</ul>
</blockquote>
<p><a href="http://www.gisnotes.com/wordpress/wp-content/uploads/2007/11/2007-11-16_062422.png" title="2007-11-16_062422.png"><img src="http://www.gisnotes.com/wordpress/wp-content/uploads/2007/11/2007-11-16_062422.png" alt="2007-11-16_062422.png" /></a></p>
<p>Reference:<br />
M Kreveld, <a href="http://www.gisnotes.com/wordpress/wp-content/uploads/2007/11/kreveldcggis.pdf" title="Computational Geometry: Its objectives and relation to GIS">Computational Geometry: Its objectives and relation to GIS</a>, Institute of Information and Computing Sciences, Utrecht University</p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2007/11/geometric-algorithms-in-gis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing R on Windows and Debian</title>
		<link>/wordpress/2007/11/installing-r-on-windows-and-debian/</link>
		<comments>/wordpress/2007/11/installing-r-on-windows-and-debian/#comments</comments>
		<pubDate>Fri, 16 Nov 2007 01:15:59 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[R]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[postgis]]></category>
		<category><![CDATA[postgres]]></category>

		<guid isPermaLink="false">/wordpress/?p=121</guid>
		<description><![CDATA[&#8216;R&#8217; is a statistical package. For an overview, please go to www.r-project.org My intention was to remove the point outliers from a given set of point geometries. I just recently installed R both on my Windows XP and Debian. Regina&#8217;s www.bostongis.com is an excellent tutorial in getting involved with R. I do suggest you head]]></description>
			<content:encoded><![CDATA[<p><strong>&#8216;R&#8217;</strong> is a statistical package. For an overview, please go to <a href="www.r-project.org">www.r-project.org</a><br />
My intention was to remove the point outliers from a given set of point geometries.</p>
<p>I just recently installed R both on my Windows XP and Debian.  Regina&#8217;s <a href="www.bostongis.com">www.bostongis.com </a> is an excellent tutorial in getting involved with <strong>R</strong>. I do suggest you head first to  <a href="http://www.bostongis.com/PrinterFriendly.aspx?content_name=postgresql_plr_tut01">PLR Part 1: Up and Running with PL/R (PLR) in PostgreSQL: An almost Idiot&#8217;s Guide </a> to get you started.</p>
<p>The install instructions for Windows works flawlessly. I have to hold back to R-2.5 though as I plan to use RPy (Python for R), see details below. To install <strong>&#8216;R&#8217;</strong> in Debian, there&#8217;s a couple of settings that we need to take care of&#8230;</p>
<p>1. Install r-base<br />
<code>sudo apt-get install r-base</code></p>
<p>2. Install plr on postgres<br />
<code>sudo apt-get install postgresql-8.2-plr</code></p>
<p>3. Using R in a database<br />
<code>psql -d beijing -U lbs -h 127.0.0.1 &lt; /usr/share/postgresql/8.2/plr.sql</code></p>
<p>4. Set the R_HOME environment variable<br />
<code>/etc/postgresql/8.2/main/environment</code><br />
<code>R_HOME='/usr/lib/R'</code></p>
<p>5. Restart Debian.</p>
<p><strong>RPy</strong>, R for Python, is another alternative to use R in Python. I installed it both in Windows and Debian. Note that I reverted to R-2.5 on Windows to be compatible with RPy. For Debian, Im currently using R-2.6.</p>
<p>For the Windows Binary Installation,</p>
<p>1. Read the <a href="http://rpy.sourceforge.net/rpy/README">RPy Main Site</a></p>
<p>2. Install prerequisites:</p>
<p>- <a href="http://jaist.dl.sourceforge.net/sourceforge/numpy/numpy-1.0.4.win32-py2.5.msi">NumPy</a><br />
- <a href="http://sourceforge.net/project/showfiles.php?group_id=78018">Win32 Extensions Download</a></p>
<p>3. Afterwards, install the main package, <a href="http://nchc.dl.sourceforge.net/sourceforge/rpy/rpy-1.0-RC3.win32-R2.0.0-R-2.5.1-py2.5.exe">RPy Download</a></p>
<p>In Debian, its a straight forward&#8230;<code>sudo apt-get install python-rpy</code></p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2007/11/installing-r-on-windows-and-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
