ArcGIS Explorer Component Help |
SoapConverter..::.CoordinateSystemToSoap<(Of <(TSoap>)>) Method (IEnumerable<(Of <(CoordinateSystem>)>)) |
SoapConverter Class Example See Also |
Converts an enumerable set of ArcGIS Explorer CoordinateSystem objects to a List of ArcGIS Server SOAP SpatialReference objects.
Namespace:
ESRI.ArcGISExplorer.GeometryAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public static List<TSoap> CoordinateSystemToSoap<TSoap>( IEnumerable<CoordinateSystem> coordinateSystems ) |
Visual Basic (Declaration) |
---|
Public Shared Function CoordinateSystemToSoap(Of TSoap) ( _ coordinateSystems As IEnumerable(Of CoordinateSystem) _ ) As List(Of TSoap) |
Parameters
- coordinateSystems
- Type: System.Collections.Generic..::.IEnumerable<(Of <(CoordinateSystem>)>)
An enumerable set of ArcGIS Explorer CoordinateSystem objects to convert.
Type Parameters
- TSoap
- The SOAP SpatialReference Type.
Return Value
A generic List containing SOAP SpatialReference objects of type TSoap based on the properties of the coordinateSystems.Remarks
Use this method to convert multiple ArcGIS Explorer CoordinateSystem objects into corresponding SOAP objects. You must specify the SOAP SpatialReference type as the type parameter for this generic method by passing in the SOAP Type defined in your web service reference.
You can also use the ToArray method on the returned List to get an array of SOAP objects, which you may find useful as they are commonly used as parameters in web services.
Examples
The code below shows you how to convert an enumerable generic set of ArcGIS Explorer CoordinateSystem objects to a
generic List containing SOAP SpatialReference objects, by using the CoordinateSystemToSoap method.
Types are fully-qualified to avoid confusion, with
the exception of the SOAP types - you must ensure you have a using/Imports statement to your
SOAP web reference namespace or fully-qualify the SOAP types in your own code.
CopyC#
// Remember you will need a using (Imports in Visual Basic) statement to the namespace of the SOAP definitions // for your web references, e.g. the namespace containing the SpatialReference SOAP type. // Create a list containing ArcGIS Explorer projected coordinate systems. System.Collections.Generic.List<ESRI.ArcGISExplorer.Geometry.CoordinateSystem> xoProjCss = new System.Collections.Generic.List<CoordinateSystem>(3); xoProjCss.Add(ESRI.ArcGISExplorer.Geometry.CoordinateSystem.ProjectedCoordinateSystems.Polar.NorthPoleStereographic); xoProjCss.Add(ESRI.ArcGISExplorer.Geometry.CoordinateSystem.ProjectedCoordinateSystems.NationalGrids.NewZealand.NewZealandMapGrid); xoProjCss.Add(ESRI.ArcGISExplorer.Geometry.CoordinateSystem.ProjectedCoordinateSystems.UTM.SouthAmerica.SouthAmerican1969UTMZone20N); // Convert to the correct specific SOAP SpatialReference subtype with CoordinateSystemToSoap<SOAP Type>. // All objects to convert must be projected coordinate systems, which convert to the same SOAP type. System.Collections.Generic.List<ProjectedCoordinateSystem> soapProjCss = SoapConverter.CoordinateSystemToSoap<ProjectedCoordinateSystem>(xoProjCss); // You can also convert easily to an array of soap spatial references - many web services take arrays of SOAP objects as input parameters, // and commonly the SOAP parent type SpatialReference is specified, instead of the subtype ProjectdCoordinateSystem or GeographicCoordinateSystem. SpatialReference[] soapSpatRefArray = soapProjCss.ToArray();
CopyVB.NET
' Remember you will need a using (Imports in Visual Basic) statement to the namespace of the SOAP definitions ' for your web references, e.g. the namespace containing the SpatialReference SOAP type. ' Create a list containing ArcGIS Explorer projected coordinate systems. Dim xoProjCss As System.Collections.Generic.List(Of ESRI.ArcGISExplorer.Geometry.CoordinateSystem) = New System.Collections.Generic.List(Of CoordinateSystem)(3) xoProjCss.Add(ESRI.ArcGISExplorer.Geometry.CoordinateSystem.ProjectedCoordinateSystems.Polar.NorthPoleStereographic) xoProjCss.Add(ESRI.ArcGISExplorer.Geometry.CoordinateSystem.ProjectedCoordinateSystems.NationalGrids.NewZealand.NewZealandMapGrid) xoProjCss.Add(ESRI.ArcGISExplorer.Geometry.CoordinateSystem.ProjectedCoordinateSystems.UTM.SouthAmerica.SouthAmerican1969UTMZone20N) ' Convert to the correct specific SOAP SpatialReference subtype with CoordinateSystemToSoap(Of SOAP Type). ' All objects to convert must be projected coordinate systems, which convert to the same SOAP type. Dim soapProjCss As System.Collections.Generic.List(Of ProjectedCoordinateSystem) = SoapConverter.CoordinateSystemToSoap(Of ProjectedCoordinateSystem)(xoProjCss) ' You can also convert easily to an array of soap spatial references - many web services take arrays of SOAP objects as input parameters, ' and commonly the SOAP parent type SpatialReference is specified, instead of the subtype ProjectdCoordinateSystem or GeographicCoordinateSystem. Dim soapSpatRefArray As SpatialReference() = soapProjCss.ToArray()