arcgis 0.1.1

Type-safe Rust SDK for the ArcGIS REST API with compile-time guarantees
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
# Example Coverage Assessment

**Date:** 2026-01-24
**SDK Version:** 0.1.0
**Status:** Fresh assessment of implemented operations vs example coverage

---

## Current Example Coverage

### Public Examples (2)
- **query_features.rs** - Basic Feature Service queries (WHERE, fields, count, ObjectIDs, pagination, formats)
- **spatial_query.rs** - Spatial queries (bounding box, polygon, spatial relationships)

### Enterprise Examples (8)
- **basic_client.rs** - Authentication setup patterns
- **client_credentials_flow.rs** - OAuth2 client credentials
- **edit_session.rs** - Version Management edit sessions (save/discard)
- **feature_attachments.rs** - Attachment CRUD operations
- **geocode_addresses.rs** - Forward, reverse, and batch geocoding
- **geometry_operations.rs** - Projection, buffer, measurement
- **portal_content_management.rs** - Content search and metadata
- **routing_navigation.rs** - Route, service area, closest facility

**Total:** 10 examples

---

## Implemented Operations WITHOUT Examples

### 1. Feature Service - Advanced Operations

**Missing Coverage:**
- **Related Records** - `query_related_records(params)`
  - Cross-table relationship queries
  - One-to-many, many-to-many relationships

- **Top Features** - `query_top_features(params)`
  - Top N features by ordering
  - Useful for leaderboards, rankings

- **Batch Calculate** - `calculate_records(layer_id, updates, where_clause)`
  - Field calculations across multiple features
  - Update expressions

- **Truncate** - `truncate(layer_id)`
  - Clear all features from layer

- **Global ID Edits** - `apply_edits_with_global_ids(...)`
  - Editing with global IDs instead of ObjectIDs
  - Multi-geodatabase sync scenarios

**Impact:** Medium - These are specialized but important operations

---

### 2. Map Service - Complete Service Missing

**Missing Coverage:**
- **Export Map** - `export()` fluent builder
  - Render maps to PNG/JPG/PDF/SVG
  - Dynamic layer visibility
  - Transparent backgrounds, DPI control

- **Export Tile** - `export_tile(tile_coord, target)`
  - Fetch cached tiles
  - XYZ tile coordinates

- **Identify** - `identify(params)`
  - Click-to-identify features at point
  - Multi-layer identification

- **Find** - `find(params)`
  - Text search across layers
  - Keyword-based feature discovery

- **Legend** - `get_legend()`
  - Symbol and color information

- **Generate Renderer** - `generate_renderer(params)`
  - Dynamic renderer creation

**Impact:** HIGH - Map Service is fundamental for visualization

---

### 3. Image Service - Complete Service Missing

**Missing Coverage:**
- **Export Image** - `export_image(params)`
  - Raster export with rendering
  - JPEG/PNG/TIFF formats

- **Identify** - `identify(geometry)`
  - Get pixel values at location

- **Samples** - `get_samples(params)`
  - Sample pixels along line/points

- **Histograms** - `compute_histograms(params)`
  - Pixel value distributions

- **Raster Info** - `get_raster_info()`
  - Band count, pixel type, extent

**Impact:** HIGH - Essential for raster/imagery workflows

---

### 4. Vector Tile Service - Complete Service Missing

**Missing Coverage:**
- **Get Tile** - `get_tile(tile_coord)`
  - Fetch MVT (Mapbox Vector Tile)

- **Get Style** - `get_style()`
  - Mapbox GL style JSON

- **Get Fonts** - `get_fonts(font_stack, range)`
  - Font glyph PBFs

- **Get Sprites** - `get_sprite_metadata()`, `get_sprite_image()`
  - Icon/symbol sprite sheets

**Impact:** MEDIUM - Important for modern web mapping

---

### 5. Places Service - Complete Service Missing

**Missing Coverage:**
- **Find Places** - `find_places_near_point(params)`
  - POI search near location
  - Category filtering

- **Place Details** - `get_place_details(place_id)`
  - Hours, ratings, reviews, contact info

- **Categories** - `get_categories()`
  - Available POI categories

