Click or drag to resize

LocationTransform Method

Provides a shortcut for transforming the current location from one coordinate reference system to another.

Namespace:  Ptv.Components.Projections
Assembly:  Ptv.Components.Projections (in Ptv.Components.Projections.dll) Version: 1.7.10.0
Syntax
public Location Transform(
	string sourceId,
	string targetId
)

Parameters

sourceId
Type: SystemString
Identifies the source CRS, e.g. EPSG:4326
targetId
Type: SystemString
Identifies the target CRS, e.g. EPSG:3857

Return Value

Type: Location
Returns the transformed location.
Remarks
The returned location may be set to its defaults if the transformation fails.
Examples
The following is an example of transforming a location from WGS84 to Google Mercator:
// create a location
Location Karlsruhe = new Location(8.4038, 49.0081);

// transform location to Google Mercator
Location mapCenter = Karlsruhe.Transform("EPSG:4326", "EPSG:3857");

...
See Also