Is Point in "shapefile"?

May 16, 2011 at 4:06 PM

Hi

Please can someone show me how to find if point(x,y) lies inside the specific "shapefile".

I already find the point in polygons with these few lines:

point pnt = new Point (coord);

foreach (IFeature poly in polygons)

{

          if (poly.Intersect (pnt))

         {

                 // this is true

          }

}

Thanks for help, Vojko

Jul 18, 2011 at 1:25 PM

Maybe this can be helpfull

Dim rtol As Rectangle = New Rectangle(e.X - 15, e.Y - 15, 25, 25)
Dim tolerant As Extent = MapCorineSHP.PixelToProj(rtol)
'case 2
Dim rstr As Rectangle = New Rectangle(e.X - 1, e.Y - 1, 2, 2)
Dim strict As Extent = MapCorineSHP.PixelToProj(rstr)

Dim results As List(Of IFeature) = LayerToQuery.Dataset.[Select](tolerant) 'or use strict
For Each result As IFeature In results.Features

Next


        

Jul 18, 2011 at 3:53 PM

Thanks agelospanagiotaki, I will try this soon I arrive to my office!