给定边界框为纬度/经度并且“点”为坐标,如何在 ESRI 折线中绘制点作为弧度?

发布于 2024-08-31 18:36:29 字数 732 浏览 16 评论 0原文

我正在使用 OpenMap 并使用 com.bbn.openmap.layer.shape.ShapeFile 读取 ShapeFile。边界框以纬度/经度点的形式读取,例如 39.583642,-104.895486。边界框是左下点和右上角点,表示包含点的位置。在 OpenMap 中称为“弧度”的“点”采用不同的格式,如下所示:[0.69086486, -1.8307719, 0.6908546, -1.8307716, 0.6908518, -1.8307717, 0.69085056, -1.8307722, 084936,-1.8307728 、0.6908477、-1.8307738、0.69084626、-1.8307749、0.69084185、-1.8307792]。

如何将“0.69086486,-1.8307719”等点转换为可在普通图形中使用的x,y坐标?

我相信这里所需要的只是某种转换,因为将这些点带入 Excel 并绘制它们的图形会创建一条曲线与给定位置(纬度/经度)的道路曲线相匹配的线。但是,轴需要手动调整,并且我没有关于如何调整轴的参考,因为给定的边界框似乎与给定点的格式不同。

ESRI Shapefile技术描述似乎没有提到这一点(http://www .esri.com/library/whitepapers/pdfs/shapefile.pdf)。

I'm using OpenMap and I'm reading a ShapeFile using com.bbn.openmap.layer.shape.ShapeFile. The bounding box is read in as lat/long points, for example 39.583642,-104.895486. The bounding box is a lower-left point and an upper-right point which represents where the points are contained. The "points," which are named "radians" in OpenMap, are in a different format, which looks like this: [0.69086486, -1.8307719, 0.6908546, -1.8307716, 0.6908518, -1.8307717, 0.69085056, -1.8307722, 0.69084936, -1.8307728, 0.6908477, -1.8307738, 0.69084626, -1.8307749, 0.69084185, -1.8307792].

How do I convert the points like "0.69086486, -1.8307719" into x,y coordinates that are usable in normal graphics?

I believe all that's needed here is some kind of conversion, because bringing the points into Excel and graphing them creates a line whose curve matches the curve of the road at the given location (lat/long). However, the axises need to be adjusted manually and I have no reference as how to adjust the axises, since the given bounding box appears to be in a different format than the given points.

The ESRI Shapefile technical description doesn't seem to mention this (http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

懵少女 2024-09-07 18:36:29

0.69086486, -1.8307719 是以弧度表示的纬度和经度。

首先,转换为度数(乘以 (180/pi)),然后您的边界框和坐标之间将具有通用单位。

然后,您可以使用以下内容在本地框架中绘制所有内容:

x = (longitude-longitude0)*(6378137*pi/180)*cos(latitude0*pi/180)
y = (latitude-latitude0)*(6378137*pi/180)

(latitude0, longitude0) 是参考点的坐标(例如边界框的左下角)
角度单位为,距离单位为

编辑 - 解释:
这是地球的正投影,被视为半径为 6378137.0 m(WGS84 椭球的半长轴)的球体,以点 (lat0, lon0) 为中心

0.69086486, -1.8307719 is a latitude and a longitude in radians.

First, convert to degrees (multiply by (180/pi)), then you will have common units between your bounding box and your coordinates.

Then you can plot all of it in a local frame with the following :

x = (longitude-longitude0)*(6378137*pi/180)*cos(latitude0*pi/180)
y = (latitude-latitude0)*(6378137*pi/180)

(latitude0, longitude0) are the coordinates of a reference point (e.g. the lower-left corner of the bounding box)
units are degrees for angles and meters for distances

Edit -- explanation :
This is an orthographic projection of the Earth considered as a sphere whose radius is 6378137.0 m (semi-major axis of the WGS84 ellipsoid), centered on the point (lat0, lon0)

不必在意 2024-09-07 18:36:29

在 OpenMap 中,有多种方法可以将弧度转换为十进制:

Length.DECIMAL_DEGREE.fromRadians(radVal);
Math.toDegrees(radVal)  // Standard java library

对于数组,可以使用 ProjMath.arrayDegToRad(double[] radvals);

小心最后一个,它会就地进行转换。因此,如果您从 OMPoly 获取纬度/经度数组,请在转换之前先复制它。否则,您将弄乱 OMPoly 的内部坐标,它预计以弧度为单位。

In OpenMap, there are a number of ways to convert from radians to decimal degrees:

Length.DECIMAL_DEGREE.fromRadians(radVal);
Math.toDegrees(radVal)  // Standard java library

For an array, you can use ProjMath.arrayDegToRad(double[] radvals);

Be careful with that last one, it does the conversion in place. So if you grab a lat/lon array from an OMPoly, make a copy of it first before converting it. Otherwise, you'll mess up the internal coordinates of the OMPoly, which it expects to be in radians.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文