private static IPointCollection GetPoints(IPointCollection pointCollection, IGeometry inArea) { if (pointCollection == null || pointCollection.PointCount == 0) { return(null); } if (inArea == null) { return(pointCollection); } if (GeometryUtils.Disjoint(inArea, (IGeometry)pointCollection)) { return(null); } // because intersecting multipoints with envelope is not implemented: var withinPolygon = inArea as IPolygon; withinPolygon = withinPolygon ?? GeometryFactory.CreatePolygon(inArea); var result = (IPointCollection) IntersectionUtils.GetIntersection((IGeometry)pointCollection, withinPolygon); return(result); }