**Impact:** MEDIUM - POI discovery is common use case

---

### 6. Elevation Service - Complete Service Missing

**Missing Coverage:**
- **Profile** - `profile(params)`
  - Elevation along line/points
  - DEM resolution options

- **Summarize Elevation** - `summarize_elevation(params)`
  - Stats within polygons (min/max/mean)

- **Viewshed** - `viewshed(params)`
  - Visibility analysis from observer points

**Impact:** MEDIUM - Terrain analysis use cases

---

### 7. Geoprocessing Service - Complete Service Missing

**Missing Coverage:**
- **Synchronous Execution** - `execute(parameters)`
  - Run GP tools immediately

- **Asynchronous Jobs** - `submit_job(parameters)`, `poll_until_complete(job_id)`
  - Long-running analysis tasks
  - Job status polling

- **Job Management** - `get_job_status()`, `get_job_result()`, `cancel_job()`
  - Monitor and control jobs

**Impact:** HIGH - GP is core ArcGIS capability

---

### 8. Version Management - Partial Coverage

**Current:** edit_session.rs covers start/stop editing

**Missing Coverage:**
- **Create Version** - `create(params)`
  - Branch or traditional versioning

- **Reconcile/Post** - `reconcile()`, `post()`
  - Traditional versioning workflow

- **Conflict Inspection** - `inspect_conflicts(conflict_guid)`
  - View and resolve conflicts

- **Version Listing** - `list_versions()`
  - Enumerate all versions

**Impact:** MEDIUM - Advanced enterprise workflows

---

### 9. Portal - Partial Coverage

**Current:** portal_content_management.rs covers search and metadata

**Missing Coverage:**
- **Item CRUD** - `add_item()`, `update_item()`, `delete_item()`
  - Create and manage content

- **Item Data** - `get_item_data()`, `update_item_data()`
  - Upload/download item files

- **Sharing** - `share_item()`, `unshare_item()`
  - Control access permissions

- **Groups** - `create_group()`, `join_group()`, `add_to_group()`
  - Collaborative workspaces

- **Publishing** - `create_service()`, `publish()`, `get_publish_status()`
  - Publish data as services
  - Async job tracking

**Impact:** HIGH - Content management is core Portal functionality

---

## Recommended New Examples

### Priority 1: HIGH Impact (Core Functionality)

#### 1. **map_service_basics.rs** (Public or Enterprise)
**Operations:**
- Export static map image (PNG with custom extent)
- Export map with transparent background and custom DPI
- Identify features at clicked point
- Find features by keyword search
- Get map legend

**Why:** Map visualization is fundamental to GIS

**Location:** `examples/public/` (using public basemap service)

---

#### 2. **image_service_raster.rs** (Enterprise)
**Operations:**
- Export raster image with rendering rules
- Identify pixel values at point
- Get samples along transect (line)
- Compute pixel histograms
- Get raster metadata (bands, extent, pixel type)

**Why:** Raster analysis is core GIS workflow

**Location:** `examples/enterprise/` (requires imagery service)

---

#### 3. **geoprocessing_tools.rs** (Enterprise)
**Operations:**
- Execute synchronous GP tool (simple analysis)
- Submit async GP job (long-running task)
- Poll job status until complete
- Retrieve job results
- Handle job failures/cancellation

**Why:** Geoprocessing is signature ArcGIS capability

**Location:** `examples/enterprise/` (requires GP service access)

---

#### 4. **portal_publishing.rs** (Enterprise)
**Operations:**
- Create new item (web map definition)
- Upload item data (shapefile/CSV)
- Publish as hosted feature service
- Poll publish job status
- Share published service with organization
- Delete service when done

**Why:** Publishing workflow is common enterprise need

**Location:** `examples/enterprise/`

---

### Priority 2: MEDIUM Impact (Important Features)

#### 5. **vector_tiles.rs** (Public)
**Operations:**
- Fetch vector tiles (MVT format)
- Get Mapbox GL style JSON
- Get font glyphs for labeling
- Get sprite metadata and images
- Example: Build simple tile cache

**Why:** Modern web mapping standard

**Location:** `examples/public/` (using public vector basemap)

