From 656aafa10f1fe3f1fc797e37c26aef7a1c262893 Mon Sep 17 00:00:00 2001 From: NANAE AUBRY Date: Thu, 22 Aug 2024 10:31:32 +0200 Subject: [PATCH] remove using geometry functions guide --- .../using_geometry_functions.ipynb | 170 ------------------ 1 file changed, 170 deletions(-) delete mode 100644 samples/02_power_users_developers/using_geometry_functions.ipynb diff --git a/samples/02_power_users_developers/using_geometry_functions.ipynb b/samples/02_power_users_developers/using_geometry_functions.ipynb deleted file mode 100644 index b6c526724d..0000000000 --- a/samples/02_power_users_developers/using_geometry_functions.ipynb +++ /dev/null @@ -1,170 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Using geometry functions\n", - "\n", - "This notebook uses the `arcgis.geometry` module to compute the length of a path that the user draws on the map.\n", - "\n", - "The particular scenario is of a jogger who runs in the Central Park in New York (without gizmos like GPS watches to distract him), and wants a rough estimate of his daily runs based on the path he takes. The notebook starts out with a satellite map of Central Park in New York:" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "from arcgis.gis import GIS\n", - "from arcgis.geocoding import geocode\n", - "from arcgis.geometry import lengths" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "gis = GIS()" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], - "source": [ - "map1 = gis.map()\n", - "map1.basemap = \"satellite\"" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "map1" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [], - "source": [ - "map1.height = '650px'" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [], - "source": [ - "location = geocode(\"Central Park, New York\")[0]\n", - "map1.extent = location['extent']" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [], - "source": [ - "map1.zoom = 14" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We want the user to draw a freehand polyline to indicate the paths that he takes for his runs. When the drawing operation ends, we use the GIS's Geometry service to compute the length of the drawn path. We can do this by adding an event listener to the map widget that gets called when drawing is completed (i.e. on_draw_end). The event listener then computes the geodesic length of the drawn geometry using the geometry service and prints it out:" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [], - "source": [ - "# Define the callback function that computes the length.\n", - "def calc_dist(map1, g):\n", - " print(\"Computing length of drawn polyline...\")\n", - " length = lengths(g['spatialReference'], [g], \"\", \"geodesic\")\n", - " print(\"Length: \" + str(length[0]) + \" m.\")\n", - "\n", - "# Set calc_dist as the callback function to be invoked when a polyline is drawn on the map\n", - "map1.on_draw_end(calc_dist)" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [], - "source": [ - "map1.draw(\"polyline\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Now draw a polygon on the map representing the route taken by the jogger" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [], - "source": [ - "map1.clear_graphics()" - ] - } - ], - "metadata": { - "anaconda-cloud": {}, - "esriNotebookRuntime": { - "notebookRuntimeName": "ArcGIS Notebook Python 3 Standard", - "notebookRuntimeVersion": "9.0" - }, - "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.5" - } - }, - "nbformat": 4, - "nbformat_minor": 1 -}