In ArcGIS Java SDK, there are many examples. For a map, the coordinate system (spatial reference) is very important. It directly determines the coordinate value of a point! Therefore, this example is very basic! Paste
This example shows that projectpoint is an example of geometry. The engine init and shutdown are omitted. the engine and ArcView licenses are required.
System. Out. println ("Starting projectpoint-An ArcObjects Java SDK developer sample ");
// Create a point with geographic coordinates... Point point = New Point (); point. putcoords ( -100.0, 40.0 ); System. Out. println ( "Original coordinates:" + point. getx () + "," + Point. Gety ()); // Create the spatialreferenceenvironment... Spatialreferenceenvironment = New Spatialreferenceenvironment (); // Apply the initial spatial reference... Ispatialreference geographiccoordinatesystem = Spatialreferenceenvironment. creategeographiccoordinatesystem (esrisrgeocstype. esrisrgeocs_nad1927); point. setspatialreferencebyref (geographiccoordinatesystem ); // Create the output projected coordinate system... Ispatialreference projectedcoordinatesystem = Spatialreferenceenvironment. createprojectedcoordinatesystem (esrisrprojcstype. esrisrprojcs_nad1983utm_13n ); // Create the geotransformation... Igeotransformation = (Igeotransformation) spatialreferenceenvironment. creategeotransformation (esrisrgeotransformationtype. esrisrgeotransformation_nad1927_to_wgs1984_5 ); // Project the point... Point. projectex (projectedcoordinatesystem, esritransformdirection. esritransformforward, igeotransformation, False , 0.0, 0.0 ); System. Out. println ( "Projected coordinates:" + point. getx () + "," + Point. Gety (); system. Out. println ( "Done! ");
The most important coordinate systems are wgs1984 and beijing1954 and xian1980, which are unique to China. esrisrgeocstype does not have the Xian keyword. Two grs1980 and ossn1980 do not know if they are
Com. ESRI. ArcGIS. Geometry. esrisrgeocstype. esrisrgeocs_beijing1954 = 4214; Com. ESRI. ArcGIS. Geometry. esrisrgeocstype. esrisrgeocs_wgs1984= 4326;Public Static Final IntEsrisrgeocs_grs1980 = 4019;Public Static Final IntEsrisrgeocs_ossn1980 = 4279;
Esrisrprjcstype also has a coordinate systemCode.