Commit bbec6dd
authored
feat: import ArcGIS Pro projects from CIM JSON (#1637)
* feat: import ArcGIS Pro projects from CIM JSON
Reads .aprx and .mapx files directly, so ArcGIS Pro and ArcPy are not
needed to bring an existing map into GeoLibre. The importer restores the
first 2D map's extent, local vector layers, nested groups, visibility,
simple symbols, and field labels, and reports per-layer why anything was
skipped instead of failing the whole import.
* feat: import ArcGIS Pro rasters and vector tile services
Extends the importer beyond vector layers: local GeoTIFF raster layers and
portal-hosted vector tile layers now come across, and the Tauri asset guard
accepts .aprx/.mapx alongside .qgs/.qgz so an imported raster path can be read.
Also fixes a pre-existing defect the raster loop inherited from the QGIS
importer. The raster control creates its store layer before it awaits the
GeoTIFF header, so a rejection left the layer on the map while the importer
reported it as an unsupported format -- the layer list and the warning dialog
disagreed. Failed rasters are now rolled back, and the striped "not tiled"
rejection is no longer treated as a failure at all, since that layer stays on
purpose while the non-tiled handler offers to convert it to a COG.
* Address Copilot, Claude, and CodeRabbit review feedback
- Store each layer's and group's own visibility instead of the cascaded
value. applyGroupEffects folds ancestor visibility in at render time, so
pre-cascading discarded a nested item's real state and left it stuck hidden
after its parent group was re-enabled.
- Measure the MAPX size in bytes rather than String.length, which counts
UTF-16 code units, and check binary input before decoding it to a string.
- Cap an APRX's combined decompressed size, not just each member's, so many
members just under the per-entry limit cannot add up past it.
- Read CIM colors according to their subclass. CMYK, gray, and HSV colors
store different channels on different scales, so interpreting every values
array as RGB produced the wrong color; unknown subclasses keep the default.
- Warn when a saved extent is dropped because its coordinate system cannot be
converted, instead of silently opening at the generic world view.
- Join a folder workspace with its dataset generically so file formats other
than shapefile and delimited text can resolve.
- Omit `reason` from resolveDataSource on success rather than returning
"format" for a supported layer, and rename the shadowed `bytes` binding.
* Address Claude review feedback
- Keep a layer group whose only members are a raster or a service. Both are
attached after the project loads, so pruning the group made the later
moveLayerToGroup a silent no-op and stranded them at the top level.
- Report a raster on a UNC workspace as "network-path" rather than "format",
matching what the vector path already reports for the same root cause.
- Stop unbounded group recursion. A corrupt or crafted project can reference
a group that already contains it, and children resolved from the archive
share object identity, so the import recursed until the stack overflowed.
Group nesting now carries an ancestor set plus a depth cap, and a project
that trips either gets a warning instead of crashing the import.
* Address Claude and CodeRabbit review feedback
- Read layer opacity from CIM `transparency` (0-100, inverted) rather than a
non-existent `opacity` field, so partially transparent ArcGIS layers no
longer import as fully opaque. Applied to rasters, services, groups, and
feature layers, and rounded so float noise does not reach the project file.
- Give addArcGISLayer a `zoomTo` opt-out and use it when importing services.
It fit the map to every layer's bounds unconditionally, throwing away the
extent loadProject had just restored from the project file.
- Place a raster in its imported group on the recoverable "not tiled" path.
That layer stays on the map pending COG conversion, so returning early left
it outside the group the project put it in.
- Re-prune layer groups in the browser build after local-file layers are
dropped, counting services (which still load) and not rasters (which never
do), and keeping ancestors of surviving groups.
- Rename the `allow_raster_asset` parameter and its caller option to
`import_project_path`/`importProjectPath` now that it accepts ArcGIS Pro
projects too, and update the Rust doc comment to match.
- Assert an asymmetric gray level so the color test pins the scale direction.1 parent 3517a6d commit bbec6dd
17 files changed
Lines changed: 1669 additions & 41 deletions
File tree
- apps/geolibre-desktop
- src-tauri/src
- src
- components/layout
- toolbar
- hooks
- i18n/locales
- lib
- docs
- user-guide
- packages/plugins/src
- plugins
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
463 | | - | |
464 | | - | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
465 | 466 | | |
466 | 467 | | |
467 | 468 | | |
468 | 469 | | |
469 | | - | |
| 470 | + | |
470 | 471 | | |
471 | 472 | | |
472 | 473 | | |
473 | 474 | | |
474 | 475 | | |
475 | 476 | | |
476 | 477 | | |
477 | | - | |
| 478 | + | |
478 | 479 | | |
479 | 480 | | |
480 | | - | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
481 | 485 | | |
482 | 486 | | |
483 | | - | |
| 487 | + | |
484 | 488 | | |
485 | | - | |
| 489 | + | |
486 | 490 | | |
487 | 491 | | |
488 | 492 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1551 | 1551 | | |
1552 | 1552 | | |
1553 | 1553 | | |
| 1554 | + | |
1554 | 1555 | | |
1555 | 1556 | | |
1556 | 1557 | | |
| |||
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 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 | + | |
79 | 111 | | |
80 | 112 | | |
81 | 113 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| 72 | + | |
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
| |||
222 | 224 | | |
223 | 225 | | |
224 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
225 | 231 | | |
226 | 232 | | |
227 | 233 | | |
| |||
Lines changed: 198 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
10 | 15 | | |
11 | 16 | | |
12 | 17 | | |
| |||
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
| |||
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
| 50 | + | |
44 | 51 | | |
45 | 52 | | |
46 | 53 | | |
| |||
134 | 141 | | |
135 | 142 | | |
136 | 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 | + | |
137 | 196 | | |
138 | 197 | | |
139 | 198 | | |
| |||
154 | 213 | | |
155 | 214 | | |
156 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
157 | 219 | | |
158 | 220 | | |
159 | 221 | | |
| |||
235 | 297 | | |
236 | 298 | | |
237 | 299 | | |
238 | | - | |
| 300 | + | |
239 | 301 | | |
240 | 302 | | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
253 | 321 | | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
| 322 | + | |
| 323 | + | |
260 | 324 | | |
261 | 325 | | |
262 | 326 | | |
| |||
276 | 340 | | |
277 | 341 | | |
278 | 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 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
279 | 454 | | |
280 | 455 | | |
281 | 456 | | |
| |||
830 | 1005 | | |
831 | 1006 | | |
832 | 1007 | | |
| 1008 | + | |
| 1009 | + | |
833 | 1010 | | |
834 | 1011 | | |
835 | 1012 | | |
| |||
853 | 1030 | | |
854 | 1031 | | |
855 | 1032 | | |
| 1033 | + | |
856 | 1034 | | |
857 | 1035 | | |
858 | 1036 | | |
| |||
0 commit comments