Search and cache

Query published features as GeoJSON, choose a local or remote mode, and manage the local cache.

Documentation navigation

Search syntax

terminal
e2 search restaurant hospital --area "Manhattan" --area "Brooklyn"
  --mode auto --bbox "-74.1,40.65,-73.8,40.9"
  --where wheelchair=yes --property operator=public
  --columns id,name,lat,lng --limit 500
Features can be positional arguments, repeated with --feature, or mixed. Areas are repeatable. The command returns a GeoJSON FeatureCollection and limits results to 100,000 rows.

Search options

OptionPurpose
--feature <feature>Add a feature key or numeric ID; repeat it.
--area <area>Add a named area or region ID; repeat it.
--mode <mode>remote, offline, or auto. Defaults to auto.
--bbox minLng,minLat,maxLng,maxLatRestrict results to a bounding box.
--where column=valueApply typed column filters; repeat it.
--property key=valueFilter JSON properties; repeat it.
--columns id,name,latSelect returned columns.
--limit numberSet the maximum number of features; defaults to 1,000.
--jsonPrint JSON instead of a table where applicable.

Cache commands

terminal
e2 cache set 5GB
e2 cache list
e2 cache delete <snapshot-id>
e2 cache clear

The default cache is ~/.e2/cache, the minimum limit is 1GB, and entries are evicted least-recently-used when space is needed.

Offline workflow

terminal
# Download published data into the cache
e2 download restaurant --out ./restaurant.parquet

# Import a published dataset into a local database
e2 import restaurant --area "Manhattan" --db ./e2.db

# Query using local data only
e2 search restaurant --area "Manhattan" --mode offline