将 KML 文件上传到数据库并显示在 OpenLayers 地图上

发布于 2024-09-13 22:46:12 字数 192 浏览 2 评论 0原文

我想在我的 WordPress 网站上创建一个简单的表单,以便人们可以上传 KML 文件,然后将其存储在数据库中以及 openlayers 地图 - openstreetmap 上显示的路线。

该项目是一个远足场地,用于存储远足路线。

有关此/论坛/建议的任何文档。我对这个地图的东西完全陌生。

干杯

安迪

I want to create a simple form on my wordpress site so that people can upload KML files which will then be stored in the db and the route shown on on openlayers map - openstreetmap.

The project is for a hiking site for storing hiking routes.

Any docs for this/ forums / advice. I'm completely new to this map stuff.

Cheers

Andy

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

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

发布评论

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

评论(3

风追烟花雨 2024-09-20 22:46:12

以下是在 openstreetmap 中完成的带有 kml 叠加的 openstreetmap 示例: http://maps.burningsilicon.net/

在完成这个示例之前,我建议阅读一些有关 openlayers 的介绍性文档,因为它的内部工作原理并不总是容易理解。

不要忘记对上传的 kml 文件进行一些限制。您应该限制节点的大小和/或数量,因为 GPS 跟踪器生成的巨大 kml 文件很容易使浏览器陷入困境。或者,您也可以使用 gpsbabel 简化上传的 kml 文件 (http://www.gpsbabel.org/ )。

如果这对您来说太复杂,谷歌地图可能是一个选择。

Here is an example of an openstreetmap with a kml overlay done in openstreetmap: http://maps.burningsilicon.net/

Before working through this example, I recommend to read some introductory documentation on openlayers, since its inner workings are not always trivial to understand.

Don't forget to put some restrictions on the uploaded kml files. You should either limit the size and/or the number of nodes, since the huge kml files generated by gps trackers can easily bog the browser down. Alternatively, you can also simplify the uploaded kml files with gpsbabel (http://www.gpsbabel.org/).

If this sounds too complicated to you, Google Maps might be an option.

[浮城] 2024-09-20 22:46:12

我必须编辑 OpenStreetMap 以使我的城市地图更好一点并实现在线行程系统。我有一个 KML 文件,其中包含我所在城市的所有公交车站,我想以某种方式将其覆盖在 OSM 编辑器程序中,以便我可以相应地在 OSM 中创建街道和人行横道。你有什么提示吗

I have to edit the OpenStreetMap in order to make my city map a bit better and implement an on-line itinerary system. I have a KML file with all the bus stops from my city and I would like to overlay it somehow in an OSM editor program, so that I can create the streets and crosswalks in OSM accordingly. Do you have any hint

奈何桥上唱咆哮 2024-09-20 22:46:12

我强烈建议您阅读这本书:Erik Hazzard 的 OpenLayers 2.10 Beginner's Guide 2011。

对于像您这样的新手,本书提供了大量文档以及有关 KML 文件的适当示例。

对于数据库,您可以使用 PostgreSQL 9.0。只是帮忙而已。祝你好运。

I strongly recommend you to read this book: OpenLayers 2.10 Beginner's Guide 2011 By Erik Hazzard.

For a novice like you, this book offers a lots of documentations with appropriate example regarding KML file.

And for the database, you could use PostgreSQL 9.0. Just helping by. Good luck.

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