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

Spatial Query

Topics: Algorithms
Apr 18, 2007 at 3:11 PM
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?
Apr 26, 2007 at 6:29 AM
As default, no.. You should be able to implement this though
Apr 26, 2007 at 2:17 PM
It's very easy to extend SharpMap to do what you're wanting. Check out this article from the old SharpMap blog:

Abe Gillespie,
Programmer for hire - GIS, Business Apps, Website Apps
Apr 27, 2007 at 2: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");
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)))