SpatialLITE is a modern, lightweight .NET library for spatial data processing. The goal of the library is to make spatial data processing faster, easier and more intuitive. It is FREE (distributed under the New BSD license).

SpatialLITE supports many data formats, basic topology analysis of geometry objects and their measurement. Object model of the library is inspired by OGC Simple Feature specification, but it was enhanced to take advantage of the .NET enviroment (e.g. generics).

SpatialLITE library is being developed in C# on top of the .NET 4 framework. Right now it is in the beta stage and any feedback is highly apprised. You can download lateset stable version in the download section.



The following example loads data from an OpenStreetMap file into memory, extract all roads from the data, computes their total length and saves shapes of all roads in WKB format.

OsmGeometryDatabase db = null;

//Reads OpenStreetMap data file
OsmReaderSettings readerSettings = new OsmReaderSettings() { ReadMetadata = false };
using (PbfReader reader = new PbfReader("austria.pbf", readerSettings)) {
	db = OsmGeometryDatabase.Load(reader, true);

double totalLength = 0;

WkbWriterSettings writerSettings = new WkbWriterSettings() { Encoding = BinaryEncoding.LittleEndian };
using (WkbWriter writer = new WkbWriter("highways.bin", writerSettings)) {
	//Extracts all roads
	foreach (var way in db.Ways.Where(w => w.Tags.Contains("highway"))) {
		//Writes shape of the road

		//Computes length of the road
		totalLength += Measurements.Sphere2D.ComputeLength(way);

Console.WriteLine(String.Format("Total length of the roads is {0}m", totalLength));

Contributing to SpatialLITE

Project repository is hosted on Google Code, just clone the repository and start coding!

You can also help the project by providing any feedback, suggestion or reporting an bug on the issues page.