Mutual conversion of the geometry type of the ArcGIS Server. Net Web ADF

Source: Internet
Author: User
Tags dotnet soap ipoint

The conversion between data types derives from the Web ADF support for multivariate data. Supporting multiple data sources means that Web applications can interact with different data sources in the same application. In general, each data source can work independently from the Web ADF, only to maintain its own specific APIs. However, because the web ADF binds them together, transformations between different data types are frequently encountered in development.
A variety of transformation classes are provided in the Web ADF, provided in a static way in different namespaces.

ESRI. ArcGIS.ADF.ArcGISServer.Converter: Provides a conversion from a COM object to a value object.
ESRI. ArcGIS.ADF.Converter:
ESRI. ArcGIS.ADF.Web.Converter:
ESRI. ArcGIS.ADF.Web.DataSources.ArcGISServer.Converter:
ESRI. ArcGIS.ADF.Web.DataSources.IMS.Converter:
ESRI. ArcGIS.ADF.Web.UI.WebControls.Converter:

Because the function of GIS application and service is related to spatial data, it is mainly to deal with and analyze spatial data. For example, to get the point of the mouse click, or to obtain the elements of space, which in the process of implementing these functions, often and geometry deal with, and geometry will also be in the application of the various layers of conversion. This article focuses on the transformation of geometry types between the common APIs in the Web ADF and the various specific APIs.
1 There are several conversions, the three parties involved:
The geometry type of. NET,
The geometry type of the Web ADF: The geometry type of the web ADF here refers to the geometry type in the common API in the ADF.
The geometry type of the specific API.
For ArcGIS server, there are two types of objects in the corresponding specific API: one is the value objects in the ESRI.ArcGIS.ADF.ArcGISServer, and the other is the object in the Arcobjects.

There are detailed examples of conversions between the various types, and let's take a look at the following points:
Point:
. NET drawing to Web ADF
System.Drawing.Point dotnet_point .....
ESRI. ArcGIS.ADF.Web.Geometry.Point adf_point = ESRI. ArcGIS.ADF.Web.Geometry.Point.ToMapPoint (dotnet _point. X, dotnet _point. Y, Adf_map. Extent, (int) adf_map. Width.value, (int) adf_map. Height.value);

. NET drawing to ArcGIS Server SOAP
ESRI. ArcGIS.ADF.ArcGISServer.ImageDisplay imgdisp = new ESRI. ArcGIS.ADF.ArcGISServer.ImageDisplay ();
Imgdisp.imageheight = (int) adf_map. Height.value;
Imgdisp.imagewidth = (int) adf_map. Width.value;
int[] xvalues = new Int[1];
Xvalues[0] = dotnet _point. X
int[] yvalues = new Int[1];
Yvalues[0] = dotnet _point. Y
Get mapfuntionality
ESRI. ArcGIS.ADF.Web.DataSources.ArcGISServer.MapFunctionality ags_mapfunctionality = (ESRI. ArcGIS.ADF.Web.DataSources.ArcGISServer.MapFunctionality) Adf_map. Getfunctionality (0);
Get Resource
ESRI. ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceBase Ags_mapresource = (ESRI. ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceBase) ags_mapfunctionality. Resource;
Get Mapproxy
ESRI. ArcGIS.ADF.ArcGISServer.MapServerProxy ags_mapserverproxy = Ags_mapresource. Mapserverproxy;

To convert
ESRI. ArcGIS.ADF.ArcGISServer.MultipointN Value_multipoint = (ESRI. ArcGIS.ADF.ArcGISServer.MultipointN) Ags_mapserverproxy. Tomappoints (ags_mapfunctionality. Mapdescription,imgdisp, XValues, yvalues);
ESRI. ArcGIS.ADF.ArcGISServer.PointN Value_point = (ESRI. ArcGIS.ADF.ArcGISServer.PointN) Value_multipoint. POINTARRAY[0];

. NET drawing to ArcIMS
Get mapfunctionality
ESRI. ArcGIS.ADF.Web.DataSources.IMS.MapFunctionality ims_mapfunctionality = (ESRI. ArcGIS.ADF.Web.DataSources.IMS.MapFunctionality) Adf_map. Getfunctionality (0);
ESRI. ArcGIS.ADF.IMS.Carto.MapView Mapview = ims_mapfunctionality. Mapview;
ESRI. ArcGIS.ADF.IMS.Geometry.Envelope ims_extent = Mapview. Extent;

To convert
ESRI. ArcGIS.ADF.IMS.Geometry.Point ims_point = ESRI. ArcGIS.ADF.IMS.Geometry.Point.ToMapPoint (dotnet _point, Ims_extent, Mapview. Imagedescriptor.width, Mapview. Imagedescriptor.height);

Web ADF to ArcGIS Server SOAP
ESRI. ArcGIS.ADF.ArcGISServer.PointN value_point = ESRI. ArcGIS.ADF.Web.DataSources.ArcGISServer.Converter.FromAdfPoint (Adf_point);

Web ADF to ArcGIS Server arcobjects

Get mapfunctionality

ESRI. ArcGIS.ADF.Web.DataSources.ArcGISServer.MapFunctionality ags_mapfunctionality = (ESRI. ArcGIS.ADF.Web.DataSources.ArcGISServer.MapFunctionality) Adf_map. Getfunctionality (Ags_local_resource_index);

Get Resouce

ESRI. ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal ags_mapresourcelocal = (ESRI. ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal) ags_mapfunctionality. Resource;

To convert

ESRI. ArcGIS.Geometry.IPoint Com_point = (ESRI. ArcGIS.Geometry.IPoint) ESRI. ArcGIS.ADF.WebDataSources.ArcGISServer.Converter.ToIGeometry (adf_point,ags_mapresourcelocal. Servercontextinfo.servercontext);


Web ADF to ArcIMS
Direct conversion
ESRI. ArcGIS.ADF.IMS.Geometry.Point Ims_point = (ESRI. ArcGIS.ADF.IMS.Geometry.Point) ESRI. ArcGIS.ADF.Web.DataSources.IMS.Converter.ToIMSGeometry (Adf_point);

ArcGIS Server soap to Web ADF
Direct conversion
ESRI. ArcGIS.ADF.Web.Geometry.Point new_adf_point = ESRI. ArcGIS.ADF.Web.DataSources.ArcGISServer.Converter.ToAdfPoint (Value_point);

ArcGIS Server arcobjects to Web ADF
Direct conversion
ESRI. ArcGIS.ADF.Web.Geometry.Point new_adf_point = ESRI. ArcGIS.ADF.Web.DataSources.ArcGISServer.Converter.FromIPoint (Com_point);

ArcIMS to Web ADF
Direct conversion
ESRI. ArcGIS.ADF.Web.Geometry.Point New_adf_point = (ESRI. ArcGIS.ADF.Web.Geometry.Point) ESRI. ArcGIS.ADF.Web.DataSources.IMS.Converter.ToADFGeometry (Ims_point);

To be continued the line and dough

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.