# GeoJSONSerialization **Repository Path**: mirrors_mattt/GeoJSONSerialization ## Basic Information - **Project Name**: GeoJSONSerialization - **Description**: Encode & Decode Between GeoJSON & MapKit Shapes - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-09 - **Last Updated**: 2026-07-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # GeoJSONSerialization > This library is no longer maintained. > In iOS 13+ and macOS 10.15+, use [`MKGeoJSONDecoder`](https://developer.apple.com/documentation/mapkit/mkgeojsondecoder) instead. `GeoJSONSerialization` encodes and decodes between [GeoJSON](http://geojson.org) and [MapKit](https://developer.apple.com/documentation/MapKit) shapes, following the API conventions of Foundation's `NSJSONSerialization` class. ## Usage ### Decoding ```objective-c #import #import "GeoJSONSerialization.h" NSURL *URL = [[NSBundle mainBundle] URLForResource:@"map" withExtension:@"geojson"]; NSData *data = [NSData dataWithContentsOfURL:URL]; NSDictionary *geoJSON = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil]; NSArray *shapes = [GeoJSONSerialization shapesFromGeoJSONFeatureCollection:geoJSON error:nil]; for (MKShape *shape in shapes) { if ([shape isKindOfClass:[MKPointAnnotation class]]) { [mapView addAnnotation:shape]; } else if ([shape conformsToProtocol:@protocol(MKOverlay)]) { [mapView addOverlay:(id )shape]; } } ``` > After implementing the necessary `MKMapViewDelegate` methods, > the resulting map will look > [something like this](https://github.com/mattt/GeoJSONSerialization/blob/master/Example/iOS%20Example/map.geojson). ## Contact [Mattt](https://twitter.com/mattt) ## License GeoJSONSerialization is available under the MIT license. See the LICENSE file for more info.