<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>MapWrecker 2.0 &#187; Uncategorized</title>
	<atom:link href="http://mapwrecker.wordpress.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://mapwrecker.wordpress.com</link>
	<description>AJAX, Maps, .NET, and Destruction</description>
	<lastBuildDate>Tue, 24 Nov 2009 14:46:32 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='mapwrecker.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/8c7f1cdef6e1967b12e6d1ba643dd690?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>MapWrecker 2.0 &#187; Uncategorized</title>
		<link>http://mapwrecker.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mapwrecker.wordpress.com/osd.xml" title="MapWrecker 2.0" />
		<item>
		<title>Using SQL-Geometry with SSIS Import/Export Tasks</title>
		<link>http://mapwrecker.wordpress.com/2009/03/06/using-sql-geometry-with-ssis-importexport-tasks/</link>
		<comments>http://mapwrecker.wordpress.com/2009/03/06/using-sql-geometry-with-ssis-importexport-tasks/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 15:07:06 +0000</pubDate>
		<dc:creator>Bill Thorp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mapwrecker.wordpress.com/?p=129</guid>
		<description><![CDATA[I know I shouldn&#8217;t be looking at these things before coffee.  Still, when a SQL Import task complained about my Geometry column type, I tried to fix this.
I editted my &#8220;C:\Program Files\Microsoft SQL Server\100\DTS\MappingFiles\MSSQLToSSIS10.XML&#8221; file, duplicating the entry for varbinary(max), but changing the data type name to &#8220;geometry.&#8221;
Bingo.  Everything now seems to copy fine.
  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=129&subd=mapwrecker&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I know I shouldn&#8217;t be looking at these things before coffee.  Still, when a SQL Import task complained about my Geometry column type, I tried to fix this.</p>
<p>I editted my &#8220;C:\Program Files\Microsoft SQL Server\100\DTS\MappingFiles\MSSQLToSSIS10.XML&#8221; file, duplicating the entry for varbinary(max), but changing the data type name to &#8220;geometry.&#8221;</p>
<p>Bingo.  Everything now seems to copy fine.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mapwrecker.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mapwrecker.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mapwrecker.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mapwrecker.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mapwrecker.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mapwrecker.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mapwrecker.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mapwrecker.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mapwrecker.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mapwrecker.wordpress.com/129/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=129&subd=mapwrecker&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mapwrecker.wordpress.com/2009/03/06/using-sql-geometry-with-ssis-importexport-tasks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e68cbde5dbc158d8eceab62caa6fb19f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bill Thorp</media:title>
		</media:content>
	</item>
		<item>
		<title>Palm Springs Hotels?</title>
		<link>http://mapwrecker.wordpress.com/2009/02/18/palm-springs-hotels/</link>
		<comments>http://mapwrecker.wordpress.com/2009/02/18/palm-springs-hotels/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 21:15:37 +0000</pubDate>
		<dc:creator>Bill Thorp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mapwrecker.wordpress.com/?p=123</guid>
		<description><![CDATA[I&#8217;m attending the ESRI Developers Conference for the first time ever, and was hunting for hotel suggestions.  There are comments on James Fee&#8217;s blog from last year that recommend Zoso over the Wyndham.  TripAdvisor skews towards the tiny romatic places&#8230; any recommandations on a cheaper place for the barely-under 30 crowd?
     [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=123&subd=mapwrecker&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m attending the ESRI Developers Conference for the first time ever, and was hunting for hotel suggestions.  There are <a href="http://www.spatiallyadjusted.com/2008/01/14/esri-business-bpdev-summit-hotels-sold-out/">comments on James Fee&#8217;s blog</a> from last year that recommend Zoso over the Wyndham.  <a href="http://www.tripadvisor.com/Hotels-g32847-Palm_Springs_California-Hotels.html">TripAdvisor</a> skews towards the tiny romatic places&#8230; any recommandations on a cheaper place for the barely-under 30 crowd?</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mapwrecker.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mapwrecker.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mapwrecker.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mapwrecker.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mapwrecker.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mapwrecker.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mapwrecker.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mapwrecker.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mapwrecker.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mapwrecker.wordpress.com/123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=123&subd=mapwrecker&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mapwrecker.wordpress.com/2009/02/18/palm-springs-hotels/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e68cbde5dbc158d8eceab62caa6fb19f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bill Thorp</media:title>
		</media:content>
	</item>
		<item>
		<title>Awesome Job in Fort Collins, CO</title>
		<link>http://mapwrecker.wordpress.com/2008/12/18/awesome-job-in-fort-collins-co/</link>
		<comments>http://mapwrecker.wordpress.com/2008/12/18/awesome-job-in-fort-collins-co/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 14:48:13 +0000</pubDate>
		<dc:creator>Bill Thorp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mapwrecker.wordpress.com/?p=118</guid>
		<description><![CDATA[Earn ~$70k, 5 weeks vacation, 3 weeks sick, with awesome people, for a good cause (the National Parks Service).  Take my old job.  Deadline is the 22nd.
http://www.cemml.colostate.edu/Jobs/351.pdf
Please forward / link this post!!
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=118&subd=mapwrecker&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Earn ~$70k, 5 weeks vacation, 3 weeks sick, with awesome people, for a good cause (the National Parks Service).  Take my old job.  Deadline is the 22nd.</p>
<p><a href="http://www.cemml.colostate.edu/Jobs/351.pdf" target="_blank">http://www.cemml.colostate.edu/Jobs/351.pdf</a></p>
<p>Please forward / link this post!!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mapwrecker.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mapwrecker.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mapwrecker.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mapwrecker.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mapwrecker.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mapwrecker.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mapwrecker.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mapwrecker.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mapwrecker.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mapwrecker.wordpress.com/118/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=118&subd=mapwrecker&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mapwrecker.wordpress.com/2008/12/18/awesome-job-in-fort-collins-co/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e68cbde5dbc158d8eceab62caa6fb19f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bill Thorp</media:title>
		</media:content>
	</item>
		<item>
		<title>Google&#8217;s &#8220;Native Client&#8221; Browser Plugin</title>
		<link>http://mapwrecker.wordpress.com/2008/12/10/googles-native-client-browser-plugin/</link>
		<comments>http://mapwrecker.wordpress.com/2008/12/10/googles-native-client-browser-plugin/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 22:10:33 +0000</pubDate>
		<dc:creator>Bill Thorp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mapwrecker.wordpress.com/?p=115</guid>
		<description><![CDATA[The blogs are abuzz today with Google&#8217;s new cross-browser, cross-platform plugin that allows native x86 code to be run from a browser with minimal code tweaking.
Called Native Client, its complete with sandboxing, Javascript interop, a Quake demo and &#8230;  Yet Another Globe Application!!

This really escalates the Javascript / Flash / Silverlight wars&#8230;. x86?!
Hello OpenGL, goodbye [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=115&subd=mapwrecker&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The blogs are abuzz today with Google&#8217;s new cross-browser, cross-platform plugin that allows native x86 code to be run from a browser with minimal code tweaking.</p>
<p>Called <a href="http://code.google.com/p/nativeclient/">Native Client</a>, its complete with sandboxing, Javascript interop, a Quake demo and &#8230;  <strong>Yet Another Globe Application!!</strong></p>
<p><img class="alignnone size-full wp-image-116" title="naclapp" src="http://mapwrecker.files.wordpress.com/2008/12/naclapp.jpg?w=450&#038;h=469" alt="naclapp" width="450" height="469" /></p>
<p>This really escalates the Javascript / Flash / Silverlight wars&#8230;. x86?!</p>
<p>Hello OpenGL, goodbye vector drawing performance woes.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mapwrecker.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mapwrecker.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mapwrecker.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mapwrecker.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mapwrecker.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mapwrecker.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mapwrecker.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mapwrecker.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mapwrecker.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mapwrecker.wordpress.com/115/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=115&subd=mapwrecker&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mapwrecker.wordpress.com/2008/12/10/googles-native-client-browser-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e68cbde5dbc158d8eceab62caa6fb19f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bill Thorp</media:title>
		</media:content>

		<media:content url="http://mapwrecker.files.wordpress.com/2008/12/naclapp.jpg" medium="image">
			<media:title type="html">naclapp</media:title>
		</media:content>
	</item>
		<item>
		<title>Fast SQL&#8217;08 Geometry Insertion</title>
		<link>http://mapwrecker.wordpress.com/2008/11/25/fast-sql08-geometry-insertion/</link>
		<comments>http://mapwrecker.wordpress.com/2008/11/25/fast-sql08-geometry-insertion/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 16:32:58 +0000</pubDate>
		<dc:creator>Bill Thorp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mapwrecker.wordpress.com/?p=96</guid>
		<description><![CDATA[If you&#8217;re inserting SQL&#8217;08 Native Spatial Datatypes into a brand new table, favor SqlBulkCopy over Insert. Its ridiculously faster. Below is some reduced code to show the basic idea:

// use minimal transaction logging during upload
new SqlCommand("alter database [" + dbName + "] SET RECOVERY BULK_LOGGED", connection).ExecuteNonQuery();

// create and a datatable of points
DataTable dt = new [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=96&subd=mapwrecker&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you&#8217;re inserting SQL&#8217;08 Native Spatial Datatypes into a brand new table, favor SqlBulkCopy over Insert. Its ridiculously faster. Below is some reduced code to show the basic idea:</p>
<div style="overflow:scroll;text-align:left;">
<pre><code>// use minimal transaction logging during upload
new SqlCommand("alter database [" + dbName + "] SET RECOVERY BULK_LOGGED", connection).ExecuteNonQuery();

// create and a datatable of points
DataTable dt = new DataTable();
dt.Columns.Add("Shape", typeof(SqlGeometry));

// populate your SqlGeometry
dt = magicFunction_fillMyDataTableWithGeometry();

// copy data, use batches and tablelock to ensure small minimal transaction log sizes
using (SqlBulkCopy sbc = new SqlBulkCopy(connectionString(dbName), SqlBulkCopyOptions.TableLock))
{
    sbc.DestinationTableName = tableName;
    sbc.BatchSize = 10000;
    sbs.ColumnMappings.Add("Shape", "Shape");
    sbc.WriteToServer(dt);
    sbc.Close();
}

// use normal transaction logging after upload
new SqlCommand("alter database [" + dbName + "] SET RECOVERY FULL", connection).ExecuteNonQuery();
</code></pre>
</div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mapwrecker.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mapwrecker.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mapwrecker.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mapwrecker.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mapwrecker.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mapwrecker.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mapwrecker.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mapwrecker.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mapwrecker.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mapwrecker.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=96&subd=mapwrecker&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mapwrecker.wordpress.com/2008/11/25/fast-sql08-geometry-insertion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e68cbde5dbc158d8eceab62caa6fb19f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bill Thorp</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP.NET MVC + Ext + WCF &#8230; v2.0</title>
		<link>http://mapwrecker.wordpress.com/2008/11/14/aspnet-mvc-ext-wcf-v20/</link>
		<comments>http://mapwrecker.wordpress.com/2008/11/14/aspnet-mvc-ext-wcf-v20/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 20:45:10 +0000</pubDate>
		<dc:creator>Bill Thorp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mapwrecker.wordpress.com/?p=83</guid>
		<description><![CDATA[My last post on wiring up JSON to ASP.NET MVC showed how to use an ActionFilter to deserialize JSON into .NET objects.  However, using a custom IModelBinder is a cleaner and in many ways the more correct solution:

using System;
using System.Web.Mvc;
using System.Text;
using System.Xml;
using System.Runtime.Serialization.Json;

namespace NRPC.Citation.Web.Controllers
{
    public class JsonBinderAttribute : CustomModelBinderAttribute
	{
		public override IModelBinder GetBinder()
		{
			return [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=83&subd=mapwrecker&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>My <a href="http://mapwrecker.wordpress.com/2008/11/14/aspnet-mvc-ext-wcf/">last post</a> on wiring up JSON to ASP.NET MVC showed how to use an ActionFilter to deserialize JSON into .NET objects.  However, using a custom IModelBinder is a cleaner and in many ways the more correct solution:</p>
<div style="overflow:scroll;width:100%;text-align:left;">
<pre><code>using System;
using System.Web.Mvc;
using System.Text;
using System.Xml;
using System.Runtime.Serialization.Json;

namespace NRPC.Citation.Web.Controllers
{
    public class JsonBinderAttribute : CustomModelBinderAttribute
	{
		public override IModelBinder GetBinder()
		{
			return new JsonModelBinder();
		}

        public class JsonModelBinder : IModelBinder
        {
            public ModelBinderResult BindModel(ModelBindingContext bindingContext)
            {
                Encoding requestEncoding = bindingContext.HttpContext.Request.ContentEncoding;
                byte[] stringBytes = requestEncoding.GetBytes(bindingContext.HttpContext.Request.Form[bindingContext.ModelName]);
                XmlDictionaryReader rdr = JsonReaderWriterFactory.CreateJsonReader(stringBytes, XmlDictionaryReaderQuotas.Max);
                object o = new DataContractJsonSerializer(bindingContext.ModelType).ReadObject(rdr);
                return new ModelBinderResult(o);
            }
        }
	}
}
</code></pre>
</div>
<div style="overflow:scroll;width:100%;text-align:left;">
<pre><code>public ActionResult postDTO([JsonBinder]GridStateDTO colState){ ... }
</code></pre>
</div>
<div style="overflow:scroll;width:100%;text-align:left;">
<pre><code>    Ext.Ajax.request({
        url: '/myURL.mvc/postDTO',
        success: success,
        failure: failure,
        params: { 'colState': strDTO }
    });
</code></pre>
</div>
<p>Note how in this case I&#8217;m passing the JSON as a form value.  This is notable in part because the code in my last post assumed the entire post body was JSON; while this code can co-exist with other form data.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mapwrecker.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mapwrecker.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mapwrecker.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mapwrecker.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mapwrecker.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mapwrecker.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mapwrecker.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mapwrecker.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mapwrecker.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mapwrecker.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=83&subd=mapwrecker&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mapwrecker.wordpress.com/2008/11/14/aspnet-mvc-ext-wcf-v20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e68cbde5dbc158d8eceab62caa6fb19f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bill Thorp</media:title>
		</media:content>
	</item>
		<item>
		<title>Json rtrees, part 2</title>
		<link>http://mapwrecker.wordpress.com/2008/11/03/json-rtrees-part-2/</link>
		<comments>http://mapwrecker.wordpress.com/2008/11/03/json-rtrees-part-2/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 14:52:23 +0000</pubDate>
		<dc:creator>Bill Thorp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mapwrecker.wordpress.com/?p=69</guid>
		<description><![CDATA[In my previous post, I talked about using r-trees in JavaScript for fast client-side spatial indexing.  The idea is a mixed bag.  Its speedy enough to query tens-of-thousands of records in real time; the problem is that you can&#8217;t feed it tens-of-thousands of bounding-boxes quick enough.
The author of the original Java library, Robert Olofsson, was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=69&subd=mapwrecker&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In my <a href="http://mapwrecker.wordpress.com/2008/10/12/json-rtrees/">previous post</a>, I talked about using r-trees in JavaScript for fast client-side spatial indexing.  The idea is a mixed bag.  Its speedy enough to query tens-of-thousands of records in real time; the problem is that you can&#8217;t feed it tens-of-thousands of bounding-boxes quick enough.</p>
<p>The author of the original Java library, Robert Olofsson, was kind enough to host my C# port.  Either way, you can grab <a href="http://www.khelekore.org/prtree/prtree_cs.zip">my port</a> or visit the <a href="http://www.khelekore.org/prtree/">project page</a> for more info.  Robert was also kind enough to let me leave the Json serialization code in.   :c)</p>
<p>In .NET you&#8217;d generate the Json r-tree something like this:</p>
<div style="overflow:scroll;width:100%;text-align:left;">
<pre><code>PRTree&lt;NamedPoint&gt; tree = new PRTree&lt;NamedPoint&gt;(new NamedPointConverter(), 4);
List&lt;NamedPoint&gt; points = getRandomPointData();
tree.load(points);

StringBuilder sb = new StringBuilder();
sb.Append("var </code><code>myJsonRtree</code><code>=");
tree.getRoot().toJSON(sb, new NamedPointConverter(), "{0:#.####}");
sb.Append(";");
</code></pre>
</div>
<p>And in JS you&#8217;d query the Json r-tree something like this:</p>
<div style="overflow:scroll;width:100%;text-align:left;">
<pre><code>var walkTree = function(node, searchArea, results) {
 if (node.i != undefined) {
  if (!(node.b[0] &lt; searchArea[0] || node.b[0] &gt; searchArea[2] || node.b[1] &lt; searchArea[1] || node.b[1] &gt; searchArea[3]))
   results.push(node.i);
 }else {
  if (!(node.b[2] &lt; searchArea.minx || node.b[0] &gt; searchArea.maxx || node.b[3] &lt; searchArea.miny || node.b[1] &gt; searchArea.maxy)) {
   var s = node.c.length - 1;
   for (var i = 0; i &lt;= s; i++)
    walkTree(node.c[i], searchArea, results);
  }
 }
}

results = [];
var searchArea = [-180, -180, 180, 180];
walkTree(myJsonRtree, searchArea, results);
</code></pre>
</div>
<p>Special thanks also to <a href="http://www.nateirwin.net/">Nate Irwin</a>, for not treating me like I was crazy when I suggested client-side spatial indexing as a good idea.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mapwrecker.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mapwrecker.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mapwrecker.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mapwrecker.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mapwrecker.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mapwrecker.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mapwrecker.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mapwrecker.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mapwrecker.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mapwrecker.wordpress.com/69/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=69&subd=mapwrecker&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mapwrecker.wordpress.com/2008/11/03/json-rtrees-part-2/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e68cbde5dbc158d8eceab62caa6fb19f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bill Thorp</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Mercator Tiles in ESRI&#8217;s ArcWeb Flex API</title>
		<link>http://mapwrecker.wordpress.com/2008/04/28/using-mercator-tiles-in-esris-arcweb-flex-api/</link>
		<comments>http://mapwrecker.wordpress.com/2008/04/28/using-mercator-tiles-in-esris-arcweb-flex-api/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 21:56:33 +0000</pubDate>
		<dc:creator>Bill Thorp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mapwrecker.wordpress.com/?p=55</guid>
		<description><![CDATA[I extended ESRI&#8217;s ArcWeb Flex API&#8217;s RasterTileLayer class which normally supports only geographic tile layouts, and made it work with Mercator.  Picture a lot of trial and error, and a few functioning yet not working tile-layouts that were plain silly. 
ESRI&#8217;s ArcWeb Flex API supports making web maps from ArcWeb data-sources and from some custom data-sources [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=55&subd=mapwrecker&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I extended ESRI&#8217;s ArcWeb Flex API&#8217;s RasterTileLayer class which normally supports only geographic tile layouts, and made it work with Mercator.  Picture a lot of trial and error, and a few functioning yet not working tile-layouts that were plain silly. </p>
<p>ESRI&#8217;s ArcWeb Flex API supports making web maps from ArcWeb data-sources and from some custom data-sources such as ArcIMS and ArcGIS Server.  A couple of code-samples infer that writing your own custom imagery provider is easy.  But I wouldn&#8217;t call it easy.  The ArcWeb Flex API is closed source, the documentation extends only to public methods/properties, and does not cover all classes in the API.</p>
<p>Luckily, there are ways of digging.  The Flex API ships as an SWC file &#8212; a compiled Flash/Flex library.  These files are well known to be ZIP files containing a CATALOG.XML file.  This catalog file lists all of the class names in the API along with dependency classes.  Its a more convenient way of getting to know the hidden API than blindly exploring the &#8220;import com.esri.awx&#8230;&#8221; intellisense code-hints available within Flex Builder.</p>
<p>Once you&#8217;ve found an interesting class, cross your fingers and pray that its implementation is obvious.  Again, code-hinting goes a long way.  Its trivial to instantiate a class and see what public methods and properties are available.  Sub-class using the &#8221;extends&#8221; keyword and you&#8217;ll gain access to the internal and protected property and method names.  Within the Flex API, the class names, code-hinting, etc. are usually descriptive enough to get by.</p>
<p>When the path is less clear, you&#8217;ll need to use Flex&#8217;s debugging to find your way.  I eventually sub-classed and overrode every class method/getter/setter with a simple call to the super-class.  This allowed me to follow the logical order of method calls, and keep an eye on the Flex debug Variables at every step of the class&#8217;s lifecycle.</p>
<p>Did I mention trial-and-error?  I still don&#8217;t know how or why some of the code I wrote works.  To me, the math hacks are what makes this cool &#8230; we say the earth is 360&#215;360 to make things square, but fudge the latitude to fix tile Y-positioning.</p>
<div style="overflow:scroll;width:100%;text-align:left;"><code>
<pre>

package com.esri.aws.awx.map.layers
{
	import com.esri.aws.awx.map.projection.*;
	import com.esri.aws.awx.map.layers.tiles.*;

	public class MercatorTileLayer extends RasterTileLayer
	{
		private var _mercLayout : ITileLayout;

		public function MercatorTileLayer()
		{
			m_scheme =  new ClientPowerOfTwoTilingSchemeImpl(true, 17, 256, 256, 1, 1, -180, -180, 180, 180, "");
			m_tileLayout = _mercLayout = new MercatorTileLayout(m_scheme);
		}

		override protected function commitProperties():void{
			m_schemes[dataSource] = m_scheme; // setting m_schemes[] seems to prevent m_scheme resets
			super.commitProperties(); // This still resets m_tileLayout, I can't figure a way around it
			m_tileLayout = _mercLayout; // So we'll fix m_tileLayout ourselves
        }

		override public function get supportedProjections():Array
		{
			return [ProjUtils.PROJECTION_STYLE_MERCATOR];
		}

		override protected function constructUrl(tileKey:TileKey, token:String):String{
			return "http://localhost./TileServer/" + dataSource + "/" + getZoomString( tileKey ) + ".ashx";
		}

	}
}
</pre>
<p></code></div>
<div style="overflow:scroll;width:100%;text-align:left;"><code>
<pre>

package com.esri.aws.awx.map.layers.tiles
{
	public class MercatorTileLayout extends TileLayoutImpl implements ITileLayout
	{
		internal static var toDegrees:Number = 180.0 / Math.PI;
		internal static var toRadians:Number = Math.PI / 180.0; 

		public function MercatorTileLayout(tilingScheme:ITilingScheme)
		{
			super(tilingScheme);
		}

		override public function determineTilesForView(list:TilesList, centerX:Number, centerY:Number, mapScale:Number, displayWidth:int, displayHeight:int):TilesList
		{
			if (centerY &gt; 85.05113) centerY = 85.05113;
			if (centerY &lt; -85.05113) centerY = -85.05113;

			centerY = centerY * toRadians;
			centerY = Math.log( Math.abs(Math.tan( (Math.PI/4) + (centerY/2) )) );
			centerY = centerY * toDegrees;

			return super.determineTilesForView(list, centerX, centerY, mapScale, displayWidth, displayHeight);
		}

	}
}
</pre>
<p></code></div>
<p>One final note is that this won&#8217;t get you too far using Google or Microsoft&#8217;s Mercator tiles.  Flash famously has the ability to bypass cross-domain restrictions using CrossDomain.xml files.  Lesser known is Flash&#8217;s lameness in using images across domains.  You oddly cannot smooth/resize/alter an image loaded from another domain without a CrossDomain.xml file.  The Flex API does image smoothing and resizing, so no-go for commercial imagery providers without crossdomain.xml files.  Ridiculous!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mapwrecker.wordpress.com/55/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mapwrecker.wordpress.com/55/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mapwrecker.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mapwrecker.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mapwrecker.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mapwrecker.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mapwrecker.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mapwrecker.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mapwrecker.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mapwrecker.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mapwrecker.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mapwrecker.wordpress.com/55/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=55&subd=mapwrecker&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mapwrecker.wordpress.com/2008/04/28/using-mercator-tiles-in-esris-arcweb-flex-api/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e68cbde5dbc158d8eceab62caa6fb19f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bill Thorp</media:title>
		</media:content>
	</item>
		<item>
		<title>R(D)COM Server NSFW</title>
		<link>http://mapwrecker.wordpress.com/2007/05/15/rdcom-server-nsfw/</link>
		<comments>http://mapwrecker.wordpress.com/2007/05/15/rdcom-server-nsfw/#comments</comments>
		<pubDate>Tue, 15 May 2007 04:18:22 +0000</pubDate>
		<dc:creator>Bill Thorp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mapwrecker.wordpress.com/2007/05/15/rdcom-server-nsfw/</guid>
		<description><![CDATA[Having the R stats package available to your web/GIS applications via DCOM sounds pretty sweet.  It does statistics, graphs, and has quite a few GIS related add-ons.
A co-worker was working with a solution which calls R by invoking RTerm.  I stumbled across R(D)COM and thought a DCOM implementation might provide a more reusable solution.  I tried to get him to evaluate/benchmark R(D)COM, but eventually [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=21&subd=mapwrecker&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Having the <a href="http://www.r-project.org/about.html">R stats package</a> available to your web/GIS applications via <a href="http://en.wikipedia.org/wiki/Distributed_Component_Object_Model">DCOM</a> sounds pretty sweet.  It does statistics, graphs, and has quite a few <a href="http://cran.r-project.org/src/contrib/Descriptions/shapefiles.html">GIS</a> <a href="http://cran.r-project.org/src/contrib/Descriptions/maptools.html">related</a> <a href="http://cran.r-project.org/src/contrib/Descriptions/maps.html">add-ons</a>.</p>
<p>A co-worker was working with a solution which calls R by invoking <a href="http://wwwmaths.anu.edu.au/~wangk/personal/pub/R/WinBook/node13.html">RTerm</a>.  I stumbled across <a href="http://sunsite.univie.ac.at/rcom/server/index.html">R(D)COM</a> and thought a DCOM implementation might provide a more reusable solution.  I tried to get him to evaluate/benchmark R(D)COM, but eventually took up the torch myself.</p>
<p>Unfortunately, it seems to be crap. </p>
<p> It takes 1 full second to get an R instance.  The least-chatty cross-process IO is barely faster than disk IO.  Cross-process IO hits a scaling wall well before the OS runs out of RAM.  Sending large datasets via the DCOM proxy eats more CPU time than the actual processing within R.  The crowning fault is that R(D)COM fails to destroy one of it&#8217;s processes about 5% of the time.  Props to Greg Hill for having way better intuition than me.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mapwrecker.wordpress.com/21/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mapwrecker.wordpress.com/21/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mapwrecker.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mapwrecker.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mapwrecker.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mapwrecker.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mapwrecker.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mapwrecker.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mapwrecker.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mapwrecker.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mapwrecker.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mapwrecker.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=21&subd=mapwrecker&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mapwrecker.wordpress.com/2007/05/15/rdcom-server-nsfw/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e68cbde5dbc158d8eceab62caa6fb19f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bill Thorp</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://mapwrecker.wordpress.com/2007/03/27/hello-world/</link>
		<comments>http://mapwrecker.wordpress.com/2007/03/27/hello-world/#comments</comments>
		<pubDate>Tue, 27 Mar 2007 17:10:33 +0000</pubDate>
		<dc:creator>Bill Thorp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Today I start that short, violent ascent towards fame.
James Fee, here I come.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=1&subd=mapwrecker&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today I start that short, violent ascent towards fame.</p>
<p>James Fee, here I come.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mapwrecker.wordpress.com/1/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mapwrecker.wordpress.com/1/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mapwrecker.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mapwrecker.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mapwrecker.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mapwrecker.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mapwrecker.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mapwrecker.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mapwrecker.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mapwrecker.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mapwrecker.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mapwrecker.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mapwrecker.wordpress.com&blog=920496&post=1&subd=mapwrecker&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mapwrecker.wordpress.com/2007/03/27/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e68cbde5dbc158d8eceab62caa6fb19f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bill Thorp</media:title>
		</media:content>
	</item>
	</channel>
</rss>