以编程方式将 .shp 文件转换为 Excel 电子表格
我有一个 .shp 格式的文件,我需要它以编程方式将其转换为 Excel 电子表格。我想使用 PHP 或 JavaScript 来完成此操作。
I have a file in .shp format and I need it to convert it to an Excel spreadsheet programmatically. I want to do this using PHP or JavaScript.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一旦我使用了小型 PHP lib ShapeFile,您就可以在 phpclasses.org。虽然这个设计有点不太好,但它确实有效。
这是我自己的代码中的一个小例子:
因此,之后
$records
包含 shapefile 中的所有数据。当然,您需要一些时间来弄清楚 shapefile 是什么以及它可以保存哪些数据(假设您不熟悉它)。从维基百科开始。实际上有一堆带有一些标签的数组。然后使用一些 php excel lib(只需在 so 中查找)就完成了:)
Once I've used small PHP lib ShapeFile, you can get it in phpclasses.org. Although it is a bit of not so good design, it works.
Here is a little example from my own code:
So, after that
$records
contain all the data from shapefile. Of course, you will need some time to figure out what shapefile is and what data it can hold (assuming you are not familiar with it). Start from wikipedia. Actually there are bunch of arrays with some labels.Then use some php excel lib (just seek in so) and you're done :)