带有 ObjectiveC 的形状文件 [英] Shapefile with ObjectiveC

查看:66
本文介绍了带有 ObjectiveC 的形状文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道在objective-C中是否有一个类可以操作shapefile(读/写/编辑)?

I like to know if there is a Class, in objective-C, that manipulates shapefile (read/write/edit)?

我在kml文件上发现了一堆东西,但对shp文件一无所知,但绝对想避免转换文件格式(shp->kml)的需要.

I have found a bunch of stuff on kml files but nothing about shp files, but definitely want to avoid the need of converting files format (shp->kml).

谢谢

推荐答案

Pascal Brandt 有一个方案,...(有点简单,但对我来说确实有用)... CocoaShapeFile.他只是把 C 函数装扮成 Objective-C 的衣服,但它很适合阅读.如果您是为 iOS 而不是 Cocoa 拍摄,那么您只需要自己进行一些转码/转换.

There's one from Pascal Brandt, ... (it's a little simplistic, but it certainly does the trick for me) ... CocoaShapeFile. He's just dressed up the C functions in Objective-C clothes, but it works just fine for reading. If you're shooting for iOS instead of Cocoa then you'll have to do just a little transcoding/conversion yourself.

只用了一点点努力,我就能够在 iPad 上运行它,使用 MapKit,并使用引用计数代替垃圾收集(iOS 上不可用).

With only a little bit of effort, I was able to get it running on the iPad, using MapKit, and using reference counting instead of garbage collection (not available on iOS).

为了潜在地减轻你的痛苦(当然,我不知道你打算用 shapefile 做什么),但我已经发布了一个快速而肮脏的 git 存储库,iOS-Shapefile,向您展示了如何将 shapefile 形状(如点和多边形/折线)放入 iOS MKMapView.

To potentially ease your pain a little (granted, I don't know what you plan to do with shapefiles), but I've released a quick and dirty git repository, iOS-Shapefile, that shows you how to get shapefile shapes (like points and polygons/polylines) into an iOS MKMapView.

至于写作和编辑,(因为这超出了我的兴趣),我认为您可能不得不推出自己的方法,与我在这里提供的有所不同.

As for writing and editing, (since that was beyond my interest), I think you'll likely have to roll your own methods, deviating from what I've provided here.

这篇关于带有 ObjectiveC 的形状文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