This project has moved. For the latest updates, please go here.

Simple things

May 13, 2008 at 2:39 AM
Edited May 13, 2008 at 3:19 AM

At the moment I very much regret having invested two weeks in the SharpMap control.

It is obviously not possible to return a single polygon (from a single layer with non-overlapping polygons) using VB.NET because:


1.) Getting started "How do I return a set of feature attribute data from a click on a map" does not work (see my post “Retrieve features in VB with ExecuteIntersectionQuery). It returns multiple polygons.


2.) The NTS_DemoApp is in C#. I have tried to translate it and this is not possible due to a C# native construct (NtsProvider nts = new NtsProvider(layGeoms.DataSource, delegate List<GisSharpBlog.NetTopologySuite.Features.Feature> features){});). Without it, multiple polygons are retrieved. If I modify it as suggested by JohnDiss in my post “Implementing NtsProvider with VB”, the function NTSProvider I am calling from the VB.NET module is not recognised (GeometryConverter.cs and NtsProvider.cs are in their own directory and references to that has been made in the references dialog).


If no one can come up with some VB.NET code that returns a single polygon then the SharpMap homepage needs to have a big red disclaimer that it does not work with VB.NET.


To codekaizen: In another post you write “the onramp to SharpMap is too steep and filled with potholes and lacks a guardrail. SharpMap is a relatively immature project, given it's complexity. Most of the people who get productive with it are early adopters, and probably already have some GIS experience or have a lot of time to invest in getting it working.” You should also make that clear on the homepage.


I need a GIS control I can use in an actual scientific application. I need it to work with simple functions (because users click on things and expect to get data back from what they clicked on not random other things). And I need it to work now.


If someone has a solution this is your chance to step forward and shine.







May 13, 2008 at 11:04 AM
Hi Chris, 
1) Can you check your source data with an other editor and ensure that there are no overlaps in your data - often when people experience problems like this it is the source data that is wrong. 

2) Why dont you use the sharpmap extensions project as the source for your NTSProvider at least to get to the next step - it introduces a few extra dependencies but it will get you going.

Then in your app reference either the Sharpmap.Extensions project (project reference and Imports) or the compiled Assembly  (again project reference and Imports). Once you have got this running, by all means make an extra assembly containing only the dependencies that you need.