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

Query polygon not bounding box

Topics: General Topics
Jul 31, 2007 at 12:49 PM
Can't we query the exact polygon shape, like other GIS tools, instead of bounding box? I was querying some irregular shaped counties and never was able to get the single result that I am looking for, it was giving results of many polygons with in that bounding box. Its just confusing.
Aug 1, 2007 at 9:34 AM
You can if you use the NTS Geometry Extension, found here.
Aug 2, 2007 at 11:49 AM
You are right, we could!
But I am using MSSqlSpatial and NTS does not work with MSSqlSpatial provider. I am sure NTS and MSSqlSpatial are never meant to work together.
Aug 6, 2007 at 6:08 AM
When we replace the geometry model in SharpMap with NTS they will...
Aug 8, 2007 at 12:22 PM
anyone have an example how to use MSSslSpatial Provider with NTS ?

Aug 8, 2007 at 3:52 PM
Mssqlspatial provider simply retrieves SharpMap geometries from a Mssql datasource, so using NTS is the same stuff like other providers, i think
Aug 9, 2007 at 3:55 AM
// defining database and table
SharpMap.Layers.VectorLayer layer = new SharpMap.Layers.VectorLayer("point");
string cs = "Provider=SQLOLEDB;Data Source=(local)\\SQLEXPRESS;Initial Catalog=AFM;Integrated Security=SSPI";
layer.DataSource = new SharpMap.Data.Providers.OleDbPoint(cs, "MSGEFD", "MSGEFDID", "MSGEFDLAT", "MSGEFD_LONG");
// it'll return a set of point to define as a polygon later.

NtsProvider nts = new NtsProvider(layer.DataSource, delegate(List<GisSharpBlog.NetTopologySuite.Features.Feature> features)
foreach (GisSharpBlog.NetTopologySuite.Features.Feature feature in features)
//what should i put here if i want to get polygon in feature.geometry ?