如何在世界地图图像上突出显示特定国家

发布于 2025-01-05 09:14:48 字数 165 浏览 4 评论 0原文

我有 IP 数据的实时流。
我想使用 QT 和 QT 在世界地图图像上显示与接收到的 IP 相对应的地理数据。 C++。
在这种情况下你会推荐什么?

PNG 或 SVG?
有没有比维基百科的空白地图更好的图像?
您会推荐什么地理数据数据库?

谢谢你!

I have a real-time flow of IPs' data.
I would like to display geodata, corresponding to received IPs, on world map image using QT & C++.
What would you recommend in that case?

PNG or SVG?
Are there any images out better than Wikipedia's blank maps?
What geodata database would you recommend?

Thank you!

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

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

发布评论

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

评论(1

等待我真够勒 2025-01-12 09:14:48

您可以创建一个 QWidget,它是 QGraphicsView 的子类,背景是世界的 QImage,QPolygons 表示地图顶部的叠加层(以每个国家的形状)。

然后每隔几毫秒调用一次 update() 。在重载的 PaintEvent 函数中,检查新数据并根据 IP 来源突出显示国家/地区。保持该国家/地区突出显示一定的毫秒或秒数,然后淡化其 alpha 或其他内容。

至于地球图像,请咨询 NASA。它们可以在标准地图投影中为您提供高分辨率的地球图像。

You could create a QWidget which subclasses QGraphicsView, with a QImage of the world in the background, and QPolygons representing overlays (in the shape of each country) on top of the map.

Then call update() every few milliseconds. In your overloaded PaintEvent function, check for new data and highlight a country based on where the IPs are from. Keep that country highlighted for a certain number of milliseconds or seconds, and fade its alpha or something.

As for earth imagery, check with NASA. They can provide you with high, high resolution images of earth in your standard map projection.

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