Spatial Query

Topics: Algorithms
Apr 18, 2007 at 4:11 PM
Hi,
I need to know if SharpMap supported spatial query. For example, is it possible to understand if a point is inside a region or if a region intersect another region?
Thanks
Apr 26, 2007 at 7:29 AM
As default, no.. You should be able to implement this though
http://www.codeplex.com/MsSqlSpatial
Apr 26, 2007 at 3:17 PM
It's very easy to extend SharpMap to do what you're wanting. Check out this article from the old SharpMap blog:

http://www.sharpgis.net/2006/05/18/UsingNetTopologySuiteInSharpMap.aspx

--
Abe Gillespie, abe@digital-pulp.com
Programmer for hire - GIS, Business Apps, Website Apps
http://code.google.com/p/ziggis/
Apr 27, 2007 at 3:52 PM
I've done in this way, but I don't know if it is correct :

Point p = new Point(x,y);
ShapeFile shapeFile = new ShapeFile("pathtomy_file");
shapeFile.Open();
FeatureDataRow fdr;

for (uint i = 0; i < shapeFile.GetFeatureCount(); ++i)
{
fdr = shapeFile.GetFeature(i);
Object[] ar = new Object10;
ar = fdr.ItemArray;
n = (Single) ar1;

if ((n == " costant" ) && (p.Within(fdr.Geometry)))
...

}
shapeFile.Close();