SharpGIS

#GIS from a .NET developer's perspective

WPF: Who really need video on spinning cubes

Bob Powell have some really good comments on where the power of WPF really is. He needs performance for constantly redrawing the grid. Something GDI isn't that fast at, and which steals all the power from doing the real work:

In order to liberate the processor we need to stop it from drawing the graphics. We still need the graphics so this implies that they need to be managed somewhere else. By the graphics card itself possibly.

Strangely WPF is here with a system that can make even the most bogged-down two dimensional application fly. With the power of graphics processors on even simple display cards today, the rendering of a grid can become a trivial matter, even when it’s data-bound to a constantly changing stream of data.

Forget spinning cubes, forget cards that bounce and shatter in a waterfall of broken shards, forget plasma fields with smiling babies and dogs catching Frisbees. Show the managers in your company the benefits of freeing up those expensive processors for doing real ork and leave the graphics where they belong, on the video card.

Some of the first things I noticed about WPF was the drawing performance of it. As everyone else I was of course right away thinking of fancy interfaces with spinning cubes and what not, and hadn't really given it much thought abot applying it in an "ordinary" application with some "ordinary" controls. But after reading Bob's post it really makes sense!

So what does a Mac do?

Something I've noticed during my time here in the US, is the way companies pick on each other in the ads. It's like they are more busy talking about their competitors than themselves. I do find that pretty strange, and it definitely doesn't work on me. At least there are companies who have a policy of not mentioning competitors, which makes a lot more sense to me. Why would you even want to tell your customers that there are alternatives to your product? As a famous former danish tycoon once said: "Even bad publicity is good publicity"

Apple currently makes a lot of the "Hello I'm a Mac, and I'm a PC" ads which falls in this "pick on your competitor" category, and it's not the first time they are doing these kind of ads. OK, I must admit that the one about security is pretty funny, but what it is really that a Mac does? After watching several Mac commercials, I've come to the following conclusion: A Mac is an absolute waste of money, Apple suffers from a bad case of self-esteem and tries to make up for it by patronizing Microsoft. It’s a bit like the bullies back in the school yard who never got anywhere in life.

This is how I came to my conclusion (before you start yelling at me, I might be wrong but this is what sprang to my mind when I watched the ads):

  • Windows Security ad: Apparently Mac haven't implemented any security that will bug you, or prevent you from doing something stupid without thinking twice.
  • Surgery ad: So you can't change the hardware of a Mac and upgrade it to follow the newest advances in technology? Clever! I just buy a new one every year.
  • Tech support: So I have to settle with the webcam in the monitor, and buy a new monitor to upgrade the webcam to the latest and greatest? (and can I buy just a new monitor ? see above)
  • Meant for work: So I can't use it for anything fun?
  • Accident: So the powercord isn't properly connected to prevent you from accidentially disconnecting the cord?

OK I'm not really a Mac fan, and I'm probably the only one in the whole wide World who thinks that the white Mac and Ipod design is just plain ugly, and should be sent back to the 70s.

ArcGIS Server Team Blog

Art recently promised that there would be an ArcGIS Server Development Blog soon, and now it's there !
Check out our the new blog at http://blogs.esri.com/Dev/blogs/arcgisserver/
You can also find a link to the blog from http://blogs.esri.com

And even better! The server is also running ArcGIS Server.NET, so you can see the examples in action!

From the blog:

This blog is written directly by the ArcGIS Server Development Team.  We are very excited about the ArcGIS Server 9.2 release.  We have so much to share with the user community.  Topics will range from detailed programming information ("What is a page life cycle in the Web ADF?") to GIS methodology ("What is the best methodology to produce map caches?") for serving spatial data with ArcGIS Server.  One of the key parts to this blog will be the use of an example site.  We intend to post useful entries for our users which are linked directly to examples that we have built that you can access live from the Internet.

 

Jeremy has already put up a huge post on creating a website with cached tiles and custom tasks, including live running samples you can try.

Microsoft Earth

There's been a lot of rumours for a long time that Microsoft would make a 3D map application, and they were apparently true. They just upgraded their Local Live portal with a 3D viewer.

Whats the first thing you install?

Everytime I'm sitting down with a freshly installed PC, there is always one application I install before everything else (yeah even before antivirus software!): TotalCommander. It's my #1 application for navigating around the file system, running commands, opening/editing/zipping/unzipping/uploading/searching/multi-renaming files etc. etc. I use it so much that just using Windows Explorer to navigate to the install of TotalCommander is several agonizing seconds while thinking "God I wish I had TotalCmd to install TotalCmd" :-)

Today the first beta of the all new version 7 was released. Yepppiiiiiiii If you are new to TotalCmd, it's a great tool for quickly doing what else would require slow mouse navigation in Explorer and installing a bunch of additional applications. There's even a great set of plug-ins to make it even better! Below is a screenshot of TotalCmd configured as I like it.

