A lot have been happening to SharpMap lately. Several new features are already available in the alpha release. Here are some of the features that now readily are available:
- Gradient Theme now works on not only fill-color, but all numeric style properties, giving even greater flexibility for controlling font-sizes, pen and outline color and widths etc. based on a numeric attribute.
- Custom Theme: Define your own method that determines the style of a feature based on geometry and feature attribute. Ex. "Make all polygons with an area>100 and whose name starts with "S" green with a blue outline.
- Symbols can now be scaled.
- Create a WMS server with only very few lines of code.
- Labels can now follow lines, or be rotated based on an attribute.
- Lots of bug-fixes and optimizations.
- Use any OleDb datasource that holds X and Y columns for creating a point layer.
Diego Guidi - who is the developer of NetTopologySuite has also created a link between SharpMap and NTS. This means that you instantly get all the great functionality of NTS inside SharpMap, including on-the-fly transformation, buffering etc. You can apply any custom method that performs NTS operations on any SharpMap datasource and render the result with SharpMap. Get it at the download section.
Download at http://sharpmap.iter.dk
Recently Frank Warmerdam and Michael Paul posted some examples on calling GDAL from .NET. This is pretty cool, since this enables you to access a great set of tools that I for one have been accessing by generating batch-files in a .NET application and then running them using the shell-commands (not pretty but it worked :-)
Their posts used several links to pointers and didn't have automatical garbage collection. Since disposing objects is very important when calling unmanaged code, and .NET developers isn't that used to pointers, I decided to wrap some of the GDAL functionaly into a few classes with automatic disposer etc. It still needs some brushing off and to include some more GDAL functionality, but let me know what you think. You can download it here.
I've written a small article on how to get started with using SharpMap in ASP.NET 2.0 on CodeProject here:
Have a look, and remember to rate it ;-)
Yesterday The MapServer Foundation announced the availability of the new (and free!) MapServer Enterprise sponsored by AutoDesk.
They state that it also supports .NET, which sounds like goodies for a .NET/GIS guy like me, so I definitely had to check it out.
I must admit that their ASP.NET examples shocked my completely. I can’t recall seeing that poor .NET code the last couple of years. It’s all ASP-style spaghetti-code and ridiculously poor implemented. I wouldn’t be surprised that if you rename the file-extensions to .asp, it would still run :-) Although I’m still exited by this new release, I can’t help thinking that if this is the best they can do in a .NET environment, what does the actual server-code look like?
Today I was trying to make a WMS implementation using SharpMap, and it turned out to be quite easy. I’ve implemented some helper classes in SharpMap, which I will include in the next release of SharpMap. Actually now you can create a WMS service using only a few lines of code. Here’s an example:
protected void Page_Load(object sender, EventArgs e)
SharpMap.Map myMap = InitializeMap(); //Call method that sets up your map
}And that’s it !!! (well at least besides the InitializeMap method where you set up layers etc…)
It even returns nice little XML exceptions according to the specification. I still need to do some work on the GetCapabilities request, but I think it’s more or less safe to say that SharpMap will work as an OpenGIS compliant WMS Server in the next release.
I've just finished creating on-the-fly spatial indexing for shapefiles in SharpMap, and what an improvement !!! Rendering a shapefile layer to a map is now 5-6 times faster compared to a spatially indexed PostGIS layer. I'm now focusing on getting ready for the SharpMap v0.8 release, which includes the shapefile indexing, a new improved geometry object model, and a bunch of other changes and enhancements.
I promised some screendumps from my PostGIS/.NET based MapEngine, so here it is. Nicely packed into a small workspace manager:
Last night I was, just for fun, fooling around with creating my own mapserver engine using native .NET and GDI+ methods, combined with a PostGreSQL/PostGIS database. Until now I got Points, Labels and Line layertypes implemented.
I didn’t expect much of the speed, but it turned out that GDI+’s drawing methods and anti-aliasing rendering combined with .NETs automatic connection pooling provided me with an ultra fast map render engine. And just by exposing LineStyles as System.Drawing.Pen you get a vast amount of options for customizing the look of the rendered output. And it even looks great! I’m all ecstatic about the result, and will probably follow this further with more geometry types and additional data-providers (shapefile, Oracle etc). I’ll post some results here later.
I was looking into doing some unit testing, when I just (re)discovered a cool new feature in VS2005. You can auto-generate a class-diagram from your projects, just by right-clicking and select "Class diagram". Below is a class diagram for parts of the upcoming release of PocketGpsLib 2.0, as of today. Better get back to setting up some unit tests... :-)