geeViz.esriLib¶
ArcGIS / Esri REST services client for geeViz.
Bridges three Esri service types into the existing geeViz viewer with no
JavaScript changes required. The viewer already supports both
tileMapService (for raster tiles) and geoJSONVector (for vector
features) layer types.
Service type |
Mechanism |
|---|---|
Image Service |
|
Map Service (cached) |
|
Feature Service (≤ |
Fetch |
Feature Service (> |
|
Public API — 7 functions + 1 constant:
import geeViz.esriLib as el
# Discover data on any ArcGIS Portal
results = el.searchPortal("naip 2023") # IIPP (default)
results = el.searchPortal("naip 2023", portal="agol") # ArcGIS Online
results = el.searchPortal("naip 2023",
portal="https://myagency.gov/portal")
# Available portals
el.PORTALS.keys() # iipp, agol, usgs, noaa, usfs, nasa
# Inspect any service
meta = el.getServiceMetadata("https://.../ImageServer")
# Add to the geeViz map (auto-dispatches by service type)
el.addEsriService(result_or_url)
# Or call the typed helpers directly
el.addEsriImageService("https://.../ImageServer", name="NAIP 2023")
el.addEsriFeatureService("https://.../FeatureServer/0",
max_features=2000, where="STATE='UT'")
el.addEsriMapService("https://.../MapServer")
Token-gated portals:
# Obtain a token first:
# POST <portal>/sharing/rest/generateToken
# username=...&password=...&client=requestip&expiration=60&f=json
token = "..."
el.searchPortal("classified data", token=token)
el.addEsriFeatureService(url, token=token)
Copyright 2026 Ian Housman
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Module Attributes
|
Module-level dict mapping short names to portal base URLs. |
Functions
|
Fetch and add an ArcGIS Feature Service layer as a GeoJSON vector layer. |
|
Add an ArcGIS Image Service as an XYZ tile layer to the geeViz map. |
|
Add a cached ArcGIS Map Service as an XYZ tile layer to the geeViz map. |
|
Auto-detect the Esri service type and call the appropriate add helper. |
|
Fetch and return the JSON metadata for any ArcGIS REST service. |
|
Search any ArcGIS Portal for hosted services. |