Proj.net is the. NET version of the open source map projection library proj.4, many GIS open source software projections are directly or indirectly using the Proj.4 library, proj.4 is written in C language. NET open source GIS project Nettopologysuite Development and maintenance of the latest version of the Proj.net project, address is: GITHUB.COM/NETTOPOLOGYSUITE/PROJNET4GEOAPI
First, the concept of space coordinate system
A position in a space, usually represented by a coordinate, and where the coordinates and position are to correspond correctly, you must understand how the coordinate system of the coordinate is defined, and the coordinate system is also called the Spatial Reference (spatialreference) in some software. Every coordinate of a map must know its coordinate system definition method, the data of each layer or each feature in a map must be in the same coordinate system or converted to the same coordinate system, can be directly performed, such as calculate area, distance, or judge spatial relation. The related concepts of spatial coordinate system include geoid, reference ellipsoid, datum plane, geographic coordinate system, projection coordinate system and so on. GeoID (GeoID): a stationary Pingjinghei and its closed surface, called the geoid, which is extended to the land, is an irregular shape. The geoid is the most basic description of the shape of the earth, where the direction of gravity is perpendicular to the geoid at every point in the geoid. The geoid does not have an accurate mathematical formula. Reference ellipsoid (ellipsoid): The geoid is fitted with a regular ellipsoid, which is represented by two of the three parameters of the long half axis, the short half axis, and the flattening ratio. Due to different measurement methods, there will be different parameters of the reference ellipsoid, the Beijing 54 coordinate system using the Krassovsky 1940 ellipsoid, Xi ' an 80 coordinate system using the IAG 75 ellipsoid, GPS coordinates using the WGS 1984 ellipsoid. Datum (Datum): Defines the position of the ellipsoid relative to the center of the Earth, based on the reference ellipsoid. The datum can be divided into the geocentric datum and the area datum, the center of the Geocentric Datum ellipsoid is in the geocentric (Earth's centroid), and the Broadest datum is WGS 1984, which is used to measure the position worldwide. The local datum is in a specific area with the Earth's surface very well, a certain point on the surface of the ellipsoid and the surface of the Earth to match a particular point, which is called the origin of the Datum plane, the 54 coordinate system datum origin in the former USSR Pulkovo, 80 coordinate system datum origin in Xian. Geographic coordinate system (GEOGRAPHICCOORDINATESYSTEM): a spherical coordinate system, on the basis of the datum, plus the Prime meridian (the location of the origin), the direction of the axis (positive in the x direction, north of the y direction), The definition of the coordinate unit (angle or radians). Coordinates in geographic coordinates are our common latitude and longitude coordinates. Projected coordinate system (Projectedcoordinatesystem): is a planar coordinate system (two-dimensional planar coordinate), based on a geographic coordinate system, with the definition of a projection method, a parameter, an axis direction, and a coordinate unit.
Second, the method of creating coordinate system in Proj.net
Proj.net supports datum transformations, geographic coordinate systems, projected coordinate systems, geocentric coordinate systems, which can be used under a variety of. NET frameworks, and supports Silverlight. It can perform coordinate transformations between point-to-point, as well as convert the coordinate system to well-known Text (WKT) and XML. Currently supported projection types are: Mercator, transverse Mercator projection (transverse Mercator), Albers, positive axis conformal cut conic projection (Lambert conformal conic, Lambert projection). 2.1 Manual Code creation: Initializes a factory object to create the relevant object for the coordinate system:
var cFac = new Coordinatesystemfactory ();
1) Creating a reference ellipsoid
var ellipsoid = Cfac.createflattenedsphere ("Bessel 1840", 6377397.155, 299.15281, linearunit.metre);
2) Create plane
var datum = cfac.createhorizontaldatum ("Bessel 1840", Datumtype.hd_geocentric, ellipsoid, NULL);
3) Create a geographic coordinate system
var gcs = cFac.CreateGeographicCoordinateSystem (
"Bessel 1840", // custom name
AngularUnit.Degrees,
datum,
PrimeMeridian.Greenwich,
new AxisInfo ("Lon", AxisOrientationEnum.East),
new AxisInfo ("Lat", AxisOrientationEnum.North)
);
4) Create a projected coordinate system
// projection parameters
var parameters = new List <ProjectionParameter> (5);
parameters.Add (new ProjectionParameter ("latitude_of_origin", 0));
parameters.Add (new ProjectionParameter ("central_meridian", 110));
parameters.Add (new ProjectionParameter ("scale_factor", 0.997));
parameters.Add (new ProjectionParameter ("false_easting", 3900000));
parameters.Add (new ProjectionParameter ("false_northing", 900000));
// projection definition
var projection = cFac.CreateProjection (
"MercatorProjection", // custom name
"Mercator_1SP", // The name of the projection method recognized by the system
parameters
);
// projection coordinate system
var pcs = cFac.CreateProjectedCoordinateSystem (
"Makassar / NEIEZ", // custom name
gcs,
projection,
LinearUnit.Metre,
new AxisInfo ("East", AxisOrientationEnum.East),
new AxisInfo ("North", AxisOrientationEnum.North)
);
5) Common coordinate systems preset in the project
var centricCS = GeocentricCoordinateSystem.WGS84; // geocentric coordinate system
var geoCs = GeographicCoordinateSystem.WGS84; // geographic coordinate system
var webMercator = ProjectedCoordinateSystem.WebMercator; // WebMercator projected coordinate system
var utm33 = ProjectedCoordinateSystem.WGS84_UTM (33, true); // UTM projected coordinate system
2.2 Based on the WKT string creation will describe a coordinate system needs a variety of data, in accordance with the GIS standardization organization of the format specified by the form of a string expression, the string is the wkt string representing the coordinate system, For example, the map projection used in China's 1 million topographic maps is a double standard parallel conformal conic projection with the wkt string as follows: projcs["Liongg", geogcs["gcs_beijing_1954", datum["D_Beijing_1954", spheroid["krasovsky_1940", 6378245.0,298.3]], primem ["Greenwich", 0.0], unit["degree", 0.0174532925199433 ]], projection["Lambert_conformal_conic"], parameter["False_easting", 20500000.0], parameter["False_Northing", 0.0 ], parameter["Central_meridian",0.0], parameter["Standard_parallel_1", 25.0], parameter["Standard_Parallel_2", 47.0 ], parameter["Scale_factor", 1.0], parameter["Latitude_of_origin",0.0], unit["Meter", 1.0]]; According to the wkt string, the code for creating its corresponding coordinate system is as follows:
2.3 Based on Srid file creation
To record and save various common coordinate systems, the contents of the wkt string are decomposed, And then as a table in the form of a srid.csv file, a row in the table represents a coordinate system definition, and by the GIS standardization Organization for each coordinate system is a unified numbering and naming, we can be based on the number to create its corresponding coordinate system.
var cs = Sridreader.getcsbyid (4326);
Third, the projection type and the application situation
has already introduced, the projection coordinate system is in the geographical coordinate system Foundation, adds the projection method, the parameter, the axis direction and the coordinate unit and so on to define. One of the most important is the projection method and parameters, the projection method is that we use a mathematical formula, the latitude and longitude coordinates to the plane coordinates, the parameter is to determine the projection method, the need to set its projection parameters, different parameters set, can meet the needs of different regions of the data. There are 5 common projection parameters in proj.net, each of which has the following meanings: Central_meridian: Central meridian (Longitude of Projection center) Latitude_of_origin: center point of projection latitude Scale_ Factor: Scale factor false_easting: East pseudo offset (x value of origin in new coordinate system) False_northing: North Pseudo-offset (Y value of origin in new coordinate system) different projection method, with its own unique projection parameters, The following projection methods are described in detail. proj.net the current version supports 11 projection methods, represented in the project by 11 classes, namely: Mercator, Pseudomercator, Transversemercator, Albersprojection, LAMBERTCONFORMALCONIC2SP, Obliquestereographicprojection, Krovakprojection, Polyconicprojection, Cassinisoldnerprojection, Hotineobliquemercatorprojection, and obliquemercatorprojection, when creating a projected coordinate system, you need to specify the projection method name, Based on the projection method name to find the corresponding projection class, a projection class may correspond to multiple projection method names, followed by the use of the method and the occasion. The Mercator projection of the 3.1 Mercator (Mercator projection) is a conformal positive-axis cylindrical projection, with the projection longitude as a parallel straight line orthogonal to each other. The projection is widely used in marine aviation, and the isometric route is a straight line on the map. The projection method name is Mercator, MERCATOR_1SP, and MERCATOR_2SP are all pairs of classes. The MERCATOR_1SP is a tangent cylindrical projection and the MERCATOR_2SP is a cut cylindrical projection. Projection method Name MERCATOR_1SP has 5 common parameters (no projection of Mercator and MERCATOR_2SP found in Srid.cvs) 3.2 PseudomercaThe Tor (pseudo-Mercator) pseudo-Mercator projection, also known as the Web mercator , is the first to be used by Google Maps, or, more specifically, Google's first invention. During the projection process, the reference ellipsoid representing the earth is approximated as a positive sphere (the sphere radius R = ellipsoid Half-length axis a), and then a cylindrical projection using conformal positive axes. With this projection, an area of latitude-85 degrees (approximate) to 85 degrees is a square on the projection plane. The projection method name can be pseudo-mercator, popular_visualisation pseudo-mercator, or Google_mercator. The ID of this coordinate system went through a tortuous process, and many friends who did web development were puzzled. Simply take a look: openlayers:900913 because of the official certification Id,google for the Web Mercator wayward developed this id,google=900913epsg:3785 this is EPSG in 2008 to the Web Mercat or wkid, but the plane of the coordinate system is a positive sphere, not WGS 1984. has been discarded for some time. epsg:3857 EPSG is the final wkid for the web Wercator, which is now the coordinate system of the Web map we commonly use, and given the official name "WGS 84/pseudo-mercator". esri:102113 ESRI Internal use ID, corresponding to epsg:3785. has been deprecated. ESRI:102100 ESRI Internal use ID, corresponding to epsg:3857. 3.3 transversemercator (Transverse Mercator) is similar to the transverse Mercator projection (transverse mercator) Mercator projection, except that the cylinder is tangent along the meridian rather than along the equator. The isometric projections generated by this method do not maintain the true orientation. The projection is a sphere that sees the earth as a radius =r, and if the earth is considered an ellipsoid, it is a universal transverse Mercator projection or a Gaussian-gram gauss–krüger projection. The projection is orthogonal to each other in the high and vertical circles, and the longitude is curved. The Mercator projection is a parallel line for its meridians, allowing time zones to be displayed, such as time zone plots, aerial maps, nautical charts, etc. Universal Transverse Mercator (Universal transverse mercator) (UTM): The universal Transverse Mercator coordinate system is a specialized application to the transverse Mercator projection. The earth is divided into 60 regions, each of which spans a longitude of 6 degrees. has been used as a mathematical basis for topographic maps in many countries. This projection is generally used in the range from south latitude 80 to northern latitude 84 degrees, The UPS projection (universal spherical polar projection) is used for the polar regions. Gaussian-gram Gauss–krüger projection (Gauss-krüger): This projection is similar to the Mercator projection, except that the cylinder is tangent along the meridian rather than along the equator. The isometric projections generated by this method do not maintain the true orientation. Gaussian-gram Gauss–krüger (Gauss-kruger) is a conformal transverse elliptic column projection. The projection is in the central meridian and the equator after the axis, and the central meridian length ratio = 1. The projection divides the Earth into 60 projection belts, each with a 6-degree deviation, which has been used as a mathematical basis for topographic maps in many countries. This projection is generally used in the range from south latitude 80 to latitude 84 degrees. UPS projection (Universal spherical polar projection) for polar regions. Gaussian-gram gauss–krüger projections typically have a 6-degree range or 3-degree projection, which increases after 6 degrees. Usually used to make large scale map projection, such as 1/500,000, 1/100,000, 1/50,000, 1/10,000, etc. The projection method is named transverse_mercator,5 common parameter 3.4 albersprojection (Albers equal area projection) Albers equal product conic projection (albers equal area conic) is a two-standard parallel projection, that is, a positive axis and other areas of the conic projection. The longitude of the projection graticule is a radiating line, and the parallels are concentric circular arcs. The application of Albers cone projection is widely used in compiling some administrative map, population map, topography diagram and so on. such as China topography Map, that is, q1=25 degree, q2=45 degree of Albers, such as cone projection. This conic projection uses two standard parallels to reduce distortion to some extent compared to a projection using a standard parallel. The shape and linear proportional deformation between standard parallels is minimal. The projection method is named Albers, Albers_conic_equal_area. The parameters of the Albers_conic_equal_area are: Standard_parallel_1, standard_parallel_2, Latitude_of_origin, Longitude_of_center, False_easting, false_northing 3.5 lambertconformalconic2sp (Lambert projection) Lambert isometric conic projection is one of the most suitable projections for mid-latitude. It is similar to the Albers equal area cone projection, except that the Lambert conformal conic projection depicts a more accurate shape. Lambert Isometric conic projection is also called the Lambert positive conic projection, the differential circle of the projectionThe projection is still circular. The meridians are radiating straight lines and the parallels are concentric circular arcs. Specify two standard latitude line q1,q2, no length distortion on these two latitude lines, i.e. m=n=1. This kind of projection is also called conformal cut conic projection, which can be used to compile medium and small scale maps. China's sub-provincial chart, that is, two standard latitude line for q1=25 degrees, q2=45 degrees of Lambert conformal conic projection. After 1962, the million-part map uses a conformal conic projection, near the polar area, with conformal azimuth projections (polar spherical projections). The projection method is named Lambert_conformal_conic, LAMBERT_CONFORMAL_CONIC_2SP, Lambertconformalconic2spsrid.cvs Lambert_conformal_ CONIC_1SP, the parameters with 5 general parameters LAMBERT_CONFORMAL_CONIC_2SP are: Standard_parallel_1, standard_parallel_2, Latitude_of_origin, Central_meridian, false_easting, false_northing 3.6 obliquestereographicprojection (oblique spherical projection) Proj.Net This projection is supported for 1.3.2 versions above. This projection is a conformal azimuth projection, the most suitable region is the polar region, the projection center point at the north or South Pole (the Latitude_of_origin parameter value is 90 or-90), called the Polar Spherical projection (polar stereographic). Universal Polar Projection (universal polar stereographic) (UPS) is a dedicated topographic map projection designed by the United States in 1948 for areas above the south latitude of 80°. The projection plane of the UPS is cut ellipsoid at 81 degree parallels (scale_factor parameter value is 0.994), Central_meridian parameter is 0,false_easting and false_northing parameters are 2000000 The 3.7 krovakprojection (Krovak projection) krovak projection is a diagonal Lambert conformal conic projection designed for the former Ceskoslovensko. 3.8 polyconicprojection (multi-cone projection) multi-conic projection (polyconic): The name of this projection can be understood as "many cones" and the projection method is also pointed out. Common multi-conic projection (ordinary polyconic Projection): Normal multi-cone projection of the meridian is symmetrical to the central meridian and the equator Curve, parallels projection for the coaxial circular arc, Arc Center is located on the central diameter line, the central meridian is a straight line, M=1, parallels with the central meridian orthogonal, N=1. The projection is applied to areas extending along the central meridian (within 15 degrees). It is often used to compile the mathematical basis of medium and small scale. This projection is widely used in the United States and is the basis of the millions of map projections. 3.9 cassinisoldnerprojection (Cassini-Cassini–soldner projection) Cassini-Cassini–soldner projection (Cassini-soldner): The scale of the horizontal cylindrical projection remains the same along the central Meridian and all line directions parallel to it. This projection is neither an equal-product projection nor an isometric projection. 3.10 hotineobliquemercatorprojection (Hotine oblique Mercator) Hotine oblique Mercator projection (hotine oblique mercator): This projection is the projection of the Mercator projection that rotates along the oblique axis, and the purpose of developing the projection is to draw an conformal map for areas that are neither North-south nor east-west, but that are tilted in direction. 3.11 obliquemercatorprojection (oblique Mercator) space oblique Mercator projection (space oblique mercator): For this projection, the satellite is drawn in the orbit map (e.g., The U.S. Terrestrial Resources Satellite (Landsat)) has an almost constant shape within the detection range and almost no proportional deformation.