ESRI Shapefile Reader in .NET

I've just released a .NET library for parsing ESRI shapefiles - see ESRI Shapefile Reader on Codeplex. The library and source code are available under the Microsoft Public License.

A Shapefile is actually at least three files: a main file containing shape data (*.shp), an index file for locating shape records in the main file (*.shx) and a database of metadata for each shape (*.dbf) in dBASE format.

I ended up writing the library in order to convert Eric Muller's time zone shapefile into a format I could use with Catfood Earth. I found other libraries that could read shape data but not metadata, or provided a very thin .NET wrapper on top of unmanaged code and so I decided that a fully managed library could be useful.

The library - Catfood.Shapefile.dll - provides read-only, forward-only access to shapes and shape metadata. Currently all 2D shapes are supported: Null, Point, MultiPoint, PolyLine and Polygon. I might add additional types in the future, or if you have a pressing need it would be easy to extend the library by looking at an existing shape subclass and the shapefile specification (PDF).

See the Codeplex project for sample code and documentation.

Categories: .NET | C# | shapefile

How many people don't read this blog?

This is a joke metric that I first proudly displayed on Catfood Magazine back in 2007 1997 (it's broken on the archive of the site). Everyone had a hit counter back then, but as far as I know we were the first site with a non-hit counter.

The dirty secret was that the counter just showed the world population. The readership was a rounding error.

My new count of non-visitors uses the US Census Bureau's world population estimate and subtracts unique visitors from the Google Analytics API. The count is cached for an hour so it doesn't slow the page down too much.

 

How to get technical support without spending hours on the phone

Them: Hello, my name is Phil, how can I help you today?

You: My DSL connection is slow.

Them: Okay, I can help you with that, have you...

You: My first thought was that the Linksys router that's been working perfectly for five years has gone wrong. So I connected my computer directly to your off-brand modem with the same result. I then thought that the problem must be with the computer, so I reinstalled it from the manufacturer discs and rebooted about seven times.

Them: Let me connect you to my supervisor...

Them: Tap, tap, tap, oh, we seem to have switched your service back to the basic package. Tap, tap, tap, fixed.
Sometimes it's fun to argue with support. Sometimes you just need to short-circuit the idiot script to get through to the person who can fix the problem.

I think it's time for CAPTGUAs or Completely Automated Public Turing test to tell Geeks and Users Apart. A quick puzzle or two that bypasses the first couple of levels of support.

 

Business of Software 2009

I'm a Joel Spolsky stalker at the moment - after Stack Overflow DevDays last month I spent three days this week at the Business of Software conference in San Francisco.

It was an incredibly high value conference, in terms of both speakers and attendees. Next year it will be back in Boston, which sucks for me, but I'll make every effort to attend.

I was really excited to see Geoffrey Moore speak. An old boss once bought a crate of Crossing the Chasm for everyone in the division to read. It's still the best business book I've ever read. At the conference Moore spoke about innovation - specifically differentiation (get out of the competitive set), neutralization (get back in to the competitive set) and optimization (productivity gains). All three are essential, but you're shooting yourself in the foot if you spend too much time on neutralization - "Best of breed is a suckers game". His thesis was to do the bare minimum needed to stay competitive and then pour resources back into differentiation.

A theme of the conference was on motivating yourself and others - how to build a great company/culture. Several speakers talked about carving out time for creativity and fun. Carsonified evidently operates on a four day week. I've spent the last couple of years on a six day week... lots of food for thought here.

I convinced myself to attend this year after watching some of the videos from the 2008 conference. These are available on the Business of Software Ning - I'd recommend joining and checking them out. Hopefully videos from this year's conference will be posted soon.

 

 

CC | About | Search | Home | Validate