我正在尝试在地理坐标和地磁坐标之间进行转换。我找到了以下 Prolog 脚本,但我对它的理解不够,无法自己转换。目标语言是 Java,但任何可以理解的语言都可以(C、Python、VB 等等)。
http://idlastro.gsfc.nasa.gov/ftp/pro/astro/geo2mag.pro
如果有人可以帮助转换这个脚本或解释它到底在做什么(那些数组操作让我感到困惑),我真的很感激。
谢谢
我搜索并找到了几个可以 执行此操作的在线网络服务,但我想知道公共领域是否有一个数据库提供标准时区线的纬度和经度列表?我希望能够在不使用网络服务的情况下计算坐标所在的时区。我认为时区边界大多是静态的,并且可能是由某个委员会决定的,因此应该在某个地方有 CSV 或 GPX 或 KML。
我希望能够检查坐标位于哪个时区,例如:
48.856667 2.350833 是 GMT+1 或 CET
standards timezone geolocation latitude-longitude coordinates
我正在尝试比较地图的纬度/经度坐标数组,以查看是否有任何“集群”或组合在一起。我想删除那些靠得太近的,所以如果地图上有 4-5 个堆叠在一起,它只会显示 1,直到你放大一点,然后它会再次重新计算所有这些。
我尝试将数组与其自身进行比较,但似乎没有给出一致的结果。以前有人尝试过类似的事情吗?
JSON 示例:
[
{
Latitude = "44.033843";
Longitude = "-79.48865499999999";
},
{
Latitude = "44.033843";
Longitude = "-79.48865499999999";
}]
Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,用户输入一个位置,我必须获取该位置的纬度和经度。所以这里我没有Location对象,只有一个String.
Location我想到了使用它创建对象的选项,String但这是不可能的。
我知道使用 Google 的地方 API 是可能的,并且我知道如何使用它,但我更喜欢使用 SDK 中提供的任何方法。
有什么办法可以做到吗?
当检测鼠标x和y坐标时,最好像这样使用event.clientX和event.clientY:
function show_coords(event){
var x=event.clientX;
var y=event.clientY;
alert("X coords: " + x + ", Y coords: " + y);
}
Run Code Online (Sandbox Code Playgroud)
或者使用 x 和 y,如下所示:
function show_coords(event){
var x=event.x;
var y=event.y;
alert("X coords: " + x + ", Y coords: " + y);
}
Run Code Online (Sandbox Code Playgroud)
一种方法比另一种更好/更快吗?它们对我来说似乎工作方式相同。
我尝试获取单元格的坐标,现在我编写下一个代码:
for (Row row : sheet) {
for(Cell cell : row){
// how to get a cell coordinates?
}
}
Run Code Online (Sandbox Code Playgroud)
如何获取单元格的坐标 (dx1, dx2, dy1, dy2) ?
我有一个问题无法解决。我在游戏中使用 FitViewport 风格的舞台。
stage = new Stage(new FitViewport(SCREEN_WIDTH, SCREEN_HEIGHT));
Run Code Online (Sandbox Code Playgroud)
但是当我尝试获取触地坐标而屏幕上出现黑条时出现问题(如果屏幕具有正确的比例,则没有问题)。
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button)
{
xTouch = (int) (screenX * SCREEN_WIDTH/Gdx.graphics.getWidth());
yTouch = (int) ((SCREEN_HEIGHT) - screenY * (SCREEN_HEIGHT)/Gdx.graphics.getHeight());
}
Run Code Online (Sandbox Code Playgroud)
我用这种方法获得的坐标给出了屏幕上的位置,而不是我的游戏世界上的位置。camera.unproject 做同样的事情。我的问题是,如何忽略黑条来获取游戏世界中的位置?我花了很多时间搜索但没有找到任何有用的解决方案。
我想通过坐标从 SVG 文件获取对象 ID。
例如在
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1"
height="50" width="50">
<rect id="rectRED"
x="15" y="5" height="30" width="30"
style="fill:#ff0000;fill-opacity:0.5;stroke:#000000;stroke-width:1.5" />
<rect id="rectBLUE"
x="5" y="15" height="30" width="30"
style="fill:#0000ff;fill-opacity:0.5;stroke:#000000;stroke-width:1.5" />
</svg>Run Code Online (Sandbox Code Playgroud)
getObjectsAt(10,25)应该返回一个包含的列表rectBLUEgetObjectsAt(25,25)应该返回一个包含rectRED和的列表rectBLUEgetObjectsAt(10,10)应该返回类似的东西NIL有办法做到这一点吗?
使用 C++/OpenCV,我在图像上画了一条线cv::line,现在我正在尝试提取其坐标数组。我尝试将该行分配给cv::Mat,但收到一条错误消息,指出我无法从 void 转换为cv::Mat. 有没有简单的方法来获取这些坐标?
谢谢您的帮助!
我希望收到一个具有相等坐标的方形图,无论我的数据点云的形状如何。
这是我的问题的原始说明。
xy <- data.frame(x = rnorm(100),
y = rnorm(100, mean = 1, sd = 2))
gg <- ggplot(xy,aes(x = x, y = y))+
geom_point()
gg + coord_equal() #now we have square coordinate grid
gg + theme(aspect.ratio = 1) #now the plot is square
# if we use both, aspect.ratio overpowers coord_equal
gg + coord_equal() + theme(aspect.ratio = 1)
Run Code Online (Sandbox Code Playgroud)
有什么办法可以让绘图和坐标网格都平方吗?当然,剧情中也会有一些空白的地方。我不介意这个。
另外,我想知道确保 x 轴和 y 轴上的相同标签的最简单方法。
coordinates ×10
java ×3
javascript ×2
android ×1
apache-poi ×1
arrays ×1
c++ ×1
cell ×1
excel ×1
geolocation ×1
ggplot2 ×1
libgdx ×1
line ×1
location ×1
opencv ×1
performance ×1
r ×1
standards ×1
svg ×1
timezone ×1
titanium ×1
touch ×1
var ×1
viewport ×1