- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试将 WGS84
系统中的 lat/lon
坐标重新投影到 SIRGAS 2000 中的
坐标系。UTM
坐标
使用 GDAL
,我开始将已知的 utm 坐标更改为 在相同 坐标系 (29 N) 中的纬度/经度坐标,只是为了检查我写的正确的代码(我在这里省略了错误检查):
OGRSpatialReference monUtm;
monUtm.SetWellKnownGeogCS("WGS84");
monUtm.SetUTM(29, true);
OGRSpatialReference monGeo;
monGeo.SetWellKnownGeogCS("WGS84");
OGRCoordinateTransformation* coordTrans = OGRCreateCoordinateTransformation(&monUtm, &monGeo);
double x = 621921.3413490148;
double y = 4794536.070196861;
int reprojected = coordTrans->Transform(1, &x, &y);
// If OK, print the coords.
delete coordTrans;
coordTrans = OGRCreateCoordinateTransformation(&monGeo, &monUtm);
reprojected = coordTrans->Transform(1, &x, &y);
// If OK, Print the coords.
delete coordTrans;
坐标621921.3413490148, 4794536.070196861
correspond to the Moncelos region in northern Galicia .来回变换似乎工作正常:纬度/经度坐标是正确的,当投影回 UTM 时,我得到与原始坐标相同的坐标:
UTM: 621921.34135 , 4794536.0702
Lat/lon: 43.293779579 , -7.4970160261
Back to UTM: 621921.34135 , 4794536.0702
现在,从 WGS84 lat/long
重新投影到 SIRGAS 2000 UTM
:
// Rodovia dos Tamoios, Brazil:
// - UTM -> 23 S
// - WGS 84 -> EPSG:32723
// - SIRGAS 2000 -> EPSG:31983
OGRSpatialReference wgs;
wgs.SetWellKnownGeogCS("WGS84");
OGRSpatialReference sirgas;
sirgas.importFromEPSG(31983);
coordTrans = OGRCreateCoordinateTransformation(&wgs, &sirgas);
double x = -23.57014667;
double y = -45.49159617;
reprojected = coordTrans->Transform(1, &x, &y);
// If OK, print results
delete coordTrans;
coordTrans = OGRCreateCoordinateTransformation(&sirgas, &wgs);
reprojected = coordTrans->Transform(1, &x, &y);
// If OK, print results.
这不会给出相同的结果:
WGS84 Lat/Lon input: -23.57014667 , -45.49159617
SIRGAS 2000 UTM output: 2173024.0216 , 4734004.2131
Back to WGS84 Lat/Lon: -23.570633824 , -45.491627598
如您所见,原始 WGS84 lat/lon
和 back-to_WGS84 lat/lon
坐标并不完全相同,这与第一个测试用例不同。此外,UTM x-coord
有 7 位数字(我认为它被限制为 6 (?) )。
In Google Maps ,我们可以看到两点之间相差 27 米(原始点用圆表示。我的“反向投影”点用 Dagger 表示).
最后,问题是:我做的重投影正确吗?如果是这样,为什么第二个测试用例中的重投影之间有 27 米的差异?
最佳答案
问题是您需要交换轴顺序以使用笛卡尔 X/Y 空间或 Lon/Lat,而不是“Lat/Lon”顺序。
设置它应该有效。
double x = -45.49159617; // Lon
double y = -23.57014667; // Lat
您从往返转换中看到的差异是由于交换轴顺序而投影到 UTM 区域的边界之外。
关于c++ - 使用 GDAL 库重新投影坐标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28413970/
每当我设置 Border.Effect属性的投影效果 控件中包含的每个控件都有一个投影。 有没有办法将阴影设置到边框而不是边框中包含的每个控件? 这是我的代码的一个简短示例:
我正在尝试创建一个带有阴影的对象。我相信您需要 CSS3 来执行此操作,到目前为止我已经有了类似的东西。 div { width:300px; height:100px; background
我希望能够为我的 drawables 文件夹中的矢量添加阴影。目前,当我将具有阴影的 svg 导入 Android Studio 时,转换为 xml 会删除阴影。 我将如何在 Android Stud
使用 NHibernate 2.1,我试图将一个实体及其子集合投影到 DTO 中。我的实体看起来像这样.. public class Application { public int Id {ge
我有问题还是好,我不知道如何将x,y,z值的3d点转换为2d点, 我必须绘制投影,其中的点确实有x,y,z值,但是我不知道如何将它们转换为2d,所以我可以将它们移动到我的轴上。 我一直在寻找Wiki和
我有域类位置 public abstract class BaseEntity where T: struct { public virtual T Id { get; set
我有一个使用 Android Material 图标作为背景的 ImageView 。我尝试添加标高以创建投影效果,但仅显示图标。是否可以将标高添加到矢量资源可绘制对象中? 矢量代码:
我正在尝试连接并以逗号分隔(或空格)列表并将其投影。我在下面有一些示例代码。 public class Friend { public string Name { get; set; } }
是否有任何库可以轻松地允许 Java bean 投影? 我有一个按照 Javabean 约定用 getter 和 setter 编写的 bean,并且在运行时在不同的地方我想要获取一个完全填充的 be
我可以成功地做到: point.transform(new OpenLayers.Projection("EPSG:900913"), new OpenLayers.Projection("EPSG:
我对 OpenLayers 3 有点问题。我有以下脚本: var map = new ol.Map({ view : new ol.View({ center : [5.611
我正在尝试向 ImageView 添加阴影。 Stackoverflow 的另一个答案似乎是使用 Canvas 和位图等,比需要的复杂得多。 在 iOS 上我会做这样的事情: myImageView.
我有一个 JPanel 元素,我想给它添加一个阴影,我怎样才能给元素添加一个漂亮的褪色阴影?我需要使用外部库还是可以使用内置的东西? 例子: 最佳答案 所以我查看了 swingx它扩展了 JPanel
如何使用 MongoDB 查询预测作者的名字 { name: "Wings Of Fire", author: { first: "Abdul", last: "Kalam" } }
我有一个集合“帐户”,其中包含类似于此结构的文档: { "email" : "john.doe@acme.com", "groups" : [ {
我试图弄清楚如何使用枚举列表(@ElementCollection)对实体进行 DTO 投影。不幸的是,缺少 QueryDsl 文档,在这里我只能找到版本 3 的结果 不是 适用于版本 4。 @Ent
我想要悬停 div 时出现的箭头 here也投下影子。箭头是从 CSS 绘制的: .arrow { position:absolute; margin-top:-50px; left:80px; bo
如何使用 QueryOver 和 AliasToBean 将枚举值转换为字符串值?我有以下但在尝试转换 Enum 时出错: SomeDTO someDTO = null;
我有这个外部 GeoJSON 文件: {"type": "FeatureCollection", "features": [ {"type":"Feature", "id":382, "propert
我对 Hibernate 的预测和标准有点困惑。何时使用预测以及何时使用标准? 最佳答案 它们并不相互排斥,您可以同时使用两者。预测通常在某些标准的背景下使用。 简单地说,Hibernate Proj
我是一名优秀的程序员,十分优秀!