近兩天需要把平面坐標(biāo)轉(zhuǎn)換為標(biāo)準(zhǔn)的WGS84后使用百度逆地址編碼
搜索出資料記錄一下
- 類庫 程序ProjNet4GeoAPI
static void PtsToPts(ICoordinateSystem fromCS, ICoordinateSystem toCS,List<double[]> pts, out List<double[]> results)
{
CoordinateTransformationFactory ctfac = new CoordinateTransformationFactory();
ICoordinateTransformation trans = ctfac.CreateFromCoordinateSystems(fromCS, toCS);
results = trans.MathTransform.TransformList(pts);
}
static void Main(string[] args)
{
string bj1954Lcc= "……"; //見上文
IProjectedCoordinateSystem fromCS = CoordinateSystemWktReader.Parse(bj1954Lcc) as IProjectedCoordinateSystem;
GeographicCoordinateSystem toCS = GeographicCoordinateSystem.WGS84;
double[] xPts = new double[4] { 20634500, 20635500, 20634500, 20635500 };
double[] yPts = new double[4] { 4660000, 4660000, 4659000, 4659000 };
List<double[]> pts = new List<double[]>();
for (int i = 0; i < 4; i++)
{
double[] xy = new double[] { xPts[i], yPts[i] };
pts.Add(xy);
List<double[]> results = new List<double[]>();
PtsToPts(fromCS, toCS, pts, out results);
foreach (double[] result in results)
{
Console.WriteLine("{0},{1}", result[0], result[1]);
}
}
百度地圖逆地址編碼
百度逆地理編碼服務(wù)GDAL相關(guān)
...and...You can find the GDAL API documentation here
There is an GDAL API tutorial here
The OGR API documentation is here
The OSR API documentation is here
All the links you need for GDAL can be reached from http://www.gdal.org/
All the links you need for OGR/OSR can be reached from http://www.gdal.org/ogr/
下載編譯后的GDAL地址
參考資料:
[類庫地址亭畜,包含GeoAPI趾唱、proj4net裁奇、ProjNet4GeoAPI]
(https://pan.baidu.com/s/1skMrbHF)
DotSpatial.Projections Vs. ProjNET4GeoAPI
星星分享