MapKit with open data in Swift
Swift JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


MapKit with open data in Swift

Requires Swift 1.2 (XCode 6.3) !

This project demonstrates some MapKit features with Swift. It displays french département borders, extracted from a public database converted to GeoJSON.

Data come from IGN (open licence) at:

I used ogr2ogr software to convert them from Shapefile format to JSON.

ogr2ogr -f GeoJSON -t_srs crs:84 -simplify 100 departements-100.geojson DEPARTEMENT.shp

The -simplify 100 option allows to reduce the precision to 100 meters and to reduce the data size from 8 to 2 MBytes. The aim is mainly to reduce load time.

You can change tiles used to render the map: in FrenchMapViewController.swift:

var useAlternatesTiles = true      // Apple vs alternate tile server
private let template:String = "{z}/{x}/{y}.png";

There is an article in french at :