Deviation of coordinate transformation caused by the expiration of tomappoint

Source: Internet
Author: User
Create and click ( Identify ), Select ( Select . In ArcGIS Server. Net ADF SP3 Previously, the following statement was used for conversion:

Rectangle rect = (ARGs As Rectangleeventargs). screenextent;
ESRI. ArcGIS. ADF. Web. Geometry. Point minadfpoint = ESRI. arcGIS. ADF. web. geometry. point. tomappoint (rect. left, rect. bottom, mapctrl. extent, mapfunc. displaysettings. imagedescriptor. width, mapfunc. displaysettings. imagedescriptor. height );
ESRI. ArcGIS. ADF. Web. Geometry. Point maxadfpoint = ESRI. arcGIS. ADF. web. geometry. point. tomappoint (rect. right, rect. top, mapctrl. extent, mapfunc. displaysettings. imagedescriptor. width, mapfunc. displaysettings. imagedescriptor. height );
ESRI. ArcGIS. ADF. Web. Geometry. Envelope adfenvelope =   New ESRI. ArcGIS. ADF. Web. Geometry. Envelope (minadfpoint, maxadfpoint );


In SP3 In the future, the above statement will receive a warning during compilation:" ESRI. ArcGIS. ADF. Web. Geometry. Point. tomappoint (INT, Int, ESRI. ArcGIS. ADF. Web. Geometry. envelope, Int, INT) "Expired. RunProgramIt seems that there is no deviation. To Map ServiceMake a cache and run it again. There is a significant deviation. See the following two figures:

Figure-1

Figure 2
Further test, as long Mapresourcemanager Any Map Service If the cache is used, the deviation will occur, but the cache is normal without it. This is exactly where people are fooled. Which of the following statements is best? ESRI The help documentation is simple and horrible, ArcGIS Server. Net ADF Of API The document looks bare and tells you that the method is outdated, but does not prompt you to use any alternative method. As my manager said, GIS The software giant is just a three-stream software company in the United States.
Fortunately Google Finally, the correct method is found. Use the following statement:

Rectangle rect = (ARGs As Rectangleeventargs). screenextent;
ESRI. ArcGIS. ADF. Web. Geometry. Point minadfpoint = ESRI. arcGIS. ADF. web. geometry. point. tomappoint (rect. left, rect. bottom, mapctrl. gettransformationparams (ESRI. arcGIS. ADF. web. geometry. transformationdirection. tomap ));
ESRI. ArcGIS. ADF. Web. Geometry. Point maxadfpoint = ESRI. arcGIS. ADF. web. geometry. point. tomappoint (rect. right, rect. top, mapctrl. gettransformationparams (ESRI. arcGIS. ADF. web. geometry. transformationdirection. tomap ));
ESRI. ArcGIS. ADF. Web. Geometry. Envelope adfenvelope =   New ESRI. ArcGIS. ADF. Web. Geometry. Envelope (minadfpoint, maxadfpoint );

Note gettransformationparams and transformationdirection. My development environment is Visual Studio 2005 + ArcGIS Server. Net ADF SP4 + ArcGIS Desktop 9.2 SP4 + ArcSDE 9.1.

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.