地图平铺 - 什么样的投影?
我拍摄了一张大图像并将其分成正方形图块(256x256)。它也是为谷歌地图制作的,因此整个图像被分为 z_x_y.png (取决于缩放级别)。
z=0=> 1x1 瓷砖 z=1=> 2x2 瓷砖 z=2=> 4x4 瓷砖
我的 imageMap 是“平面”的,并不像世界地图那样基于球体。
我将在 Windows 移动应用程序(没有谷歌 API)上使用这张地图,并且所有“兴趣点”都按经度和纬度插入数据库中。因为我必须为 Windows Mobile 制作这个,所以我只有 XY 坐标系。
仅使用这个就足够了:
MAP_WIDTH = 256*TILES_W;
MAP_HEIGHT = 256*TILES_H;
function convert(int lat, int lon)
{
int y = (int)((-1 * lat) + 90) * (MAP_HEIGHT / 180);
int x = (int)(lon + 180) * (MAP_WIDTH / 360);
ImagePoint p = new ImagePoint(x,y); // An object which holds the coordinates
return p;
}
还是我需要投影技术?
提前致谢。 如果有不清楚的地方,请询问。
I've taken a large image and divided it in to square tiles (256x256). It is made for google maps also, so the whole image is divided into z_x_y.png (Depending on zoom level).
z=0 => 1x1 tile
z=1 => 2x2 tilesthe
z=2 => 4x4 tiles
My imageMap is "flat" and is not based on a sphere like the worldmap.
I'm gonna use this map on a windows mobile app (which has no google API), and all the "points of interests" is inserted into a database by longitude and latitude. And since i have to make this for the windows mobile, i just have XY coordinate system.
Is it enough to just use this:
MAP_WIDTH = 256*TILES_W;
MAP_HEIGHT = 256*TILES_H;
function convert(int lat, int lon)
{
int y = (int)((-1 * lat) + 90) * (MAP_HEIGHT / 180);
int x = (int)(lon + 180) * (MAP_WIDTH / 360);
ImagePoint p = new ImagePoint(x,y); // An object which holds the coordinates
return p;
}
Or do i need a projection technique?
Thanks in advance.
Please ask, if something is unclear.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您希望兴趣点在图像上正确对齐,则需要确保投影和坐标系与图像中使用的相匹配。听起来像是你制作的图像?那么想必您知道投影吗?只需确保
convert
使用相同的投影即可。我不确定它是否相关,但 Google 地图使用基于 WGS84 的球形墨卡托投影。
If you want your points of interest to align properly on your image, you need to make sure the projection and coordinate system match those used in the image. It sounds like you made the image? So presumably you know the projection? Just make sure
convert
uses the same projection.I'm not sure whether it's relevant, but Google Maps uses a spherical mercator projection based on WGS84.