Best of all: It's shareware and only $34, and you can install it on all your computers (as long as you only use one at a time, which most non-squid people do).

A little tip: In the install folder, there's a file called 'KEYBOARD.TXT'. This contains a list of keyboard shortcuts that will make your use of TotalCmd much more efficient, and discover a lot more of it's potential. I try to go through it once a month, and usually I learn some new ones everytime.

What's the first thing you install on a fresh PC?

First day at ESRI

I just had my first day at ESRI today, where I have joined the ArcGIS Server .NET ADF team.

Everything here seemed well-prepared and set-up when I got there, including a small "seminar" for everyone who started as ESRI today, and ready-installed desktop and laptop computers.

I already got to look "under the hood" of AGS and play around with it - there's definitely some very cool stuff in there! Hopefully I'll get some time to blog some more about it later - or you can have a look at Arts blog as well.

Up-to-date maps

Yesterday I went on my very first "road-trip" in USA, driving from Redlands up to San Luis Obispo to visit a friend of mine, a 5-6 hours drive. Of course I brought my TomTom  navigator to help out (since I had more or less no idea how to get up there), and already after 10 miles of driving it got handy, when the whole I-10 freeway closed, probably because of yet another accident. TomTom has a neat little feature to avoid roadblocks or entire parts of the trip, and provide you with an alternative.

I wasn’t  too sure how up-to-date the map was, but thought I would let it guide me on a round trip. Well it turned out that the maps were a little too up-to-date, when it suddenly wanted me to enter an only half  completed freeway :-). Good thing I brought my paper-maps as well, although they are far harder to use while driving ;-)

Overlaying Local Live maps with your own map-data

Recently the Virtual Earth team  released a new version of their API . One of the new features allowed to overlay the maps with tiles from your own tile-server. The tile-server can be added using a few lines of javascript like this:

var tileSourceSpec = new VETileSourceSpecification();
tileSourceSpec.ID = "POPDENS" ;
tileSourceSpec.GetTilePath = GetTilePath;
tileSourceSpec.NumServers = 1;
tileSourceSpec.MinZoom = 1;
tileSourceSpec.MaxZoom = 16;
vemap.AddTileSource(tileSourceSpec);
var tileLayer = new VELayerSpecification(VELayerType.VETileSource,"POPDENS", "POPDENS");
tileLayer.Opacity=0.6;
vemap.AddLayer(tileLayer);

This will add a new tile layer named "POPDENS" to the virtual earth map, and make it slightly transparent. The GetTilePath parameter refers to the JavaScript method that creates the request-url to the server. Ex:

function GetTilePath (tileContext)  {
  if (tileContext != null && tileContext != "undefined" ) {
    return "VEmap.ashx?WIDTH=256&HEIGHT=256&X=" + tileContext.XPos + "&Y=" + tileContext.YPos + "&ZoomLevel=" + tileContext.ZoomLevel;
  }
}

The X, Y and ZoomLevel parameters in this querystring are unfortunately not simple coordinates, but are the row/column of the tile at the current zoom level. Rob Blackwell has earlier posted an article on how to convert these to longitude/latitude values.

The next step is to create the tile-server. I used SharpMap for this. SharpMap's on-the-fly transformation capability is needed to transform the data to the Mercator projection that Virtual Earth uses, but any map-renderer that can project data could be used. You could also create a javascript that makes the GetTilePath method return a WMS request instead and then use any of the many WMS servers available.

The basic trick is to use Rob Blackwell's methods for calculating the longitude/latitude of each tile's corners, transform these coordinates to the Mercator projection and render the resulting extent.

You can view a small demo of a Population Density map overlaying the Virtual Earth map here: http://showcase.sharpgis.net/ve/
...or you can download the full source: VirtualEarth.zip (389,09 KB)
You can easily add your own data by editing the CreateMap method in \App_Code\Map.cs

 

SharpMap v0.9 released

SharpMap v0.9 is now uploaded to the CodePlex Workspace.

Download it here.

Thanks to everyone who has supported the development of SharpMap. We have come a long way since the previous release candidate.

Unfortunately this also marks the end of my involvement with SharpMap. In a months time I'm moving from Copenhagen to California to start on a new and exciting GIS developer job. Hopefully more on that later...

Microsoft SQL Server Spatial project

Inspired by my petty shot at making SQL Server spatial, Ricardo Stuven has been working the new CLR in SQL Server 2005 and started adding almost all basic spatial functions, and implemented some aggregates, stored procedures and table-valued functions in SQL Server. He even started an Open Source project where you can check it out (yet another open source .NET GIS project we can add to the .NET tribe... ;-))

Read his comments on his approach, including query examples and a list of features which he posted in an update on the SharpMap forum today.