ArcGIS Explorer Component Help |
SoapConverter..::.GeometryToSoap<(Of <(TExplorer, TSoap>)>) Method (IEnumerable<(Of <(TExplorer>)>)) |
SoapConverter Class Example See Also |
Assembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public static List<TSoap> GeometryToSoap<TExplorer, TSoap>( IEnumerable<TExplorer> explorerGeometry ) where TExplorer : Geometry |
Visual Basic (Declaration) |
---|
Public Shared Function GeometryToSoap(Of TExplorer As Geometry, TSoap) ( _ explorerGeometry As IEnumerable(Of TExplorer) _ ) As List(Of TSoap) |
Parameters
- explorerGeometry
- Type: System.Collections.Generic..::.IEnumerable<(Of <(TExplorer>)>)
An enumerable set of ArcGIS Explorer Geometry objects to convert to a SOAP objects.
Type Parameters
- TExplorer
- The Type of the ArcGIS Explorer Geometry class contained in the enumerable set passed in to this method in the explorerGeometry parameter.
- TSoap
- The Type of SOAP object to convert the explorerGeometry set to. Must be the appropriate SOAP Type to match the TExplorer type parameter.
Return Value
A List containing SOAP geometry objects of type TSoap based on the properties of the geometries in explorerGeometry.Remarks
Use this method to convert multiple of ArcGIS Explorer Point, Multipoint, Polyline, Polygon or Envelope objects into corresponding SOAP objects. You must specify the Type of both ArcGIS Explorer object and returned SOAP Type as the type parameters for this generic method. Specify the SOAP Type by passing in the 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.
You must always specify the most-derived Type - for example specify a SOAP Type of PointN, and not Point. This method cannot be used to convert binary SOAP objects (those Types ending in 'B', for example PointB, EnvelopeB).
This method cannot be used to convert Multipatch objects.
Examples
// 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 of ArcGIS Explorer Points. System.Collections.Generic.List<ESRI.ArcGISExplorer.Geometry.Point> xoPoints = new System.Collections.Generic.List<ESRI.ArcGISExplorer.Geometry.Point>(3); xoPoints.Add(new ESRI.ArcGISExplorer.Geometry.Point(0, 0)); xoPoints.Add(new ESRI.ArcGISExplorer.Geometry.Point(1, 51)); xoPoints.Add(new ESRI.ArcGISExplorer.Geometry.Point(-47, 60)); // Convert to a SOAP PointNs with GeometryToSoap<Explorer Type, SOAP Type>. // All objects to convert must be the same ArcGIS Explorer geometry type as they will be converted to the same SOAP type. System.Collections.Generic.List<PointN> soapPointsN = SoapConverter.GeometryToSoap<ESRI.ArcGISExplorer.Geometry.Point, PointN>(xoPoints); // You can also convert easily to an array - many web services take arrays of SOAP objects as input parameters. PointN[] soapPointArray = soapPointsN.ToArray();
' 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 of ArcGIS Explorer Points. Dim xoPoints As System.Collections.Generic.List(Of ESRI.ArcGISExplorer.Geometry.Point) = New System.Collections.Generic.List(Of ESRI.ArcGISExplorer.Geometry.Point)(3) xoPoints.Add(New ESRI.ArcGISExplorer.Geometry.Point(0, 0)) xoPoints.Add(New ESRI.ArcGISExplorer.Geometry.Point(1, 51)) xoPoints.Add(New ESRI.ArcGISExplorer.Geometry.Point(-47, 60)) ' Convert to a SOAP PointNs with GeometryToSoap(Of Explorer Type, SOAP Type). ' All objects to convert must be the same ArcGIS Explorer geometry type as they will be converted to the same SOAP type. Dim soapPointsN As System.Collections.Generic.List(Of PointN) = SoapConverter.GeometryToSoap(Of ESRI.ArcGISExplorer.Geometry.Point, PointN)(xoPoints) ' You can also convert easily to an array - many web services take arrays of SOAP objects as input parameters. Dim soapPointArray As PointN() = soapPointsN.ToArray()