draw polygone and select point

Topics: General Topics, SharpMap Project, SharpMap v0.9 / v1.x
Mar 25, 2010 at 11:03 PM
Edited Mar 30, 2010 at 10:16 AM


i need to find a way to draw a polygone with the mouse,

select all point in the polygone and  add  indicator in  colum of the  featuredataset on the points layers to indicate the selected point is in a new group , change all point to the specified group color, and the must a way to make a gradient color in that polygone.

to change the group colum in featuredataset is easy and changing point color too. The others things idont really have idea on how to do.

any suggestion will be apreciate

and i work on winform

and sory for me english ...


Apr 1, 2010 at 2:05 PM

I change my question a have a point in a layer and a polygon in a second  i have to know if the point is in the polygone. i klayer in vector layer coming from shapefile.

 how i can do that


Apr 1, 2010 at 3:33 PM
Edited Apr 1, 2010 at 3:49 PM

longuard you can use NTS to do queries of that kind, there are utility classes in the extensions project that allow you to convert between SharpMap and NTS geometries. NTS geometries implement Contains Intersects Within etc.. hth jd

Apr 1, 2010 at 6:33 PM
Edited Apr 2, 2010 at 4:13 PM

ok i can do that for 1 point

ntsPolygon = GeometryConverter.ToNTSGeometry(sharpmapPolygon, _geometryFactory);



but for 1000 points

i was think this is a way more like that

 (myMap.Layers["point"] as SharpMap.Layers.VectorLayer).DataSource.ExecuteIntersectionQuery(sharpmapPolygon.GetBoundingBox(), ds);