Dec 11, 2009 at 10:37 AM
Edited Dec 11, 2009 at 11:32 AM
Using Sharpmap V0.9 in a WinForms project. I mostly work ontop of a raster file.
I've created a route via mouse clicks which is added to a vector layer similar to this (Just like in the how to):
...And so on...
vectorLayer.DataSource = new SharpMap.Data.Providers.GeometryProvider(GeomColl);
Now, the route draws correctly, and looks good, however, I wish to place points on the lines based upon where someone clicks. Also using the how to documents,
I use the method FindGeoNearPoint from this how to: http://sharpmap.codeplex.com/wikipage?title=Do%20true%20intersection%20testing%20using%20NetTopologySuite&referringTitle=How%20to...
Now, using this method, I run into the issue that "Attribute data is not supported by the geometryprovider".
So, this approach won't work for getting the nearest geometry for me; what should I use?
I tried using myVectorLayer.DataSource.GetGeometriesInView using a bounding box based upon where the user clicks +-100. That returns nothing.
If I make my +-1000, it WILL get the geometry of the line, however no matter where I click on the map it will return something. Obviously
this isnt what I want as Id like to get just the route (ideally, Id like to get the nearest segment of the route/the nearest point along that
particular segment), though I dont see any other obvious way to get the LINESTRING/POINT.
Any suggestions? Should I maybe use something other than a geometry layer so I can access my route?