public override SharpMap.Geometries.Point Transform(SharpMap.Geometries.Point point) { if (point is SharpMap.Geometries.Point3D) { SharpMap.Geometries.Point pnt = (point as SharpMap.Geometries.Point3D).Clone(); foreach (ICoordinateTransformation ct in _CoordinateTransformationList) pnt = ct.MathTransform.Transform(pnt); return pnt; } else { SharpMap.Geometries.Point pnt = point.Clone(); foreach (ICoordinateTransformation ct in _CoordinateTransformationList) pnt = ct.MathTransform.Transform(pnt); return pnt; } }
public CreateTilesSample(SharpMap.Map map, bool transformToMercator, string rootTilesPath) { _map = map.Clone(); _map.MaximumZoom = double.MaxValue; _map.MinimumZoom = 0; if (transformToMercator) { TransformLayers(LayerTools.Wgs84toGoogleMercator); } _rootTilesPath = rootTilesPath; if (!Directory.Exists(_rootTilesPath)) { Directory.CreateDirectory(_rootTilesPath); } }
/// <summary> /// Transforms a coordinate point. The passed parameter point should not be modified. /// </summary> /// <param name="point"></param> /// <returns></returns> public override SharpMap.Geometries.Point Transform(SharpMap.Geometries.Point point) { SharpMap.Geometries.Point pOut = point.Clone(); pOut.X /= SourceGCS.AngularUnit.RadiansPerUnit; pOut.X -= SourceGCS.PrimeMeridian.Longitude / SourceGCS.PrimeMeridian.AngularUnit.RadiansPerUnit; pOut.X += TargetGCS.PrimeMeridian.Longitude / TargetGCS.PrimeMeridian.AngularUnit.RadiansPerUnit; pOut.X *= SourceGCS.AngularUnit.RadiansPerUnit; return pOut; }