{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# geojson-extension" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## GeoJSON(data: dict)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [ { "data": { "application/geo+json": { "geometry": { "coordinates": [ -118.4563712, 34.0163116 ], "type": "Point" }, "type": "Feature" }, "text/plain": [ "" ] }, "metadata": { "application/geo+json": { "expanded": false } }, "output_type": "display_data" } ], "source": [ "from IPython.display import GeoJSON\n", "\n", "GeoJSON({\n", " \"type\": \"Feature\",\n", " \"geometry\": {\n", " \"type\": \"Point\",\n", " \"coordinates\": [-118.4563712, 34.0163116]\n", " }\n", "})" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## GeoJSON(data: dict, url_template=string, layer_options=dict)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "application/geo+json": { "geometry": { "coordinates": [ -118.4563712, 34.0163116 ], "type": "Point" }, "type": "Feature" }, "text/plain": [ "" ] }, "metadata": { "application/geo+json": { "expanded": false, "layer_options": { "attribution": "© OpenStreetMap", "id": "mapbox.streets" }, "url_template": "https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1Ijoic2Vub3JuZXN0b3IiLCJhIjoiY2l4MHU4MWJsMDIwcjJ0cGwybWQzbnhpeiJ9.beQ7B_WHe3K7_YMUJ684yg" } }, "output_type": "display_data" } ], "source": [ "GeoJSON(data={\n", " \"type\": \"Feature\",\n", " \"geometry\": {\n", " \"type\": \"Point\",\n", " \"coordinates\": [-118.4563712, 34.0163116]\n", " }\n", "}, url_template=\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1Ijoic2Vub3JuZXN0b3IiLCJhIjoiY2l4MHU4MWJsMDIwcjJ0cGwybWQzbnhpeiJ9.beQ7B_WHe3K7_YMUJ684yg\", \n", "layer_options={\n", " \"id\": \"mapbox.streets\",\n", " \"attribution\" : '© OpenStreetMap'\n", "})" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "application/geo+json": { "geometry": { "coordinates": [ 11.8, -45.04 ], "type": "Point" }, "type": "Feature" }, "text/plain": [ "" ] }, "metadata": { "application/geo+json": { "expanded": false, "layer_options": { "attribution": "Celestia/praesepe", "basemap_id": "celestia_mars-shaded-16k_global", "maxZoom": 5, "minZoom": 0, "tms": true }, "url_template": "http://s3-eu-west-1.amazonaws.com/whereonmars.cartodb.net/{basemap_id}/{z}/{x}/{y}.png" } }, "output_type": "display_data" } ], "source": [ "GeoJSON(data={\n", " \"type\": \"Feature\",\n", " \"geometry\": {\n", " \"type\": \"Point\",\n", " \"coordinates\": [11.8, -45.04]\n", " }\n", "}, url_template=\"http://s3-eu-west-1.amazonaws.com/whereonmars.cartodb.net/{basemap_id}/{z}/{x}/{y}.png\", \n", "layer_options={\n", " \"basemap_id\": \"celestia_mars-shaded-16k_global\",\n", " \"attribution\" : \"Celestia/praesepe\",\n", " \"tms\": True,\n", " \"minZoom\" : 0,\n", " \"maxZoom\" : 5\n", "})" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.2" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": {}, "version_major": 1, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 2 }