ebook img

ArcGIS API for Python PDF

43 Pages·2017·6.58 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview ArcGIS API for Python

ArcGIS API for Python Mapping and Visualizations in the API (Plus an Introduction!) In [ ]:  What does the typical GIS team member look like?  Do they look something like this?  Do they act something like this?  Fear not, we have a new capability on our hands...  The ArcGIS API for Python is an exciting new way to interact with a distributed GIS. It has the tremendous potential to help every member of an organization's GIS team by introducing automation, adding capabilities, and expanding on what is possible.  If you are a GIS Administrator, you can use the API to automate tasks relating to management of users, groups, and items. Free yourself of monotonous activities.  If you are a GIS Content Publisher, you can use the API to set up processes that will automatically publish mass content or easily move content from one Portal to another. Make your content part of a reliable and frequently updated process.  If you are a GIS Analyst, you can leverage the API's use of Python and its powerful data analysis libraries. Enrich your analysis with Python's suite of data science capabilities.  If you are a Developer, you can build dashboards and Jupyter Notebook extensions to customize the capabilities of the API and the tools. Stand up a simple but useful application in minutes.  If you don't even use GIS but you are a Data Scientist , you can now connect to a GIS and use spatial capabilities to enrich and extend your analysis. See what all this "GIS" buzz is about.  Before we take a look at specific examples, let's align on terminology... Python | Jupyter Notebook | ArcGIS API for Python  Python A family of nonvenomous snakes found in Africa, Asia, and Australia. A beautiful programming language that emphasizes readibility. In [ ]: import this  Python  Widely adopted in the GIS community.  Widely adopted in the Data Science community.  Widely adopted in the Development community.  Widely adopted everywhere!  Jupyter Notebook  Allows Python users to create and share documents containing Live Code in "cells": In [2]: print("Hello FedGIS.") Hello FedGIS.  Jupyter Notebook  Cells have all the capabilities of an executable command interface... In [3]: def chicken_function(): return egg_function() def egg_function(): return chicken_function() In [4]: chicken_function() --------------------------------------------------------------------------- RecursionError Traceback (most recent call last) <ipython-input-4-0305f3f224c9> in <module>() ----> 1 chicken_function() <ipython-input-3-a89345d36248> in chicken_function() 1 def chicken_function(): ----> 2 return egg_function() 3 4 def egg_function(): 5 return chicken_function() <ipython-input-3-a89345d36248> in egg_function() 3 4 def egg_function(): ----> 5 return chicken_function() ... last 2 frames repeated, from the frame below ... <ipython input 3 a89345d36248> in chicken function()  Jupyter Notebook  Cells have all the capabilities of an executable command interface... In [1]: import time def return_best_university(all_universities=None): print("Processing University data...") time.sleep(1) print("...") time.sleep(2) print("Found corrupt records in data... [Florida State University, University time.sleep(2) print("Data cleaned. Now performing analysis...") time.sleep(1) print("...") time.sleep(1) print("...") time.sleep(1) print("...") time.sleep(1) print("Determining final rankings on all possible variables...") time.sleep(2) print("Solution found...") print("Solution: University of Florida") return("University of Florida") In [5]: # This function contains extensive analysis of academic rankings and overall good return_best_university() Processing University data... ... Found corrupt records in data... [Florida State University, University of Georg ia]. Cleaning garbage records... Data cleaned. Now performing analysis... ... ... ... Determining final rankings on all possible variables... Solution found... Solution: University of Florida Out[5]: 'University of Florida'  Jupyter Notebook  Allows Python users to create and share documents containing explanatory text & documentation  In fact... this whole presentation was written on a Jupyter Notebook!  Jupyter Notebook  Allows Python users to create and share documents containing visualizations In [6]: import pandas as pd import numpy as np dates = pd.date_range('20130101', periods=6) dates df = pd.DataFrame(np.random.randn(6,10), index=dates, columns=list('ABCDEFGHIJ')) df Out[6]: A B C D E F G H 2013- -0.907160 0.598891 0.268379 -1.357367 1.124579 0.959147 0.361779 -1.078645 -0.0967 01-01 2013- -0.606378 1.455470 0.087775 2.767302 -0.430668 -1.573610 1.319416 1.423569 0.6788 01-02 2013- 3.086340 1.664543 1.229672 1.429835 0.550282 1.091653 -0.152071 2.173504 0.4830 01-03 2013- -3.755005 -0.085720 1.925352 0.059352 -1.309952 0.878401 0.434963 -0.746970 -0.4637 01-04 2013- 0.073519 -1.016756 0.142583 -0.100056 0.096224 0.596006 -1.922145 -0.682998 -0.2286 01-05 2013- -0.734188 -1.372607 0.390529 1.501349 -0.097851 -2.474915 0.679706 0.587010 1.9072 01-06  Jupyter Notebook  Allows Python users to create and share documents containing visualizations In [7]: from arcgis.gis import GIS my_gis = GIS() my_gis.map()  ArcGIS API for Python An API for your Web GIS.  ArcGIS API for Python Demo: Hello World Map  Let's Get Started With Some Basics... Let's import the API... In [4]: import arcgis from IPython.display import display This is a GIS object. If we don't pass any parameters, it connects to the default GIS, ArcGIS Online. In [5]: gis = arcgis.gis.GIS() In [6]: gis? In [7]: gis.map? This object is the entry point to your GIS. This lets you manage users, content, and also has a map widget: In [8]: my_map = gis.map("Reston") The map widget is built on top of the ArcGIS JavaScript API but is added as a Jupyter Notebook extension. In [9]: my_map × + – County of Fairfax, Montgom That's a map of a cool place, but it's not very useful yet. Let's now search for content. In [10]: items = gis.content.search("Reston Hiking Trails", "feature layer") In [11]: items?

Description:
If you are a GIS Analyst, you can leverage the API's use of Python and its powerful data analysis .. step=1, description='Older:', disabled=False,.
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.