This set of Objective-C classes implements a data model for GeoJSON specification. It uses a one-to-one approach, so don't be intimidated by the amount of classes: they are just data wrappers of json objects.
- Removed SBJson dependency
- Updated to ARC
- Added property to
GeoJSONFeatureCollection
to get raw array of the internal features - More ways to init
GeoJSONPoint
- Cocoapods support (TBD)
Copy classes from parser folder to your project (excluding tests).
Or with Cocoapods
pod 'geojson-objectivec-parser', :git => "https://github.com/MrZoidberg/geojson-objectivec-parser.git"
GeoJSONFactory *factory = [GeoJSONFactory new];
if ([factory createObjectFromJSON:[@"the geojson string" dataUsingEncoding:NSUTF8StringEncoding]]) {
// parse ok
// factory.type contains the type of object created (GeoJSONPoint, GeoJSONFeature, etc.)
// factory.object contains the object of previous type
} else {
// parse error. No more info, sorry
}
This fork has dependency on CoreLocation. The code should work on iOS >= 5.0
YOURS is ARC only and compiles on iOS SDK >= 7.0
- More error handling (parse error)
- Implement Coordinate Reference System Objects (http://www.geojson.org/geojson-spec.html#coordinate-reference-system-objects)
- Support bounding boxes (http://www.geojson.org/geojson-spec.html#bounding-boxes)
- Test on MacOS and write a sample