---

#### 6. **places_poi_search.rs** (Enterprise)
**Operations:**
- Find places near point (restaurants, gas stations)
- Filter by category
- Get place details (hours, reviews, phone)
- Get all available categories
- Display results sorted by distance

**Why:** POI discovery common in mobile/location apps

**Location:** `examples/enterprise/` (Places service requires credits)

---

#### 7. **elevation_analysis.rs** (Enterprise)
**Operations:**
- Get elevation profile along hiking trail
- Summarize elevation statistics in watershed
- Generate viewshed from mountain peak
- Compare DEM resolutions

**Why:** Terrain analysis for planning/engineering

**Location:** `examples/enterprise/` (Elevation service requires credits)

---

#### 8. **version_branching.rs** (Enterprise)
**Operations:**
- Create new branch version
- Make edits in branch
- Create conflicting edits in another branch
- Reconcile branches
- Inspect and resolve conflicts
- Post changes to default version

**Why:** Multi-user editing workflows

**Location:** `examples/enterprise/` (requires versioned feature service)

---

### Priority 3: LOWER Impact (Specialized Features)

#### 9. **feature_relationships.rs** (Enterprise)
**Operations:**
- Query related records (one-to-many)
- Query across multiple relationship classes
- Display related data (e.g., parcels → owners)

**Why:** Relational data common in enterprise GIS

**Location:** `examples/enterprise/`

---

#### 10. **advanced_queries.rs** (Public)
**Operations:**
- Query top N features by field ordering
- Batch calculate field values
- Use statistics (count, sum, avg)
- Geometry simplification with maxAllowableOffset

**Why:** Shows advanced query capabilities

**Location:** `examples/public/`

---

## Implementation Plan

### Phase 1: Core Services (Weeks 1-2)
Priority 1 examples that fill major service gaps:
1. map_service_basics.rs
2. geoprocessing_tools.rs
3. image_service_raster.rs
4. portal_publishing.rs

### Phase 2: Modern Mapping (Week 3)
Standards-based examples:
5. vector_tiles.rs
6. places_poi_search.rs

### Phase 3: Advanced Features (Week 4)
Specialized workflows:
7. elevation_analysis.rs
8. version_branching.rs
9. feature_relationships.rs
10. advanced_queries.rs

---

## Gap Summary

| Service Area | Operations Implemented | Examples | Coverage % | Priority |
|-------------|----------------------|----------|------------|----------|
| **Feature Service** | 20+ | 4 | 60% | ✅ Good |
| **Geocoding** | 6 | 1 | 80% | ✅ Good |
| **Routing** | 4 | 1 | 100% | ✅ Complete |
| **Geometry** | 6 | 1 | 70% | ✅ Good |
| **Portal** | 20+ | 1 | 30% | ⚠️ Needs work |
| **Map Service** | 8 | 0 | 0% | ❌ Missing |
| **Image Service** | 5 | 0 | 0% | ❌ Missing |
| **Vector Tiles** | 4 | 0 | 0% | ❌ Missing |
| **Places** | 3 | 0 | 0% | ❌ Missing |
| **Elevation** | 3 | 0 | 0% | ❌ Missing |
| **Geoprocessing** | 7 | 0 | 0% | ❌ Missing |
| **Version Mgmt** | 10 | 1 | 20% | ⚠️ Needs work |

**Overall Coverage:** 10 examples covering ~35% of implemented operations

---

## Notes

- **Authentication:** Most new examples will need enterprise/API key auth (except vector_tiles, map_service_basics which can use public services)
- **Service Access:** Geoprocessing, Places, Elevation, Image Service examples require access to specific services
- **Complexity:** Async geoprocessing and version branching examples are more complex
- **Documentation:** Each example should follow established pattern with demonstration functions and best practices section

---

## Success Metrics

A well-rounded example suite should:
- ✅ Cover all 12 major service clients
- ✅ Demonstrate both public and enterprise scenarios
- ✅ Show sync and async patterns
- ✅ Include error handling examples
- ✅ Progress from simple to advanced operations
- ✅ Provide copy-paste starting points for common tasks

**Target:** 20 examples covering 80%+ of implemented operations