{ "cells": [ { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Enter your ArcGIS Organizational or Developer Account Password: ········\n", "Logged in successfully to edn.maps.arcgis.com as jgravois.\n" ] } ], "source": [ "from arcgis.gis import GIS\n", "import getpass\n", "\n", "password = getpass.getpass(\"Enter your ArcGIS Organizational or Developer Account Password: \")\n", "gis = GIS(\"https://www.arcgis.com\", \"jgravois\", password)\n", "print(\"Logged in successfully to {} as {}.\".format(gis.properties.urlKey + '.' + gis.properties.customBaseUrl, \\\n", " gis.users.me.username))" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "a221b7eafe224695b4a2e2789d852c5e" } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from IPython.display import display\n", "\n", "map = gis.map(\"Springfield, IL\", 12)\n", "map" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "jgravois has access to 5 feature service items.\n" ] } ], "source": [ "feat_services = gis.content.search(query=\"title:Church*\", item_type=\"Feature Service\", max_items=5, outside_org='true')\n", "print(\"{} has access to {} feature service items.\".format(gis.users.me.username, len(feat_services)))" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Other churches is a .\n", "\thttp://services1.arcgis.com/O2LesHc3TabFg7Qs/arcgis/rest/services/Other_churches/FeatureServer\n", "Church rock uranium monitoring project (crump) water samples is a .\n", "\thttp://services.arcgis.com/LGtNQDlIZBdntoA9/arcgis/rest/services/Church_Rock_Uranium_Monitoring_Project_(CRUMP)_Water_Samples/FeatureServer\n", "Hardin county churches is a .\n", "\thttp://services1.arcgis.com/fYwcHOBzInDTQxh0/arcgis/rest/services/Hardin_County_Churches/FeatureServer\n", "Churchill_truview_scans_2015_0515 is a .\n", "\thttps://services.arcgis.com/w0K9MAswvUFWyjPZ/arcgis/rest/services/Churchill_TruView_Scans_2015_0515/FeatureServer\n", "Catholic churches is a .\n", "\thttps://services2.arcgis.com/1cdV1mIckpAyI7Wo/arcgis/rest/services/Catholic_Churches/FeatureServer\n" ] } ], "source": [ "for feat_svc in feat_services:\n", " print(\"{} is a {}.\".format(feat_svc.title.capitalize(), type(feat_svc)))\n", " print(\"\\t{}\".format(feat_svc.url))" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "
\n", " \n", " \n", " \n", "
\n", "\n", "
\n", " Catholic Churches\n", " \n", "
Homeland Security Use Cases: Use cases describe how the data may be used and help to define and clarify requirements. 1. A disaster or health emergency has occurred, or is predicted for a locality. Places of worship or congregations that may be affected must be identified. 2. An assessment as to the evacuation needs and issues for a given area needs to be made as part of a disaster mitigation plan. Places of worship that may need to be evacuated must be identified. 3. Facilities that can serve as shelters must be identified. 4. A threat has been made toward places of worship and other religious institutions. These locations need to be identified, their leadership contacted, and their buildings protected.Feature Layer Collection by HIFLD_Admin\n", "
Last Modified: May 30, 2017\n", "
0 comments, 1,274 views\n", "
\n", "
\n", " " ], "text/plain": [ "" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "catholic_churches = feat_services[4]\n", "catholic_churches" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "collapsed": true }, "outputs": [], "source": [ "map.add_layer(catholic_churches)" ] } ], "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.1" } }, "nbformat": 4, "nbformat_minor": 2 }