Method Create
Create(int)
Returns an instance of the SpatialReference class based on the given well-known ID.
Declaration
public static SpatialReference Create(int wkid)
Parameters
| Type | Name | Description |
|---|---|---|
| int | wkid | The well-known ID of the horizontal coordinate system. Must be a positive value. |
Returns
| Type | Description |
|---|---|
| SpatialReference | A SpatialReference object. |
Remarks
The returned SpatialReference has only horizontal coordinate system and does not have vertical coordinate system associated with it.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | The provided WKID is not a supported well-known ID. |
Applies to
Platforms and versions
| Target | Versions |
|---|---|
| .NET Standard 2.0 | 100.3 - 200.8 |
| .NET | 100.13 - 300.0 |
| .NET Windows | 100.13 - 300.0 |
| .NET Android | 200.0 - 300.0 |
| .NET iOS | 200.0 - 300.0 |
| .NET Framework | 100.0 - 200.8 |
| Xamarin.Android | 100.0 - 100.15 |
| Xamarin.iOS | 100.0 - 100.15 |
| UWP | 100.0 - 200.8 |
Relevant samples
Create(int, int)
Returns an instance of the SpatialReference class based on well-known IDs for the horizontal and vertical coordinate systems.
Declaration
public static SpatialReference Create(int wkid, int verticalWkid)
Parameters
| Type | Name | Description |
|---|---|---|
| int | wkid | The well-known ID of the horizontal coordinate system. Must be a supported well-known ID. |
| int | verticalWkid | The well-known ID of the vertical coordinate system. Must be a supported well-known ID. |
Returns
| Type | Description |
|---|---|
| SpatialReference | A SpatialReference object. |
Remarks
When the vertical WKID is less than or equal to 0, this is equivalent to calling Create(int),
and the spatial reference will not have a vertical coordinate system associated with it.
If verticalWkid is greater than zero but is not a supported well-known ID, an exception will be thrown.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | The provided WKID or verticalWKID is not a supported well-known ID. |
Applies to
Platforms and versions
| Target | Versions |
|---|---|
| .NET Standard 2.0 | 100.3 - 200.8 |
| .NET | 100.13 - 300.0 |
| .NET Windows | 100.13 - 300.0 |
| .NET Android | 200.0 - 300.0 |
| .NET iOS | 200.0 - 300.0 |
| .NET Framework | 100.0 - 200.8 |
| Xamarin.Android | 100.0 - 100.15 |
| Xamarin.iOS | 100.0 - 100.15 |
| UWP | 100.0 - 200.8 |
Create(string)
Returns an instance of the SpatialReference class based on well-known text (WKT).
Declaration
public static SpatialReference Create(string wktext)
Parameters
| Type | Name | Description |
|---|---|---|
| string | wktext | A well-known text (WKT) string that defines a horizontal and optionally vertical coordinate system. Must be a supported well-known ID. |
Returns
| Type | Description |
|---|---|
| SpatialReference | A SpatialReference object. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | The provided |
Applies to
Platforms and versions
| Target | Versions |
|---|---|
| .NET Standard 2.0 | 100.3 - 200.8 |
| .NET | 100.13 - 300.0 |
| .NET Windows | 100.13 - 300.0 |
| .NET Android | 200.0 - 300.0 |
| .NET iOS | 200.0 - 300.0 |
| .NET Framework | 100.0 - 200.8 |
| Xamarin.Android | 100.0 - 100.15 |
| Xamarin.iOS | 100.0 - 100.15 |
| UWP | 100.0 - 200.8 |