public static IGeometry Project(IGeometry geometry, ProjectionInfo pStart, ProjectionInfo pEnd) { var featureSet = new FeatureSet(); featureSet.AddFeature(geometry.ToDotSpatial()); featureSet.Projection = pStart; featureSet.Reproject(pEnd); return (GeometryConverter.ToGeoAPI( ((featureSet.Features[0].BasicGeometry as DotSpatial.Topology.IGeometry)))); }
public static List <IGeometry> Project(List <IGeometry> toList, ProjectionInfo pStart, ProjectionInfo pEnd) { var geometryCollection = new GeometryCollection(toList.ToArray()); var collection = geometryCollection.ToDotSpatial(); var featureSet = new FeatureSet(); foreach (var geo in collection.Geometries) { featureSet.Features.Add(geo); } featureSet.Projection = pStart; featureSet.Reproject(pEnd); var dotSpatialProjectedGeos = featureSet.Features.Select(x => x.BasicGeometry as DotSpatial.Topology.IGeometry).ToList(); var result = dotSpatialProjectedGeos.Select( dotSpatialProjectedGeo => GeometryConverter.ToGeoAPI((dotSpatialProjectedGeo))) .ToList(); return(result); }