MrZoidberg / geojson-objectivec-parser

Full datamodel & parser for GeoJSON 1.0 specification

Home Page:http://www.geojson.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

geojson-objectivec-parser

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.

Changes since forked

  1. Removed SBJson dependency
  2. Updated to ARC
  3. Added property to GeoJSONFeatureCollection to get raw array of the internal features
  4. More ways to init GeoJSONPoint
  5. Cocoapods support (TBD)

Installation

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"

Usage

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
}

Dependency

This fork has dependency on CoreLocation. The code should work on iOS >= 5.0

ARC

YOURS is ARC only and compiles on iOS SDK >= 7.0

TODO (feel free to pull)

Screeshot

Emulator showing one object tree created

About

Full datamodel & parser for GeoJSON 1.0 specification

http://www.geojson.org/


Languages

Language:Objective-C 98.8%Language:Ruby 1.2%