public static SpatialReference CreateSpatialReference( int wkid )
Public Overloads Shared Function CreateSpatialReference( _ ByVal wkid As Integer _ ) As SpatialReference
Parameters
- wkid
- The Well-known ID that represents the Spatial Reference.
public static SpatialReference CreateSpatialReference( int wkid )
Public Overloads Shared Function CreateSpatialReference( _ ByVal wkid As Integer _ ) As SpatialReference
// Use a builder convenience method or use a builder constructor. // Builder convenience methods don't need to run on the MCT. SpatialReference sr3857 = SpatialReferenceBuilder.CreateSpatialReference(3857); // Builder constructors need to run on the MCT. ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { using (SpatialReferenceBuilder srBuilder = new SpatialReferenceBuilder(3857)) { // do something with the builder sr3857 = srBuilder.ToSpatialReference(); } });
// create the polygon List<MapPoint> pts = new List<MapPoint>(); pts.Add(MapPointBuilder.CreateMapPoint(1.0, 1.0, SpatialReferences.WGS84)); pts.Add(MapPointBuilder.CreateMapPoint(1.0, 2.0, SpatialReferences.WGS84)); pts.Add(MapPointBuilder.CreateMapPoint(2.0, 2.0, SpatialReferences.WGS84)); pts.Add(MapPointBuilder.CreateMapPoint(2.0, 1.0, SpatialReferences.WGS84)); Polygon polygon = PolygonBuilder.CreatePolygon(pts); // ensure it is simple bool isSimple = GeometryEngine.Instance.IsSimpleAsFeature(polygon); // create the spatial reference to project to SpatialReference northPole = SpatialReferenceBuilder.CreateSpatialReference(102018); // north pole stereographic // project Geometry geometry = GeometryEngine.Instance.Project(polygon, northPole);
Target Platforms: Windows 10, Windows 8.1, Windows 7