{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Illustration of CRS effect" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Leaflet is able to handle several CRS (coordinate reference systems). It means that depending on the data you have, you may need to use the one or the other.\n", "\n", "Don't worry ; in practice, almost everyone on the web uses EPSG3857 (the default value for folium and Leaflet). But it may be interesting to know the possible values." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "../folium/__init__.py\n", "0.2.0.dev\n" ] } ], "source": [ "import json\n", "import sys\n", "sys.path.insert(0,'..')\n", "import folium\n", "print (folium.__file__)\n", "print (folium.__version__)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's create a GeoJSON map, and change it's CRS." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "geo_json_data = json.load(open('us-states.json'))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## EPSG3857 ; the standard" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Provided that our tiles are computed with this projection, this map has the expected behavior." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "\n", "