Mutual Transformation from longitude and latitude to plane coordinates

Source: Internet
Author: User

There are two parts:

Part 1 simple processing

Many people may need to convert the longitude and latitude and plane coordinates when using arcobject. Since latitude and longitude are spherical coordinates and plane coordinates are Cartesian coordinate systems of the X-Y, This is a seemingly difficult problem.

A lot of people have moved out of the projection formulas (such as Gaussian projection or mokto projection) in cartography, map projection, or surveying and plotting. They are also the reference coordinates and the heads of the angle are all big.

In fact, it is very easy to implement this function. The ipoint in the ARC engine can be used for projection and Inverse Projection Operations.

Projection process (C #):

/// Coordinate System of flatref projection, where 54013 is world projection. All latitude and longitude coordinates of world projection can be converted to plane coordinates, however, due to the large distortion of the projection plane, it is also relatively large (equivalent to splitting the whole earth into a piece, and then stretching and sticking it to the plane, the distortion is of course big ). Of course, you can also choose a plane with higher accuracy, such as esrisrprojcs_beijing1954gk_23n. The corresponding value is 21483. Only the earth plane near Beijing is stretched on the plane. Due to the reduced projection area, the projection longitude is increased. However, because the area is small, some longitude and latitude cannot be converted. For example, the precision latitude of the United States cannot be converted using Beijing projection.

Flatref = pfactory. createprojectedcoordinatesystem (54013 );

 

// Nothing to say, the standard latitude and longitude of the Earth, the X-Y Inverse Projection for longitude and latitude

Earthref = pfactory. creategeographiccoordinatesystem (INT) esrisrgeocstype. esrisrgeocs_nad1983 );

/// Converts latitude and longitude points to plane coordinates.

Private ipoint getproject (Double X, Double Y)
{

Ipoint Pt = new pointclass ();

PT. putcoords (x, y );

Igeometry GEO = (igeometry) pt;
Geo. spatialreference = earthref;
Geo. Project (flatref );


Return pt;
}

 

/// Convert the plane coordinate to the longitude and latitude.
Private ipoint getgeo (Double X, Double Y)
{

Ipoint Pt = new pointclass ();

PT. putcoords (x, y );

Igeometry GEO = (igeometry) pt;
Geo. spatialreference = flatref;
Geo. Project (earthref );
Double xx = pt. X;
Return pt;
}

In fact, ipoint projection has nothing to do with any map. You can directly call ipoint for projection conversion without using a map.

Part 2

It should be accurate and not studied in depth

Http://www.3snews.net/html/88/688-18657.html

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.