Category: programming

Map Layers from All-Over

Creating maps that integrate data from all-over the place would be super-spiffy. You have corporate GIS data; you have beatiful Microsoft Virtual Earth imagery; you have functional google maps imagery.

OpenLayers is a Javascript API that is trying to bring all this stuff together. Unfortunately it has some pretty major usability issues to deal with.

This guy has a hack for adding your WMS imagery to a google map. See it in action here. An even better example is here (it brings together layers from TerraServer, Google, and a WMS). Or do it with Virtual Earth.

My short-term goal is simply to figure out how to join our corporate GIS data visually together with any WMS server. It may mean hacking, but hopefully not.

ASP.Net (C#) Forms Authentication to a Domain without impersonation

You would think that making an ASP.Net web application that authenticates to an active directory domain should be fairly straight-forward. Unfortunately it is not for users of Microsoft .Net 1.1. (Microsoft.Net 2.0 has the ActiveDirectoryMembershipProvider class).

The regular way for ASP.Net applications to query ActiveDirectory is by changing the user that the web application runs under. This seems a little bit bizarre.

So I’ve made a simple web application that uses several DLL calls to do what Microsoft should have done a long time ago.

The DLL calls that are needed are both found in advapi32.dll:

  • LogonUser
  • GetTokenInformation

Unfortunately calling these functions from managed .Net functions was far-from-simple. But I ended up getting it to work.

dotLucene Search Engine using C# and IFilter

Creating a search engine for a website using OpenSource systems is highly painful, even though it doesn’t need to be.

It was my task (prescribed by myself) recently to create a search engine for an internal website for basically no money. Because the application will be built in ASP.Net, the code had to be in C#.

Searching around the net, I found a promising project by the Apache project called “Lucene“. Lucene looked very powerful, and most of all, was OpenSource. The only problem with Apache’s Lucene is that it’s all in Java (which I don’t want to use).

So doing a search for “Lucene C#”, I came across several projects – both of which are dead:

It took me a lot more searching to find “dotLucene” which is still OpenSource, and is still active.

To cut a long story short, dotLucene did not work for me out-of-the-box, and its programming interfaces appear to have inherited the pain of the Java version. Plus dotLucene could not index Word or PDF files out-of-the-box (it only did HTML).

Things I tried to get dotLucene to work:

Through much trial-and-error, I finally got something that appears to “Just Work”.

Note: this source code uses sources taken from all-over-the-place. I do not assert any of my own intellectual rights to any of this.

Geocoding Canadian Addresses

Looks like there’s finally a Canadian equivalent to www.geocoder.us – www.geocode.ca!

Now all I need to do is create my own cool zooming map of Port Moody with my own cool JavaScript viewer (so that I don’t have to worry about Google Maps’ Terms which allow for advertisements). Of course drawing circles and overlaying information on Google Maps looks very promising.

It looks like someone has been able to overlay their own tiles onto Google Maps – so that you can use Google’s interface to show your own graphics. This same technique is used for a subway map of NYC. Too cool.

More: a tutorial on making your own google map type, and even a photoshop script to make all the tiles.

The updating map of where the trains are *right now* in Dublin is really cool.

Displaying an RSS Feed in your sidebar

I’ve found a very cool service that allows you to display an RSS feed on your website. For example, you can add a feed to your side bar. The best part of this is that no advertisements are currently inserted – giving you a clean looking page.

This service is hosted here, but they would like you to use one of their mirrors.

WordPress Themes