This project has moved and is read-only. For the latest updates, please go here.

SharpmapV2 Employing NTS and GeoAPI?

Topics: General Topics, SharpMap v2.0
Sep 24, 2007 at 4:19 PM
Edited Sep 24, 2007 at 4:19 PM
I've seen some responses recently that say SharpMapV2 Beta2 will use NTS as the native geometry type. I was curious how far this idea was to be taken. Recently, on trying to write to a shapefile using SharpMapV2, I found that it errors using multi-geometry types. It appears that NTS/GeoAPI already contains code for writing to shapefiles (I haven't tried it yet). How much collaboration / devouring is going on with existing LGPL codebases?
Sep 24, 2007 at 7:27 PM
NTS code for shapefile reading/writing comes from an old GeoTools.NET version, so I'm pretty sure that only NTS Geometry Model and Topology Operations will be integrated in SharpMap beta2.
Sep 24, 2007 at 7:56 PM
Edited Sep 24, 2007 at 7:57 PM
Hey Bill -

The current plan is to just use NTS for the geometry relationship computations. While there is data I/O in NTS, it is mostly just ported from JTS or GeoTools, and doesn't take as much advantage of the .Net framework as it could, it appears. This will be increasingly important to do as .Net itself matures, since it comes with a lot of "pit of success"-sort of benefits in language advances, tooling, pattern familiarity and reuse, developer habits, etc.

I think the longer term picture for the I/O stuff is to try to consolidate it more than it is, so it can be used and even developed independently of SharpMap. I'm not sure that completely separating at this time it is a wise move, however, since interdependencies in immature open source projects can result in dissipating the development efforts: if you refactor into a shared library and a library build breaks dependent projects, what's the motivation for the owner of the dependency to help ensure compatibility?

With the long-term picture discussed, at the present, there is no hesitation for copying correct source from compatibly-licensed projects, especially to correct a defect. What is the problem with the multi-geometry shapefile?
Sep 24, 2007 at 8:23 PM

codekaizen wrote:
While there is data I/O in NTS, it is mostly just ported from JTS or GeoTools, and doesn't take as much advantage of the .Net framework as it could, it appears.

This is true. In addition, any effort in NTS development is to increase spatial capabilities.
IO functionts are in NTS only to offer a way to load/save spatial data, but i hope that in the future people out there uses SharpMap for this purpose :)
Sep 24, 2007 at 9:21 PM
Excellent. Is it too soon to post Issues for v2? {If not, should I post them here or to the temporary v2 project?}
Sep 24, 2007 at 10:20 PM
Edited Sep 24, 2007 at 10:21 PM
By all means... post issues for v2.0!

Oh, and please post them here. I understand the server version of the SVN bridge is near, and this will be the event that causes the project to move here permanently.
Sep 24, 2007 at 11:35 PM
A small issue:

In SharpMap\Data\Providers\Shapefile\DbaseReader.cs (DateTime.ParseExact(...) line 216). If building for MONO, i guess br.ReadBytes(8) should be _dbaseReader.ReadBytes(8)

Also in the same call, Map.numberFormat_EnUS, is not defined.

Sep 24, 2007 at 11:57 PM
Thanks guillermo -

This will be fixed in the next commit of v2.0. Hasn't Mono implemented TryParseExact with later revisions?
Sep 25, 2007 at 12:00 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.