L06_UsingTheGis_Portal

In [9]:
from arcgis.gis import GIS
In [10]:
# use this
from arcgis.gis import GIS
gis = GIS("<enter Portal url here>","<enter username here>", "<password>")
# example portal url:"https://clt-ramseth8l.esri.com/portal/home"

# or this if you want to not expose credentials

# import getpass
# password = getpass.getpass("Enter password: ")
# gis = GIS("https://www.arcgis.com","<enter username here>", password)
# print("Successfully logged in as: " + gis.properties.user.username)
In [11]:
user = gis.users.get('<enter portal user here')
In [12]:
user
Out[12]:
Portal Admin

Bio: None
First Name: Portal
Last Name: Admin
Username: PortalAdmin
Joined: January 25, 2017
In [13]:
user['firstName']
Out[13]:
'Portal'
In [7]:
user.lastName
Out[7]:
'Admin'
In [8]:
map1 = gis.map("New York, NY")
map1
In [8]:
from IPython.display import display
items = gis.content.search('*')
for item in items:
    display(item)
Slovakia
This map is designed for use in Navigator for ArcGIS and contains data for Slovakia supporting map display, geocoding and routing.Mobile Map Package by esri_nav
Last Modified: October 08, 2015
0 comments, 0 views
USA Soils Runoff
This layer contains the rate of loss of water from an area by flow over the land surface in six classes ranging from negligible to very high.Imagery Layer by esri_livingatlas
Last Modified: October 07, 2016
0 comments, 0 views
GLDAS Evapotranspiration 2000 - Present
Total monthly evapotranspiration modeled globally by NASAImagery Layer by esri_livingatlas
Last Modified: October 07, 2016
0 comments, 0 views
Ghana Region Boundaries 2015
Ghana Region Boundaries 2015 provides boundaries optimized for analysis.Feature Layer Collection by esri_livingatlas
Last Modified: October 07, 2016
0 comments, 0 views
Poland Powiaty Bounadries 2013
Poland Powiaty Bounadries 2013 provides boundaries optimized for analysis.Feature Layer Collection by esri_livingatlas
Last Modified: October 07, 2016
0 comments, 0 views
Mexico Country Boundary 2014
Mexico Country Boundary 2014 provides boundaries optimized for analysis.Feature Layer Collection by esri_livingatlas
Last Modified: October 07, 2016
0 comments, 0 views
Liechtenstein
This map is designed for use in Navigator for ArcGIS and contains data for Liechtenstein supporting map display, geocoding and routing.Mobile Map Package by esri_nav
Last Modified: October 08, 2015
0 comments, 0 views
Ecuador Provincia Boundaries 2014
Ecuador Provincia Boundaries 2014 provides boundaries optimized for analysis.Feature Layer Collection by esri_livingatlas
Last Modified: October 07, 2016
0 comments, 0 views
GLDAS Precipitation 2000 - Present
Total monthly precipitation modeled globally by NASAImagery Layer by esri_livingatlas
Last Modified: October 07, 2016
0 comments, 0 views
The Age of Megacities
A look at ten of the world’s largest cities, showing growth patterns over timeWeb Mapping Application by esri_livingatlas
Last Modified: October 07, 2016
0 comments, 0 views
In [10]:
gis.properties.access
Out[10]:
'public'
In [11]:
gis.properties.canSignInArcGIS
Out[11]:
True
In [12]:
gis.properties.helperServices
Out[12]:
{
  "geoanalytics": {
    "url": "https://clt-ramseth8l.esri.com:6443/arcgis/rest/services/System/GeoAnalyticsTools/GPServer"
  },
  "asyncGeocode": {
    "url": "https://clt-ramseth8l.esri.com:6443/arcgis/rest/services/Utilities/GeocodingTools/GPServer"
  },
  "rasterAnalytics": {
    "url": "https://clt-ramseth8l.esri.com:6443/arcgis/rest/services/System/RasterAnalysisTools/GPServer"
  },
  "geocode": [
    {
      "suggest": true,
      "southLat": "Ymin",
      "westLon": "Xmin",
      "name": "Esri World Geocoder",
      "northLat": "Ymax",
      "url": "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer",
      "eastLon": "Xmax"
    }
  ],
  "defaultElevationLayers": [
    {
      "layerType": "ArcGISTiledElevationServiceLayer",
      "id": "globalElevation",
      "url": "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",
      "name": "Terrain3D"
    }
  ],
  "geometry": {
    "url": "https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer"
  },
  "analysis": {
    "url": "https://clt-ramseth8l.esri.com:6443/arcgis/rest/services/System/SpatialAnalysisTools/GPServer"
  },
  "printTask": {
    "templates": [
      {
        "label": "Map Only",
        "layout": "MAP_ONLY",
        "format": "PNG32"
      }
    ],
    "url": "https://clt-ramseth8l.esri.com:6443/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"
  }
}
In [ ]: