<jupyter_start><jupyter_text>GIS Basics - Authentication- Searching and Using Content- Mapping Information  It Starts with an Import...  Connecting to AGOL Anonymously<jupyter_code>from arcgis.gis import GIS
gis = GIS()<jupyter_output><empty_output><jupyter_text>Supports Multiple Authentication Methods - Oauth 2.0- PKI- IWA- Named User<jupyter_code>gis = GIS(username='webinaruser')
gis.users.me<jupyter_output><empty_output><jupyter_text>**Store Credentials Using Profiles**- Store login information locally using OS credential store<jupyter_code>import getpass
password = getpass.getpass()
gis = GIS(username='webinaruser', 
          password=password,
          profile='webinar_demo')
del gis
gis = GIS(profile='webinar_demo')
gis.users.me<jupyter_output><empty_output><jupyter_text>GIS the Entry into WebGIS - Access, add, publish and share content- Manage, modify and control your Portal/Server (administrators)- Build your digital geo-spatial community  Searching for Content- Two Methods:    + `search` - simple search    + `advanced_search` - provides complete control on how filters, name and responses are returned      Simple Search- Easy to use search interface- Provides back a list of `Item` objects- Limited to **1000** features<jupyter_code>from IPython.display import display
results = gis.content.search(
    query="United States owner:esri",
    outside_org=True,
    item_type="Feature Layer")
for item in results:
    display(item)<jupyter_output><empty_output><jupyter_text>Advanced Search- Provides custom paging - Response is a dictionary- Results can comeback as an `Item` or `Dictionary`- Provides Search Statistics<jupyter_code>query = ("owner:esri United States (type:(\"Feature Collection\" OR \"Feature "
         "Service\" OR \"Stream Service\" OR \"WFS\") -typekeywords:\"Table\")")
gis.content.advanced_search(query=query,
                            return_count=True)
for result in gis.content.advanced_search(query=query,
                                          start=10)['results']:
    display(result)<jupyter_output><empty_output><jupyter_text>Visualizing Content The `GIS` object provides a widget to visualize spatial data- Define location by:    + extent    + address- Set the `basemap`- Customize layers look and feel- Save it to a WebMap<jupyter_code>m = gis.map('Youngstown, PA')
m.zoom = 9
m<jupyter_output><empty_output><jupyter_text>**Example: Looking at the Basemaps**<jupyter_code>import time
for b in m.basemaps[0::2]:
    print(b)
    m.basemap = b
    time.sleep(2)
m.basemap = 'dark-gray'
water = gis.content.get("9dff3cf646704abd9e74265f02abeb09")
rivers = gis.content.get("0baca6c9ffd6499fb8e5fad50174c4e0")
m.add_layer(water)
m.add_layer(rivers)
webmap_item = m.save(item_properties={
    'title' : "USA Water Bodies",
    'snippet' : "Water Bodies",
    'description' : "Water Bodies in the USA",
    'tags' : 'water, rivers, lakes'
})
webmap_item<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10808973487423522, 'fraction_numerical': 0.01563562202583277, 'mean_word_length': 4.703488372093023, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '551801', 'license': 'Apache-2.0', 'n_tokens_mistral': 991, 'n_tokens_neox': 947, 'n_words': 249, 'path': 'talks/GeoDevWebinar_July02_2019/01-GIS_DEMO/01 - GIS Basics.ipynb', 'repo_name': 'test-v1/arcgis-python-api', 'size': '2942'}