Project¶
Python style interface for arcpy.mp submodule
This module attempts to wrap the mp classes and functions in a way that provides a more OO approach to navigating and managing ArcGISProject objects and their associated elements.
All list* methods are replaced with ElementList properties that allow indexing on longName/name/URI/regex name match.
All elements when accessed from a Project root will have a parent attribute that allows traversal of the CIM/DOM
Objects that returned
Overhead has been kept as low as possible. There is agressive cache usage, so manual invalidation using Element.refresh is required if you modify an element outside this framework.
Some elements have no CIM properties in arcpy, but the aprx file actually contains their raw CIM definition. These elements allow you to access the CIM in read-only mode and will not allow you to set it.
Example
>>> with Project('my-project.aprx') as prj:
... for map in prj.maps['Plan*']:
... for lay in map.layers['*Route']:
... # when using `with Project() as ...`
... # Project.save is called on __exit__
... if lay.name == 'Proposed Route':
... lay.visible = False
... print(f'{lay.name} (2024+): {len(lay)}')
... with lay.query_as('YEAR >= 2024'):
... print(f'{lay.name} (2024+): {len(lay)}')
Proposed Route: 216
Proposed Route (2024+): 65
Final Route: 673
Final Route (2024+): 175
| CLASS | DESCRIPTION |
|---|---|
Project |
ArcGISProject wrapper |
ChartType
module-attribute
¶
ChartType = Literal[
'Bar',
'Box',
'CalendarHeat',
'Combo',
'DataClock',
'Histogram',
'Line',
'MatrixHeat',
'Pie',
'QQPlot',
'Scatter',
'ScatterMatrix',
]
-
Modules
Project
ChartTypes
-
Modules
Project
ChartTypes
LayerProperty
module-attribute
¶
LayerProperty = Literal[
'brightness',
'connectionProperties',
'contrast',
'dataSource',
'definitionQuery',
'elevation',
'is3DLayer',
'isBasemapLayer',
'isBroken',
'isFeatureLayer',
'isGraphicsLayer',
'isGroupLayer',
'isNetworkAnalystLayer',
'isNetworkDatasetLayer',
'isParcelFabricLayer',
'isRasterLayer',
'isSceneLayer',
'isTimeEnabled',
'isWebLayer',
'longName',
'maxThreshold',
'metadata',
'minThreshold',
'name',
'showLabels',
'symbology',
'transparency',
'time',
'URI',
'visible',
]
LayerType
module-attribute
¶
LayerType = Literal[
'3d',
'basemap',
'broken',
'feature',
'graphics',
'group',
'network-analyst',
'network-dataset',
'parcel-fabric',
'raster',
'scene',
'time-enabled',
'topology',
'web',
'annotation-layer',
'annotation-sublayer',
'dimension-layer',
'terrain-layer',
'raster-catalog-layer',
]
LegendFittingStrategy
module-attribute
¶
LegendFittingStrategy = Literal[
'AdjustFontSize',
'AdjustColumns',
'AdjustColumnsAndFont',
'AdjustFrame',
'ManualColumns',
]
-
Modules
Project
LegendElementfitting_strategy
LegendItemArrangement
module-attribute
¶
LegendItemArrangement = Literal[
'PatchLabelDescription',
'PatchDescriptionLabel',
'LabelPatchDescription',
'LabelDescriptionPatch',
'DescriptionPatchLabel',
'DescriptionLabelPatch',
]
-
Modules
Project
LegendItemarrangement
StatisticType
module-attribute
¶
StatisticType = Literal[
'COUNT',
'MEAN',
'MEDIAN',
'SUM',
'STD_DEV',
'MAX',
'MIN',
]
-
Modules
Project
ReportStatisticstatistic
Chart
¶
Chart = (
Bar
| Box
| CalendarHeat
| Combo
| DataClock
| Histogram
| Line
| MatrixHeat
| Pie
| QQPlot
| Scatter
| ScatterMatrix
)
MPElement
¶
MPElement = (
ArcGISProject
| Map
| MapView
| Layer
| Table
| ElevationSurface
| Layout
| MapFrame
| MapSeries
| Bookmark
| BookmarkMapSeries
| Report
| ElevationSource
| StyleItem
| LabelClass
| MapSurroundElement
| TableFrameElement
| GraphicElement
| GroupElement
| LegendElement
| LegendItem
| PictureElement
| TextElement
| ReportSection
| ReportLayoutSection
| None
)
APRXNode
¶
AllLayerProps
¶
Bases: TypedDict
| ATTRIBUTE | DESCRIPTION |
|---|---|
URI |
TYPE:
|
brightness |
TYPE:
|
connectionProperties |
TYPE:
|
contrast |
TYPE:
|
dataSource |
TYPE:
|
definitionQuery |
TYPE:
|
elevation |
TYPE:
|
is3DLayer |
TYPE:
|
isBasemapLayer |
TYPE:
|
isBroken |
TYPE:
|
isFeatureLayer |
TYPE:
|
isGraphicsLayer |
TYPE:
|
isGroupLayer |
TYPE:
|
isNetworkAnalystLayer |
TYPE:
|
isNetworkDatasetLayer |
TYPE:
|
isParcelFabricLayer |
TYPE:
|
isRasterLayer |
TYPE:
|
isSceneLayer |
TYPE:
|
isTimeEnabled |
TYPE:
|
isWebLayer |
TYPE:
|
longName |
TYPE:
|
maxThreshold |
TYPE:
|
metadata |
TYPE:
|
minThreshold |
TYPE:
|
name |
TYPE:
|
showLabels |
TYPE:
|
symbology |
TYPE:
|
time |
TYPE:
|
transparency |
TYPE:
|
visible |
TYPE:
|
Bookmark
¶
Bookmark(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: Element[Bookmark, CIMBookmark, Map]
- Modules Project
-
Modules
Project
Layoutcreate_bookmark_mapseries
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
update_thumbnail |
Update the thumbnail for the Bookmark. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
description |
The description of the Bookmark.
TYPE:
|
elem |
|
has_map |
Determine if the Bookmark has an associated Map.
TYPE:
|
has_thumbnail |
Determine if the Bookmark has a thubmnail.
TYPE:
|
map |
The Map the Bookmark is associated with. (If not built by
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
short_name |
A short name for the Element (
TYPE:
|
unique_name |
|
uri |
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
map
property
¶
map: Map
The Map the Bookmark is associated with. (If not built by arcpie, Map parent will be None)
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
update_thumbnail
¶
update_thumbnail() -> None
Update the thumbnail for the Bookmark.
Source code in src/arcpie/project/elements.py
4322 4323 4324 | |
BookmarkMapSeries
¶
BookmarkMapSeries(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: Element[BookmarkMapSeries, CIMBookmarkMapSeries, Layout]
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__len__ |
|
__repr__ |
|
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
refresh |
Refresh all cached elements. |
reload |
Reload the BookmarkMapseries. Alias of |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
bookmarks |
ElementList of all associated Bookmarks.
TYPE:
|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
current_bookmark |
Get the current Bookmark.
TYPE:
|
current_page_name |
Get the current Bookmark name.
TYPE:
|
current_page_number |
Get the current page number.
TYPE:
|
elem |
|
has_current_bookmark |
Determine if there is a current Bookmark set.
TYPE:
|
has_map_frame |
Determine if the BookmarkMapSeries has an associated MapFrame.
TYPE:
|
map_frame |
The Associated MapFrame for the BookmarkMapSeries. (raises:
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
page_count |
Total number of pages in the BookmarkMapSeries.
TYPE:
|
parent |
|
short_name |
A short name for the Element (
TYPE:
|
unique_name |
|
uri |
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
has_current_bookmark
property
¶
has_current_bookmark: bool
Determine if there is a current Bookmark set.
has_map_frame
property
¶
has_map_frame: bool
Determine if the BookmarkMapSeries has an associated MapFrame.
map_frame
property
¶
map_frame: MapFrame
The Associated MapFrame for the BookmarkMapSeries. (raises: AttributeError)
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__len__
¶
__len__() -> int
Source code in src/arcpie/project/elements.py
4334 4335 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
reload
¶
reload() -> None
Reload the BookmarkMapseries. Alias of refresh since refresh is used for cache.
Source code in src/arcpie/project/elements.py
4394 4395 4396 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
ChartMap
¶
Bases: TypedDict
| ATTRIBUTE | DESCRIPTION |
|---|---|
Bar |
TYPE:
|
Box |
TYPE:
|
CalendarHeat |
TYPE:
|
Combo |
TYPE:
|
DataClock |
TYPE:
|
Histogram |
TYPE:
|
Line |
TYPE:
|
MatrixHeat |
TYPE:
|
Pie |
TYPE:
|
QQPlot |
TYPE:
|
Scatter |
TYPE:
|
ScatterMatrix |
TYPE:
|
DefinitionQuery
¶
Element
¶
Element(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
- Modules Project
-
Modules
Project
-
Bookmark -
BookmarkMapSeries -
Elementchildren -
ElevationSourcechildren -
ElevationSurface -
GraphicElement -
GroupElement -
GroupLayerchildren -
LabelClass -
Layer -
Layoutchildren -
LayoutElement -
LegendElement -
LegendItem -
Mapchildren -
MapFramechildren -
MapSeries -
MapSurroundElement -
MapView -
PictureElement -
Projectchildren -
Reportchildren -
ReportElement -
ReportLayoutSection -
ReportSectionchildren -
Stylechildren -
StyleItem -
Table -
TableFrameElementchildren -
TextElementchildren
-
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
elem |
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
short_name |
A short name for the Element (
TYPE:
|
unique_name |
|
uri |
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
ElementList
¶
Bases: list[E]
Simple list wrapper that allows accessing elements from a list by name/uRI.
- Modules Project
-
Modules
Project
-
Bookmarkchildren -
BookmarkMapSerieschildren -
Elementchildren -
ElevationSourcechildren -
ElevationSurfacechildren -
GraphicElementchildren -
GroupElementchildren -
GroupLayerchildren -
LabelClasschildren -
Layerchildren -
Layoutchildren -
LayoutElementchildren -
LegendElementchildren -
LegendItemchildren -
Mapchildren -
MapFramechildren -
MapSerieschildren -
MapSurroundElementchildren -
MapViewchildren -
PictureElementchildren -
Projectchildren -
Reportchildren -
ReportElementchildren -
ReportLayoutSectionchildren -
ReportSectionchildren -
Stylechildren -
StyleItemchildren -
Tablechildren -
TableFrameElementchildren -
TextElementchildren
-
| METHOD | DESCRIPTION |
|---|---|
__add__ |
|
__contains__ |
|
__getitem__ |
|
copy |
|
filter |
Filter elements in the list using the provided function |
get |
Get the item from the list but return the default if it doesn't exist |
unwrap |
Unwrap the ElementList and check to see if it has the expected number of items |
__add__
¶
__add__(value: Sequence[S]) -> ElementList[S | E]
__add__(
value: Sequence[E] | Sequence[S],
) -> ElementList[S | E] | ElementList[E]
Source code in src/arcpie/project/elements.py
594 595 | |
__contains__
¶
Source code in src/arcpie/project/elements.py
578 579 580 581 582 583 584 | |
__getitem__
¶
__getitem__(i: SupportsIndex) -> E
Source code in src/arcpie/project/elements.py
544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 | |
copy
¶
copy() -> ElementList[E]
Source code in src/arcpie/project/elements.py
612 613 | |
filter
¶
Filter elements in the list using the provided function
Source code in src/arcpie/project/elements.py
586 587 588 | |
get
¶
get(i: SupportsIndex, /, default: D = ...) -> E | D
Get the item from the list but return the default if it doesn't exist
Source code in src/arcpie/project/elements.py
605 606 607 608 609 610 | |
unwrap
¶
Unwrap the ElementList and check to see if it has the expected number of items
| PARAMETER | DESCRIPTION |
|---|---|
|
The number of elements you expect to have (default:
TYPE:
|
|
If set to
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Element
|
if |
Self
|
if |
UnwrapError
|
(KeyError subclass) if |
| RAISES | DESCRIPTION |
|---|---|
UnwrapError
|
(KeyError subclass) |
Example
>>> prj = Project(...)
>>> mp = prj.maps['My Map'].unwrap()
>>> mp
Map(My Map)
>>> mp = prj.maps['Duplicate Map'].unwrap()
Traceback (most recent call last):
File ...
UnwrapError: 'expected 1: have 2'
>>> mp = prj.maps['Duplicate Map'].unwrap(panic=False)
>>> mp
UnwrapError('expected 1: have 2')
>>> mp = prj.maps['Duplicate Map'].unwrap(expects=2)
>>> mp
[Map(Duplicate Map), Map(Duplicate Map)]
Source code in src/arcpie/project/elements.py
623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 | |
ElevationSource
¶
ElevationSource(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: Element[ElevationSource, None, Project]
-
Modules
Project
ElevationSurfaceelevation_sources
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
elem |
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
short_name |
A short name for the Element (
TYPE:
|
source |
The string representation of the Elevation data source.
TYPE:
|
unique_name |
|
uri |
|
visible |
Visibility state of the ElevationSource.
TYPE:
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
ElevationSurface
¶
ElevationSurface(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: Element[ElevationSurface, CIMLayerElevationSurface, Map]
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
elem |
|
elevation_sources |
ElementList of all ElevationSources for the ElevationSurface.
TYPE:
|
has_map |
Determine if the ElevationSurface is associated with a Map.
TYPE:
|
map |
The Map that the ElevationSurface is associated with.
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
short_name |
A short name for the Element (
TYPE:
|
unique_name |
|
uri |
|
vertical_exaggeration |
Vertical exaggeration of the Elevation Z values.
TYPE:
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
elevation_sources
property
¶
elevation_sources: ElementList[ElevationSource]
ElementList of all ElevationSources for the ElevationSurface.
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
vertical_exaggeration
property
writable
¶
vertical_exaggeration: float
Vertical exaggeration of the Elevation Z values.
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
FolderConf
¶
Bases: TypedDict
-
Modules
Project
Projectfolder_connections
| ATTRIBUTE | DESCRIPTION |
|---|---|
alias |
TYPE:
|
connectionString |
|
isHomeFolder |
TYPE:
|
GraphicElement
¶
GraphicElement(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: LayoutElement[GraphicElement, CIMGraphicElement]
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
apply_style |
Apply a `` StyleItem to the MapSurroundElement. |
clone |
Clone the GraphicElement with an optional new name. (default: |
delete |
Delete the LayuoutElement from its parent Layout (if it has one). |
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
move |
Shift the element by the provided x/y deltas. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
anchor |
LayoutElement anchor point.
TYPE:
|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
elem |
|
group |
GroupElement the LayoutElement belongs to if it exists.
TYPE:
|
height |
LayoutElement height in page units.
TYPE:
|
locked |
The editability state of the LayoutElement.
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
rotation |
LayoutElement rotation in degrees. (
TYPE:
|
short_name |
A short name for the Element (
TYPE:
|
type |
The string name for the LayoutElement type.
TYPE:
|
unique_name |
|
uri |
|
visible |
Visibility state for the LayoutElement.
TYPE:
|
width |
LayoutElement width in page units.
TYPE:
|
x |
The X position of the LayoutElement anchor point in page units.
TYPE:
|
y |
The Y position of the LayoutElement anchor point in page units.
TYPE:
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
rotation
property
writable
¶
rotation: float
LayoutElement rotation in degrees. (TableFrameElements cannot be rotated)
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
apply_style
¶
apply_style(style_item: StyleItemLike) -> None
Apply a `` StyleItem to the MapSurroundElement.
Source code in src/arcpie/project/elements.py
4977 4978 4979 4980 4981 4982 | |
clone
¶
Clone the GraphicElement with an optional new name. (default: {name}{n+1})
Source code in src/arcpie/project/elements.py
4984 4985 4986 4987 4988 | |
delete
¶
delete() -> None
Delete the LayuoutElement from its parent Layout (if it has one).
Source code in src/arcpie/project/elements.py
4944 4945 4946 4947 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
move
¶
Shift the element by the provided x/y deltas.
Source code in src/arcpie/project/elements.py
4949 4950 4951 4952 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
GroupElement
¶
GroupElement(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: LayoutElement[GroupElement, CIMGroupElement]
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
delete |
Delete the LayuoutElement from its parent Layout (if it has one). |
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
move |
Shift the element by the provided x/y deltas. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
anchor |
LayoutElement anchor point.
TYPE:
|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
elem |
|
elements |
ElementList of all LayoutElements within the GroupElement. (use other properties for typed/filtered LayoutElements)
TYPE:
|
graphic_elements |
ElementList of all GraphicElements within the GroupElement.
TYPE:
|
group |
GroupElement the LayoutElement belongs to if it exists.
TYPE:
|
group_elements |
ElementList of all GroupElements within the GroupElement.
TYPE:
|
height |
LayoutElement height in page units.
TYPE:
|
legend_elements |
ElementList of all LegendElements within the GroupElement.
TYPE:
|
locked |
The editability state of the LayoutElement.
TYPE:
|
map_frames |
ElementList of all MapFrames within the GroupElement.
TYPE:
|
map_surround_elements |
ElementList of all MapSurroundElements within the GroupElement.
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
picture_elements |
ElementList of all PictureElements within the GroupElement.
TYPE:
|
rotation |
LayoutElement rotation in degrees. (
TYPE:
|
short_name |
A short name for the Element (
TYPE:
|
table_frame_elements |
ElementList of all TableFrameElements within the GroupElement.
TYPE:
|
text_elements |
ElementList of all TextElements within the GroupElement.
TYPE:
|
type |
The string name for the LayoutElement type.
TYPE:
|
unique_name |
|
uri |
|
visible |
Visibility state for the LayoutElement.
TYPE:
|
width |
LayoutElement width in page units.
TYPE:
|
x |
The X position of the LayoutElement anchor point in page units.
TYPE:
|
y |
The Y position of the LayoutElement anchor point in page units.
TYPE:
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
elements
property
¶
elements: ElementList[LayoutElement[Any, Any]]
ElementList of all LayoutElements within the GroupElement. (use other properties for typed/filtered LayoutElements)
graphic_elements
property
¶
graphic_elements: ElementList[GraphicElement]
ElementList of all GraphicElements within the GroupElement.
group_elements
property
¶
group_elements: ElementList[GroupElement]
ElementList of all GroupElements within the GroupElement.
legend_elements
property
¶
legend_elements: ElementList[LegendElement]
ElementList of all LegendElements within the GroupElement.
map_frames
property
¶
map_frames: ElementList[MapFrame]
ElementList of all MapFrames within the GroupElement.
map_surround_elements
property
¶
map_surround_elements: ElementList[MapSurroundElement]
ElementList of all MapSurroundElements within the GroupElement.
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
picture_elements
property
¶
picture_elements: ElementList[PictureElement]
ElementList of all PictureElements within the GroupElement.
rotation
property
writable
¶
rotation: float
LayoutElement rotation in degrees. (TableFrameElements cannot be rotated)
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
table_frame_elements
property
¶
table_frame_elements: ElementList[TableFrameElement]
ElementList of all TableFrameElements within the GroupElement.
text_elements
property
¶
text_elements: ElementList[TextElement]
ElementList of all TextElements within the GroupElement.
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
delete
¶
delete() -> None
Delete the LayuoutElement from its parent Layout (if it has one).
Source code in src/arcpie/project/elements.py
4944 4945 4946 4947 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
move
¶
Shift the element by the provided x/y deltas.
Source code in src/arcpie/project/elements.py
4949 4950 4951 4952 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
GroupLayer
¶
GroupLayer(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: Element[Layer, CIMGroupLayer, 'Map | GroupLayer']
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
add_layer |
|
add_table |
|
diff |
Generate a diff of two Layers using |
export_lyrx |
|
get_cim |
Get the CIM definition for the Element. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
elem |
|
group_layers |
TYPE:
|
group_type |
TYPE:
|
layers |
TYPE:
|
lyrx |
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
short_name |
A short name for the Element (
TYPE:
|
spatial_reference |
TYPE:
|
tables |
TYPE:
|
unique_name |
|
uri |
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
add_layer
¶
add_layer(
layer: LayerLike,
position: AddPosition = 'AUTO_ARRANGE',
*,
copy: bool = False,
) -> Layer
Source code in src/arcpie/project/elements.py
2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 | |
add_table
¶
Source code in src/arcpie/project/elements.py
2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
export_lyrx
¶
Source code in src/arcpie/project/elements.py
2302 2303 2304 2305 2306 2307 2308 2309 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
HasCentroid
¶
Bases: Protocol
| ATTRIBUTE | DESCRIPTION |
|---|---|
centroid |
TYPE:
|
spatialReference |
TYPE:
|
trueCentroid |
TYPE:
|
HasExtent
¶
LabelClass
¶
LabelClass(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: Element[LabelClass, CIMLabelClass, Layer]
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
elem |
|
expression |
A string representation of the label expression in the selected language.
TYPE:
|
lang_codes |
|
language |
The language code for the LabelClass
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
query |
A SQL where clause to filter labeled features.
TYPE:
|
short_name |
A short name for the Element (
TYPE:
|
unique_name |
|
uri |
|
visible |
Visibility state of the LabelClass.
TYPE:
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
expression
property
writable
¶
expression: str
A string representation of the label expression in the selected language.
lang_codes
class-attribute
¶
lang_codes: dict[str, LabelClassLanguage] = {
'VBScript': 'VBSCRIPT',
'JScript': 'JSCRIPT',
'Python': 'PYTHON',
'Arcade': 'ARCADE',
}
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
Layer
¶
Layer(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: Element[Layer, CIMBaseLayer, Map | GroupLayer]
| METHOD | DESCRIPTION |
|---|---|
__bool__ |
|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__iter__ |
|
__len__ |
|
__repr__ |
|
clear_selection |
Clear the current selection. (same as |
clone_properties |
Copy specified properties from another Layer. |
create_label_class |
Create a new LabelClass for the Layer. |
delete |
Delete the Layer. |
diff |
Generate a diff of two Layers using |
export_csv |
Export the table data to a CSV file. |
export_lyrx |
Export the |
get_cim |
Get the CIM definition for the Element. |
get_prop |
Get a single property or |
get_props |
Get requested layer properties. |
open_view |
Open the Layer table view in the active project. |
query_as |
Context manager for setting the active DefinitionQuery string. |
refresh |
Refresh all cached elements. |
select |
Set a selection on the Layer using a predicate or query and a method. |
select_all |
Select all features in the Layer. (same as |
selected |
Get a list of all selected feature records. |
set_cim |
Set a CIM definition for an Element set |
set_prop |
Set a single property of the layer (if it is supported). |
set_props |
Set the provided properties of the Layer. |
unselected |
Get a list of all unselected feature records. |
update_connection |
Update the connection properties of the Layer. |
update_from_json |
Update the Layer using a WebBuilder json definition. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
NotSupported |
A sentinel for signaling that a layer property is not available for the given layer
|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
chart_map |
Get a mapping of all charts by type. (all chart types included, empty list for unused chart types)
TYPE:
|
charts |
Get Chart objects associated with the Layer. |
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_symbology |
Get the symbology CIM object (or
TYPE:
|
cim_symbology_type |
Get the type of the CIM Symbology (or
TYPE:
|
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
data_source |
Get the string representation of the Layer datasource (or
TYPE:
|
definition_queries |
Get the DesinitonQueries for the Layer (empty list if no queries or not suppported).
TYPE:
|
definition_query |
Get the active DefinitionQuery string for the Layer (or
|
elem |
|
feature_class |
Get the associated FeatureClass object for the layer.
TYPE:
|
has_feature_class |
Check to see if the Layer has a valid
TYPE:
|
is_geographic |
Determine if the Layer is projected by comparing the SR GCS to the SR.
TYPE:
|
is_projected_on_fly |
Determine if the layer is projected on the fly by comparing datasource SR to layer SR.
TYPE:
|
label_classes |
Get an ElementList of all LabelClasses for the Layer.
TYPE:
|
lyrx |
A dictionary representing the lyrx definition of the Layer. |
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
page_query |
Get the active PageQuery of the layer.
TYPE:
|
parent |
|
props |
Get all properties of the layer with unsupported properties being set to
TYPE:
|
relative_cim_dict |
A copy of the CIM data with dataConnections made relative to the project. |
relative_lyrx |
A copy of the lyrx with relative pathing for dataConnections. |
selection |
Get a set of all selected feaature OIDs. |
short_name |
A short name for the Element (
TYPE:
|
source_data |
Alias for
TYPE:
|
spatial_reference |
Get the SR of the Layer by checking the associated FeatureClass.
TYPE:
|
supported |
Get the suported properties of the Layer (see: |
symbology |
Get the layer symbology (or
TYPE:
|
types |
Get a set of string identifiers for the Layer Type. |
unique_name |
|
unsupported |
Get the unsupported properties of the Layer (see: |
uri |
|
visible |
Get the visibility state of the Layer (or
TYPE:
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
NotSupported
class-attribute
instance-attribute
¶
NotSupported = NotSupported
A sentinel for signaling that a layer property is not available for the given layer Use with identity checks:
if lay.props['brightness'] is Layer.NotSupported: ... # handle
-
Modules
Project
LayerNotSupported
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
chart_map
property
¶
chart_map: ChartMap
Get a mapping of all charts by type. (all chart types included, empty list for unused chart types)
cim_symbology
property
writable
¶
cim_symbology: CIMRenderer
Get the symbology CIM object (or Layer.NotSupported).
cim_symbology_type
property
¶
cim_symbology_type: type[CIMRenderer]
Get the type of the CIM Symbology (or type(Layer.NotSupported))
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
data_source
property
writable
¶
data_source: str
Get the string representation of the Layer datasource (or Layer.NotSupported).
definition_queries
property
writable
¶
definition_queries: list[DefinitionQuery]
Get the DesinitonQueries for the Layer (empty list if no queries or not suppported).
definition_query
property
writable
¶
definition_query
Get the active DefinitionQuery string for the Layer (or Layer.NotSupported).
feature_class
property
¶
feature_class: FeatureClass
Get the associated FeatureClass object for the layer.
validating connections is slow, so use has_feature_class if you need a guard
has_feature_class
property
¶
has_feature_class: bool
Check to see if the Layer has a valid FeatureClass association.
is_geographic
property
¶
is_geographic: bool
Determine if the Layer is projected by comparing the SR GCS to the SR.
is_projected_on_fly
property
¶
is_projected_on_fly: bool
Determine if the layer is projected on the fly by comparing datasource SR to layer SR.
label_classes
property
¶
label_classes: ElementList[LabelClass]
Get an ElementList of all LabelClasses for the Layer.
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
props
property
writable
¶
props: AllLayerProps
Get all properties of the layer with unsupported properties being set to Layer.NotSupported
relative_cim_dict
property
¶
A copy of the CIM data with dataConnections made relative to the project.
relative_lyrx
property
¶
A copy of the lyrx with relative pathing for dataConnections.
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
source_data
property
¶
source_data: FeatureClass
Alias for feature_class that matches Table for use in duck typed loops.
spatial_reference
property
¶
spatial_reference: SpatialReference
Get the SR of the Layer by checking the associated FeatureClass.
supported
property
¶
Get the suported properties of the Layer (see: LayerProperty)
unsupported
property
¶
Get the unsupported properties of the Layer (see: LayerProperty)
visible
property
writable
¶
visible: bool
Get the visibility state of the Layer (or Layer.NotSupported).
__bool__
¶
__bool__() -> Literal[True]
Source code in src/arcpie/project/elements.py
2838 2839 2840 | |
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
2842 2843 | |
__iter__
¶
Source code in src/arcpie/project/elements.py
2833 2834 2835 2836 | |
__len__
¶
__len__() -> int
Source code in src/arcpie/project/elements.py
2828 2829 2830 2831 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
clear_selection
¶
clear_selection() -> Self
Clear the current selection. (same as layer.select(method='CLEAR')
Source code in src/arcpie/project/elements.py
2909 2910 2911 | |
clone_properties
¶
clone_properties(
from_layer: LayerLike,
properties: LayerPasteProperties = 'ALL',
)
Copy specified properties from another Layer.
Source code in src/arcpie/project/elements.py
3006 3007 3008 3009 | |
create_label_class
¶
create_label_class(
name: str,
expression: str,
query: str | None = ...,
language: Literal['VBSCRIPT'] = 'VBSCRIPT',
) -> LabelClass
create_label_class(
name: str,
expression: str,
query: str | None = ...,
language: LabelClassLanguage = ...,
) -> LabelClass
create_label_class(
name: str,
expression: str,
query: str | None = None,
language: LabelClassLanguage = 'ARCADE',
) -> LabelClass
Create a new LabelClass for the Layer.
| PARAMETER | DESCRIPTION |
|---|---|
|
The name of the new LabelClass.
TYPE:
|
|
An expression to use for the LabelClass.
TYPE:
|
|
An optional SQL where clause to filter the labeled features with.
TYPE:
|
|
The expression language. (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 | |
delete
¶
delete() -> None
Delete the Layer.
Source code in src/arcpie/project/elements.py
2799 2800 2801 2802 2803 2804 2805 2806 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
export_csv
¶
export_csv(
outdir: Path | str,
*,
name: str | None = None,
fields: Iterable[str] | None = None,
sep: str = ',',
newline: str = '\n',
) -> Path
Export the table data to a CSV file.
| PARAMETER | DESCRIPTION |
|---|---|
|
The output directory or file. |
|
An optional name to give the file (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 | |
export_lyrx
¶
export_lyrx(
outdir: Path | str,
*,
name: str | None = None,
indent: int | None = None,
relative: bool = True,
) -> Path
Export the lyrx definition of the Layer to a file.
| PARAMETER | DESCRIPTION |
|---|---|
|
The directory to place the |
|
An optional name for the
TYPE:
|
|
Indentation level in the output
TYPE:
|
|
Convert all absolute paths in the
TYPE:
|
Source code in src/arcpie/project/elements.py
2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
get_prop
¶
get_prop(prop: LayerProperty) -> Any
Get a single property or Layer.NotSupported.
Source code in src/arcpie/project/elements.py
2601 2602 2603 2604 2605 | |
get_props
¶
get_props(*props: LayerProperty) -> SomeLayerProps
Get requested layer properties.
Note
*props is case insensitive (underscores are replaced with empty strings)
(e.g. dataSource == DATASOURCE == datasource == data_source).
The returned dictionary will use the supplied case.
(e.g. layer.get_props('DATASOURCE') -> {'DATASOURCE': ...})
if a property is not supported, Layer.NotSupported is set as the value.
(e.g layer.get_props('brightness') -> {'brightness': Layer.NotSupported})
Raises: ValueError: If a property is not a layer property
Source code in src/arcpie/project/elements.py
2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 | |
open_view
¶
open_view(selected: bool = False) -> None
Open the Layer table view in the active project.
Source code in src/arcpie/project/elements.py
3017 3018 3019 | |
query_as
¶
query_as(query: str | None)
Context manager for setting the active DefinitionQuery string.
Example:
>>> print(len(lay))
250
>>> with lay.query_as("STATUS = 'ACTIVE'"):
... print(len(lay))
125
Source code in src/arcpie/project/elements.py
2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
select
¶
select(
*,
predicate: Callable[[dict[str, Any]], bool]
| None = None,
query: str | None = None,
method: Method | Literal['CLEAR', 'ALL'] = 'NEW',
) -> Self
Set a selection on the Layer using a predicate or query and a method.
| PARAMETER | DESCRIPTION |
|---|---|
|
A function that takes a feature record and returns True if it is to be selected. |
|
A SQL where clause that will define the selection (ignored if
TYPE:
|
|
How to resolve the selection with existing selection.
TYPE:
|
Note
Calling with method = 'CLEAR' and no other arguments will clear the selection.
Calling with method = 'ALL' and no other arguments will select all features.
Source code in src/arcpie/project/elements.py
2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 | |
select_all
¶
select_all() -> Self
Select all features in the Layer. (same as layer.select(method='ALL')
Source code in src/arcpie/project/elements.py
2913 2914 2915 | |
selected
¶
Get a list of all selected feature records.
Source code in src/arcpie/project/elements.py
2899 2900 2901 2902 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
set_prop
¶
set_prop(prop: LayerProperty, val: Any) -> None
Set a single property of the layer (if it is supported).
Source code in src/arcpie/project/elements.py
2615 2616 2617 2618 2619 | |
set_props
¶
set_props(**props: Unpack[SomeLayerProps]) -> None
Set the provided properties of the Layer.
Source code in src/arcpie/project/elements.py
2607 2608 2609 2610 2611 2612 2613 | |
unselected
¶
Get a list of all unselected feature records.
Source code in src/arcpie/project/elements.py
2904 2905 2906 2907 | |
update_connection
¶
update_connection(
new: str,
current: str | None = None,
auto_update: bool = True,
validate: bool = True,
ignore_case: bool = False,
) -> None
Update the connection properties of the Layer.
| PARAMETER | DESCRIPTION |
|---|---|
|
The new connection string.
TYPE:
|
|
The connection string to replace.
TYPE:
|
|
Update joins and relates.
TYPE:
|
|
Validate the Layer connection before setting it.
TYPE:
|
|
Ignore case in queries.
TYPE:
|
Source code in src/arcpie/project/elements.py
2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 | |
update_from_json
¶
Update the Layer using a WebBuilder json definition.
Source code in src/arcpie/project/elements.py
3011 3012 3013 3014 3015 | |
LayerConnectionConf
¶
Bases: TypedDict
| ATTRIBUTE | DESCRIPTION |
|---|---|
connection_info |
|
dataset |
TYPE:
|
workspace_factory |
TYPE:
|
Layout
¶
Layout(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: Element[Layout, CIMLayout, Project]
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
create_bookmark_mapseries |
Create a BookmarkMapseries for the Layout. |
create_map_frame |
Create a new MapFrame in the Layout. |
create_map_surround_element |
Create a new MapSurroundElement in the Layout. |
create_mapseries |
Create a spatial Mapseries for the Layout. |
create_table_frame_element |
Create a new TableFrameElement in the Layout. |
delete_element |
Delete an element from the Layout. |
delete_elements |
Delete multiple elements from the Layout (varargs). |
diff |
Generate a diff of two Layers using |
export |
Export the Layout. |
get_cim |
Get the CIM definition for the Element. |
open_view |
Open the Layout in the active Project. |
refresh |
Refresh all cached elements. |
resize |
Resize the Layout. |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
bookmark_mapseries |
The BookmarkMapseries for the Layout if it exists. (raises:
TYPE:
|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
color_model |
The Layout width in ColorModel.
TYPE:
|
elem |
|
elements |
ElementList of all LayoutElements in the Layout. (use other accessors for typed/filtered Elements.)
TYPE:
|
graphic_elements |
ElementList of all GraphicElements in the Layout.
TYPE:
|
group_elements |
ElementList of all GroupElements in the Layout.
TYPE:
|
has_bookmark_mapseries |
Determine if the Layout has a BookmarkMapseries.
TYPE:
|
has_mapseries |
Determine if the Layout has a spatial Mapseries.
TYPE:
|
height |
The Layout height in page units.
TYPE:
|
map_frames |
ElementList of all MapFrames in the Layout.
TYPE:
|
map_surround_elements |
ElementList of all MapSurroundElements in the Layout.
TYPE:
|
mapseries |
The spatial Mapseries for the Layout if it exists. (raises:
TYPE:
|
metadata |
The Layout Metadata.
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
picture_elements |
ElementList of all PictureElements in the Layout.
TYPE:
|
short_name |
A short name for the Element (
TYPE:
|
table_frame_elements |
ElementList of all TableFrameElements in the Layout.
TYPE:
|
text_elements |
ElementList of all TextElements in the Layout.
TYPE:
|
unique_name |
|
units |
The Layout page units.
TYPE:
|
uri |
|
width |
The Layout width in page units.
TYPE:
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
bookmark_mapseries
property
¶
bookmark_mapseries: BookmarkMapSeries
The BookmarkMapseries for the Layout if it exists. (raises: AttributeError)
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
elements
property
¶
elements: ElementList[LayoutElement[Any, Any]]
ElementList of all LayoutElements in the Layout. (use other accessors for typed/filtered Elements.)
graphic_elements
property
¶
graphic_elements: ElementList[GraphicElement]
ElementList of all GraphicElements in the Layout.
group_elements
property
¶
group_elements: ElementList[GroupElement]
ElementList of all GroupElements in the Layout.
has_bookmark_mapseries
property
¶
has_bookmark_mapseries: bool
Determine if the Layout has a BookmarkMapseries.
map_surround_elements
property
¶
map_surround_elements: ElementList[MapSurroundElement]
ElementList of all MapSurroundElements in the Layout.
mapseries
property
¶
mapseries: MapSeries
The spatial Mapseries for the Layout if it exists. (raises: AttributeError)
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
picture_elements
property
¶
picture_elements: ElementList[PictureElement]
ElementList of all PictureElements in the Layout.
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
table_frame_elements
property
¶
table_frame_elements: ElementList[TableFrameElement]
ElementList of all TableFrameElements in the Layout.
text_elements
property
¶
text_elements: ElementList[TextElement]
ElementList of all TextElements in the Layout.
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
create_bookmark_mapseries
¶
create_bookmark_mapseries(
frame: MapFrameLike,
bookmarks: Iterable[Bookmark]
| Iterable[Bookmark]
| None = None,
) -> BookmarkMapSeries
Create a BookmarkMapseries for the Layout.
| PARAMETER | DESCRIPTION |
|---|---|
|
The MapFrame to use for the BookmarkMapseries (must have Bookmarks).
TYPE:
|
|
The Bookmarks in the Map to use. (default: All)
TYPE:
|
Source code in src/arcpie/project/elements.py
3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 | |
create_map_frame
¶
create_map_frame(
*,
name: str | None = None,
map: MapLike | None = None,
geometry: Polygon | Point | HasCentroid | None = None,
) -> MapFrame
Create a new MapFrame in the Layout.
| PARAMETER | DESCRIPTION |
|---|---|
|
An anchor point or polygon shape for the MapFrame (using page units). (default:
TYPE:
|
|
The Map to associate the MapFrame with.
TYPE:
|
|
The name of the MapFrame element.
TYPE:
|
Notes
Use a Polygon created in Layout coordinates to specify an exact shape, or use a shape with a centroid to set the anchor point of the MapFrame. After creating the MapFrame, the anchor point, width, and height can be set directly. If no geometry is used, the MapFrame will be created at the Layout origin.
Source code in src/arcpie/project/elements.py
3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 | |
create_map_surround_element
¶
create_map_surround_element(
surround_type: MapSurroundType,
*,
name: str | None = None,
frame: MapFrameLike | None = None,
geometry: Polygon | Point | HasCentroid | None = None,
style_item: StyleItemLike | None = None,
) -> MapSurroundElement
Create a new MapSurroundElement in the Layout.
| PARAMETER | DESCRIPTION |
|---|---|
|
An optional name for the MapSurroundElement.
TYPE:
|
|
The MapSurroundElement type.
TYPE:
|
|
An anchor point or polygon shape for the MapSurroundElement (using page units). (default:
TYPE:
|
|
The MapFrame to associate the MapSurroundElement with.
TYPE:
|
|
A style item to use for the MapSurroundElement style.
TYPE:
|
Notes
Use a Polygon created in Layout coordinates to specify an exact shape, or use a shape with a centroid to set the anchor point of the MapSurroundElement. After creating the MapSurroundElement, the anchor point, width, and height can be set directly. If no geometry is used, the MapSurroundElement will be created at the Layout origin.
Source code in src/arcpie/project/elements.py
3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 | |
create_mapseries
¶
create_mapseries(
frame: MapFrameLike,
layer: LayerLike,
name_field: str,
sort_field: str | None = None,
) -> MapSeries
Create a spatial Mapseries for the Layout.
| PARAMETER | DESCRIPTION |
|---|---|
|
The MapFrame to use for the Mapseries.
TYPE:
|
|
The series layer in the MapFrame Map.
TYPE:
|
|
The field to use as the Mapseries page name.
TYPE:
|
|
The field to sorth the Maperies pages by (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 | |
create_table_frame_element
¶
create_table_frame_element(
*,
name: str | None = None,
frame: MapFrameLike | None = None,
table: LayerLike | TableLike | None = None,
fields: Iterable[str] | None = None,
geometry: Point | Polygon | HasCentroid | None = None,
style_item: StyleItemLike | None = None,
) -> TableFrameElement
Create a new TableFrameElement in the Layout.
| PARAMETER | DESCRIPTION |
|---|---|
|
An optional name for the TableFrameElement.
TYPE:
|
|
An anchor point or polygon shape for the TableFrameElement (using page units). (default:
TYPE:
|
|
The MapFrame to associate the TableFrameElement with.
TYPE:
|
|
The Table or Layer in the MapFrame to use as the TableFrameElement source. |
|
A list of fields to include in the TableFrameElement. |
|
A style item to use for the TableFrameElement style.
TYPE:
|
Notes
Use a Polygon created in Layout coordinates to specify an exact shape, or use a shape with a centroid to set the anchor point of the TableFrameElement. After creating the TableFrameElement, the anchor point, width, and height can be set directly. If no geometry is used, the TableFrameElement will be created at the Layout origin.
Source code in src/arcpie/project/elements.py
3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 | |
delete_element
¶
delete_element(
elem: LayoutElement[LayoutElement, Any] | LayoutElement,
)
Delete an element from the Layout.
Source code in src/arcpie/project/elements.py
3662 3663 3664 3665 3666 | |
delete_elements
¶
delete_elements(
*elems: LayoutElement[LayoutElement, Any]
| LayoutElement,
) -> None
Delete multiple elements from the Layout (varargs).
Source code in src/arcpie/project/elements.py
3668 3669 3670 3671 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
export
¶
export(
format: Format | ExportFormat | Format,
*,
outfile: None = None,
antialiasing: Antialiasing | None = ...,
) -> bytes
export(
format: Format | ExportFormat | Format,
*,
outfile: Path | str | None = None,
antialiasing: Antialiasing | None = None,
) -> Path | bytes
Export the Layout.
| PARAMETER | DESCRIPTION |
|---|---|
|
A Format object or a string format (string option will use defaults)
TYPE:
|
|
An optional output file location to use (will override format filePath) |
|
Antialiasing options for the output file
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Path
|
If outfile is set |
bytes
|
If outfile is unset |
Source code in src/arcpie/project/elements.py
3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
open_view
¶
open_view()
Open the Layout in the active Project.
Source code in src/arcpie/project/elements.py
3752 3753 3754 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
resize
¶
resize(
width: float | None = None,
height: float | None = None,
resize_elements: bool = True,
) -> None
Resize the Layout.
| PARAMETER | DESCRIPTION |
|---|---|
|
The new Layout width.
TYPE:
|
|
The new Layout height.
TYPE:
|
|
Resize all child elements to maintain scale. (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
LayoutElement
¶
LayoutElement(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: Element[MPElem, CIM, Layout]
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
delete |
Delete the LayuoutElement from its parent Layout (if it has one). |
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
move |
Shift the element by the provided x/y deltas. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
anchor |
LayoutElement anchor point.
TYPE:
|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
elem |
|
group |
GroupElement the LayoutElement belongs to if it exists.
TYPE:
|
height |
LayoutElement height in page units.
TYPE:
|
locked |
The editability state of the LayoutElement.
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
rotation |
LayoutElement rotation in degrees. (
TYPE:
|
short_name |
A short name for the Element (
TYPE:
|
type |
The string name for the LayoutElement type.
TYPE:
|
unique_name |
|
uri |
|
visible |
Visibility state for the LayoutElement.
TYPE:
|
width |
LayoutElement width in page units.
TYPE:
|
x |
The X position of the LayoutElement anchor point in page units.
TYPE:
|
y |
The Y position of the LayoutElement anchor point in page units.
TYPE:
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
rotation
property
writable
¶
rotation: float
LayoutElement rotation in degrees. (TableFrameElements cannot be rotated)
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
delete
¶
delete() -> None
Delete the LayuoutElement from its parent Layout (if it has one).
Source code in src/arcpie/project/elements.py
4944 4945 4946 4947 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
move
¶
Shift the element by the provided x/y deltas.
Source code in src/arcpie/project/elements.py
4949 4950 4951 4952 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
LegendElement
¶
LegendElement(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: LayoutElement[LegendElement, CIMLegend]
-
Modules
Project
GroupElementlegend_elements
-
Modules
Project
LegendItem
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
add_item |
Add a Layer to the Legend. |
apply_style |
Apply a |
delete |
Delete the LayuoutElement from its parent Layout (if it has one). |
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
move |
Shift the element by the provided x/y deltas. |
move_item |
Move a LegendItem to a different location in the LegendElement. |
refresh |
Refresh all cached elements. |
remove_item |
Remove a LegedItem from the LegendElement. |
set_cim |
Set a CIM definition for an Element set |
sync |
Set sync properties for the LegendElement. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
anchor |
LayoutElement anchor point.
TYPE:
|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
columns |
The number of columns in the Legend.
TYPE:
|
elem |
|
fitting_strategy |
The fitting strategy of the LegendElement.
TYPE:
|
group |
GroupElement the LayoutElement belongs to if it exists.
TYPE:
|
has_map_frame |
Determine if the LegendElement has an associated MapFrame.
TYPE:
|
height |
LayoutElement height in page units.
TYPE:
|
items |
ElementList of LegendItems in the LegendElement.
TYPE:
|
locked |
The editability state of the LayoutElement.
TYPE:
|
map |
TYPE:
|
map_frame |
Get the MapFrame associated with the LegendElement. (raises:
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
overflowing |
Determine if the LegendElement is overflowing its bounds.
TYPE:
|
parent |
|
rotation |
LayoutElement rotation in degrees. (
TYPE:
|
short_name |
A short name for the Element (
TYPE:
|
show_title |
Title visibility state of the LegendElement.
TYPE:
|
sync_new |
Add new Layers to the LegendElement when they are added to the Map.
TYPE:
|
sync_order |
TYPE:
|
sync_scale |
Sync the reference scale of the LegendElement with the Map reference scale.
TYPE:
|
sync_visibility |
Sync legend visibility with Map Layer visibility.
TYPE:
|
title |
The title of the LegendElement.
TYPE:
|
type |
The string name for the LayoutElement type.
TYPE:
|
unique_name |
|
uri |
|
visible |
Visibility state for the LayoutElement.
TYPE:
|
width |
LayoutElement width in page units.
TYPE:
|
x |
The X position of the LayoutElement anchor point in page units.
TYPE:
|
y |
The Y position of the LayoutElement anchor point in page units.
TYPE:
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
fitting_strategy
property
writable
¶
fitting_strategy: LegendFittingStrategy
The fitting strategy of the LegendElement.
has_map_frame
property
¶
has_map_frame: bool
Determine if the LegendElement has an associated MapFrame.
items
property
¶
items: ElementList[LegendItem]
ElementList of LegendItems in the LegendElement.
Items can be mutated directly to update them. No need or ability to set this.
map_frame
property
writable
¶
map_frame: MapFrame
Get the MapFrame associated with the LegendElement. (raises: AttributeError)
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
rotation
property
writable
¶
rotation: float
LayoutElement rotation in degrees. (TableFrameElements cannot be rotated)
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
sync_new
property
writable
¶
sync_new: bool
Add new Layers to the LegendElement when they are added to the Map.
sync_scale
property
writable
¶
sync_scale: bool
Sync the reference scale of the LegendElement with the Map reference scale.
sync_visibility
property
writable
¶
sync_visibility: bool
Sync legend visibility with Map Layer visibility.
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
add_item
¶
add_item(
layer: LayerLike, position: AddPosition = 'TOP'
) -> LegendItem
Add a Layer to the Legend.
| PARAMETER | DESCRIPTION |
|---|---|
|
A Layer to add to the Legend.
TYPE:
|
|
The position to add the layer in. (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 | |
apply_style
¶
apply_style(style_item: StyleItemLike)
Apply a LEGEND style item to the LegendElement.
Source code in src/arcpie/project/elements.py
5241 5242 5243 5244 5245 5246 | |
delete
¶
delete() -> None
Delete the LayuoutElement from its parent Layout (if it has one).
Source code in src/arcpie/project/elements.py
4944 4945 4946 4947 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
move
¶
Shift the element by the provided x/y deltas.
Source code in src/arcpie/project/elements.py
4949 4950 4951 4952 | |
move_item
¶
move_item(
reference: LegendItemLike,
item: LegendItemLike,
position: MovePosition = 'BEFORE',
)
Move a LegendItem to a different location in the LegendElement.
| PARAMETER | DESCRIPTION |
|---|---|
|
The reference LegendItem to move the item relative to.
TYPE:
|
|
The LegendItem to move.
TYPE:
|
|
Where to move the item relative to the reference. (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
remove_item
¶
remove_item(item: LegendItemLike) -> None
Remove a LegedItem from the LegendElement.
Source code in src/arcpie/project/elements.py
5223 5224 5225 5226 5227 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
sync
¶
sync(
*on: Literal['visibility', 'new', 'scale', 'order'],
) -> None
Set sync properties for the LegendElement.
Note
Any properties not explicitly passed to this method will be disabled.
Source code in src/arcpie/project/elements.py
5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 | |
LegendItem
¶
LegendItem(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: Element[LegendItem, CIMLegendItem, LegendElement]
-
Modules
Project
LegendElement
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
apply_style |
Apply a |
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
show_visibleure_count |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
arrangement |
The patch/description/label arrangement order for the LegendItem.
TYPE:
|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
column |
TYPE:
|
elem |
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
patch_height |
The patch height of the LayoutItem in points.
TYPE:
|
patch_width |
The patch width of the LayoutItem in points.
TYPE:
|
short_name |
A short name for the Element (
TYPE:
|
show_feature_count |
TYPE:
|
show_visible |
TYPE:
|
unique_name |
|
uri |
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
arrangement
property
writable
¶
arrangement: LegendItemArrangement
The patch/description/label arrangement order for the LegendItem.
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
apply_style
¶
apply_style(style_item: StyleItemLike) -> None
Apply a LEGEND_ITEM style to the LegendItem.
Source code in src/arcpie/project/elements.py
5312 5313 5314 5315 5316 5317 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
Map
¶
Map(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: Element[Map, CIMMap, Project]
mp.Map wrapper that allows for simpler interacton with Maps.
Example:
>>> my_map = prj.maps['My Map$'].unwrap()
>>> my_map.layers
[Layer(Lay 1), Layer(Lay 2), ....]
>>> lay2 = my_map.layers['2$'].unwrap()
>>> lay1 = my_map.layers['1$'].unwrap()
>>> my_map.move_layer(lay1, lay2, 'AFTER')
>>> my_map.layers
[Layer(Lay 2), Layer(Lay 1), ....]
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
add_basemap |
Add a basemap to the Map using the string name from |
add_data |
Add data to the map from a path or URL. |
add_layer |
Add a layer/table object to the map at the provided position. |
add_table |
Add a Table to the Map. |
clear_selection |
Clear all selections in the Map. |
clip_to |
Clip all layers in the map to the footprint of the input layer |
copy_bookmark |
Make a copy of the Bookmark with an optional new name. |
create_graphics_layer |
Create a GraphicsLayer in the Map with the provided name |
create_group |
Create a new GroupLayer in the Map. |
diff |
Generate a diff of two Layers using |
export_bkmx |
Export the Map's |
export_mapx |
Export the Map's |
filter |
|
filter_by_type |
|
filter_groups |
Filter Layers using a predicate function. |
filter_layers |
Filter Layers using a predicate function. |
filter_tables |
Filter Tables using a predicate function. |
get_cim |
Get the CIM definition for the Element. |
import_bkmx |
Import Bookmarks from a |
layers_by_type |
Matched layers must be of all provided types (or none of provided types if inverted) |
move_layer |
Move a layer to a position ( |
open_view |
|
refresh |
Refresh all cached elements. |
remove |
Remove a Map Element. (Layer/Table/Bookmark) |
set_cim |
Set a CIM definition for an Element set |
update_connection |
Update data connections in the Map. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
all_layers |
Get all Layers in the Map (including GroupLayers and broken Layers).
TYPE:
|
bkmx |
Get the
TYPE:
|
bkmx_dict |
Get the |
broken_layers |
Get all broken Layers in the Map.
TYPE:
|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
camera |
Get the Map camera.
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
color_model |
Get the current Map ColorModel. (
TYPE:
|
default_view |
TYPE:
|
elem |
|
excluded_from_clipping |
Get all Layers in the Map that are excluded from clipping.
TYPE:
|
group_layers |
Get all GroupLayers in the Map.
TYPE:
|
layers |
Get all Layers in the Map (excluding GroupLayers and broken Layers).
TYPE:
|
map_type |
Get the type of the Map. (
TYPE:
|
mapx |
Get the
TYPE:
|
mapx_dict |
Get the |
metadata |
Get the Metadata for the Map.
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
scale |
Get the current reference scale of the Map.
TYPE:
|
short_name |
A short name for the Element (
TYPE:
|
spatial_reference |
Get the SpatialReference of the Map (or
TYPE:
|
tables |
Get all Tables in the Map.
TYPE:
|
transformations |
Get a mapping of all transformations present in the Map. |
unique_name |
|
units |
Get the name of the current Map's units.
TYPE:
|
uri |
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
all_layers
property
¶
all_layers: ElementList[Layer]
Get all Layers in the Map (including GroupLayers and broken Layers). By default this is cached on first access.
broken_layers
property
¶
broken_layers: ElementList[Layer]
Get all broken Layers in the Map. By default this is cached on first access.
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
excluded_from_clipping
property
writable
¶
excluded_from_clipping: ElementList[Layer]
Get all Layers in the Map that are excluded from clipping.
group_layers
property
¶
group_layers: ElementList[GroupLayer]
Get all GroupLayers in the Map. By default this is cached on first access.
layers
property
¶
layers: ElementList[Layer]
Get all Layers in the Map (excluding GroupLayers and broken Layers). By default this is cached on first access.
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
spatial_reference
property
writable
¶
spatial_reference: SpatialReference
Get the SpatialReference of the Map (or Map._default_reference).
tables
property
¶
tables: ElementList[Table]
Get all Tables in the Map. By default this is cached on first access.
transformations
property
writable
¶
Get a mapping of all transformations present in the Map.
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
add_basemap
¶
Add a basemap to the Map using the string name from Project.basemaps or a Layer object.
Source code in src/arcpie/project/elements.py
1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 | |
add_data
¶
add_data(
path: FeatureClass,
service_type: WebServiceType = ...,
**params: Any,
) -> Layer
add_data(
path: FeatureClass | Table | Path | str,
service_type: WebServiceType = 'AUTOMATIC',
**params: Any,
) -> Layer | Table
Add data to the map from a path or URL.
| PARAMETER | DESCRIPTION |
|---|---|
|
A filepath or URL for the data element
TYPE:
|
|
An optional agument for web service type (default:
TYPE:
|
|
Additional keyword parameters passed to the webservice (optional)
TYPE:
|
Source code in src/arcpie/project/elements.py
2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 | |
add_layer
¶
add_layer(
layer: LayerLike,
*,
before: LayerLike | None = ...,
after: LayerLike | None = ...,
position: AddPosition = ...,
group: GroupLayerLike | None = ...,
) -> Layer
add_layer(
layer: GroupLayer,
*,
before: LayerLike | None = ...,
after: LayerLike | None = ...,
position: AddPosition = ...,
group: GroupLayerLike | None = ...,
) -> GroupLayer
add_layer(
layer: LayerLike | GroupLayerLike,
*,
before: LayerLike | None = None,
after: LayerLike | None = None,
position: AddPosition = 'AUTO_ARRANGE',
group: GroupLayerLike | None = None,
) -> Layer | GroupLayer
Add a layer/table object to the map at the provided position.
| PARAMETER | DESCRIPTION |
|---|---|
|
The layer or table object to add (either arcpie or arcpy versions will work)
TYPE:
|
|
Insert the layer before this layer
TYPE:
|
|
Insert the layer after this layer
TYPE:
|
|
The position in the contents pane to add the layer to (default:
TYPE:
|
|
An optional GroupLayer to add the new layer to
TYPE:
|
Note
before, after, and group + position are exclusive.
before takes precedence over all other arguments followed by after, then position and group
Source code in src/arcpie/project/elements.py
1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 | |
add_table
¶
add_table(
table: TableLike, *, group: GroupLayerLike | None = None
) -> Table
Add a Table to the Map.
| PARAMETER | DESCRIPTION |
|---|---|
|
The table to add.
TYPE:
|
|
An optional GroupLayer to add the Table to.
TYPE:
|
Source code in src/arcpie/project/elements.py
1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 | |
clear_selection
¶
clear_selection() -> None
Clear all selections in the Map.
Source code in src/arcpie/project/elements.py
1972 1973 1974 | |
clip_to
¶
Clip all layers in the map to the footprint of the input layer
| PARAMETER | DESCRIPTION |
|---|---|
|
The Layer to clip to.
TYPE:
|
|
Clip only to the selected features. (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 | |
copy_bookmark
¶
copy_bookmark(
bookmark: BookmarkLike, name: str | None = None
) -> Bookmark
Make a copy of the Bookmark with an optional new name.
Source code in src/arcpie/project/elements.py
1976 1977 1978 1979 | |
create_graphics_layer
¶
Create a GraphicsLayer in the Map with the provided name
Source code in src/arcpie/project/elements.py
1968 1969 1970 | |
create_group
¶
create_group(
name: str, *, parent: GroupLayerLike | None = None
) -> GroupLayer
Create a new GroupLayer in the Map.
| PARAMETER | DESCRIPTION |
|---|---|
|
The name of the new GroupLayer.
TYPE:
|
|
An optional parent group for the new layer.
TYPE:
|
Source code in src/arcpie/project/elements.py
1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
export_bkmx
¶
Export the Map's bkmx data to a file.
Source code in src/arcpie/project/elements.py
2039 2040 2041 2042 2043 2044 | |
export_mapx
¶
Export the Map's mapx representation to a file.
Source code in src/arcpie/project/elements.py
2032 2033 2034 2035 2036 2037 | |
filter
¶
filter(
pred: Callable[[Layer | Table | GroupLayer], bool],
) -> ElementList[Layer | Table | GroupLayer]
Source code in src/arcpie/project/elements.py
2056 2057 | |
filter_by_type
¶
filter_by_type(
include: Iterable[LayerType] | None = None,
exclude: Iterable[LayerType] | None = None,
) -> ElementList[Layer]
Source code in src/arcpie/project/elements.py
1850 1851 1852 1853 1854 1855 | |
filter_groups
¶
filter_groups(
pred: Callable[[GroupLayer], bool],
) -> ElementList[GroupLayer]
Filter Layers using a predicate function.
Source code in src/arcpie/project/elements.py
2067 2068 2069 | |
filter_layers
¶
filter_layers(
pred: Callable[[Layer], bool],
) -> ElementList[Layer]
Filter Layers using a predicate function.
Source code in src/arcpie/project/elements.py
2059 2060 2061 | |
filter_tables
¶
filter_tables(
pred: Callable[[Table], bool],
) -> ElementList[Table]
Filter Tables using a predicate function.
Source code in src/arcpie/project/elements.py
2063 2064 2065 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
import_bkmx
¶
Import Bookmarks from a bkmx file.
Source code in src/arcpie/project/elements.py
2046 2047 2048 2049 2050 2051 2052 2053 2054 | |
layers_by_type
¶
layers_by_type(
*types: LayerType, invert: bool = False
) -> ElementList[Layer]
Matched layers must be of all provided types (or none of provided types if inverted)
Source code in src/arcpie/project/elements.py
1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 | |
move_layer
¶
move_layer(
layer: LayerLike | GroupLayerLike,
reference: LayerLike | GroupLayerLike,
position: MovePosition = 'BEFORE',
) -> None
Move a layer to a position (BEFORE/AFTER) relative to the reference Layer.
Source code in src/arcpie/project/elements.py
1915 1916 1917 1918 1919 | |
open_view
¶
open_view() -> None
Source code in src/arcpie/project/elements.py
2071 2072 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
remove
¶
remove(child: LayerLike | TableLike | BookmarkLike) -> None
Remove a Map Element. (Layer/Table/Bookmark)
Source code in src/arcpie/project/elements.py
1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
update_connection
¶
update_connection(
new: Path | str,
current: Path | str | None = None,
auto_update: bool = True,
validate: bool = True,
ignore_case: bool = False,
) -> None
Update data connections in the Map.
| PARAMETER | DESCRIPTION |
|---|---|
|
The new connection path. |
|
The current connection path. |
|
Update all existing joins and relates.
TYPE:
|
|
Only complete the connection change if the new path is valid.
TYPE:
|
|
Ignore case in queries.
TYPE:
|
Source code in src/arcpie/project/elements.py
1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 | |
MapFrame
¶
MapFrame(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: Element[MapFrame, CIMMapFrame, Layout]
- Modules Project
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
add_grid |
Add a grid or graticule to the MapFrame. |
convert_grid |
Convert a MapFrame grid into real geometry in the associated Map. |
create_bookmark |
|
diff |
Generate a diff of two Layers using |
export |
Export the MapFrame. (wrapper for |
get_cim |
Get the CIM definition for the Element. |
layer_extent |
Get the extent of a layer within the MapFrame view. |
pan_to |
Pan the MapFrame view to an object or extent. |
refresh |
Refresh all cached elements. |
remove_grids |
Remove grids from the MapFrame. |
set_cim |
Set a CIM definition for an Element set |
zoom_all |
Zoom the MapFrame to fit all Map layers. |
zoom_to |
Zoom the MapFrame to a Layer/Bookmark/Extent (or extent having object). |
| ATTRIBUTE | DESCRIPTION |
|---|---|
alt_text |
The hover text for the MapFrame.
TYPE:
|
anchor |
The anchor point of the MapFrame.
TYPE:
|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
camera |
The current camera of the MapFrame.
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
elem |
|
has_map |
Check if the MapFrame has an associated Map
TYPE:
|
height |
The height of the MapFrame in page units.
TYPE:
|
in_group |
Determine if the MapFrame is part of a GroupElement.
TYPE:
|
locked |
Editability status of the MapFrame in the Layout.
TYPE:
|
map |
The Map associated with the MapFrame.
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
parent_group |
The GroupElement the MapFrame is a child of if it exists. (raises:
TYPE:
|
rotation |
The rotation of the MapFrame in degrees (use
TYPE:
|
short_name |
A short name for the Element (
TYPE:
|
unique_name |
|
uri |
|
visible |
Visibility state of the MapFrame in the Layout.
TYPE:
|
width |
The width of the MapFrame in page units.
TYPE:
|
x |
TYPE:
|
y |
The Y coordinate of the anchor point in page units.
TYPE:
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
parent_group
property
¶
parent_group: GroupElement
The GroupElement the MapFrame is a child of if it exists. (raises: AttributeError)
rotation
property
writable
¶
rotation: float
The rotation of the MapFrame in degrees (use camera.heading for view rotation).
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
add_grid
¶
add_grid(style_item: StyleItemLike)
Add a grid or graticule to the MapFrame.
| PARAMETER | DESCRIPTION |
|---|---|
|
The style item to create the grid with (must be a
TYPE:
|
Source code in src/arcpie/project/elements.py
3875 3876 3877 3878 3879 3880 3881 3882 | |
convert_grid
¶
Convert a MapFrame grid into real geometry in the associated Map.
| PARAMETER | DESCRIPTION |
|---|---|
|
The name of the grid to export.
TYPE:
|
|
The geodatabase to export the grid features to. |
|
The name of the group layer that the features will be added to (default: grid name).
TYPE:
|
Source code in src/arcpie/project/elements.py
3892 3893 3894 3895 3896 3897 3898 3899 3900 | |
create_bookmark
¶
Source code in src/arcpie/project/elements.py
3902 3903 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
export
¶
export(
format: Format | ExportFormat | Format,
*,
outfile: None = None,
antialiasing: Antialiasing | None = ...,
) -> bytes
export(
format: Format | ExportFormat | Format,
*,
outfile: Path | str | None = None,
antialiasing: Antialiasing | None = None,
) -> Path | bytes
Export the MapFrame. (wrapper for MapView.export)
| PARAMETER | DESCRIPTION |
|---|---|
|
A Format object or a string format (string option will use defaults)
TYPE:
|
|
An optional output file location to use (will override format filePath) |
|
Antialiasing options for the output file
TYPE:
|
Source code in src/arcpie/project/elements.py
3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
layer_extent
¶
Get the extent of a layer within the MapFrame view.
| PARAMETER | DESCRIPTION |
|---|---|
|
The layer to get an extent for (must be in MapFrame map).
TYPE:
|
|
Get the extent of selected features only.
TYPE:
|
|
Get the extent of symbology at current scale, not real shape.
TYPE:
|
Source code in src/arcpie/project/elements.py
3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 | |
pan_to
¶
Pan the MapFrame view to an object or extent.
Source code in src/arcpie/project/elements.py
3976 3977 3978 3979 3980 3981 3982 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
remove_grids
¶
Remove grids from the MapFrame.
| PARAMETER | DESCRIPTION |
|---|---|
|
A wildcard string that uses the Grid name in the contents pane.
TYPE:
|
Source code in src/arcpie/project/elements.py
3884 3885 3886 3887 3888 3889 3890 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
zoom_all
¶
zoom_all(
selected: bool = True, symbolized: bool = True
) -> None
Zoom the MapFrame to fit all Map layers.
| PARAMETER | DESCRIPTION |
|---|---|
|
Zoom to the extent of the selected features only.
TYPE:
|
|
Zoom to the extent of the Layer symbologies.
TYPE:
|
Source code in src/arcpie/project/elements.py
3984 3985 3986 3987 3988 3989 3990 3991 | |
zoom_to
¶
zoom_to(elem: LayerLike | BookmarkLike | HasExtent) -> None
Zoom the MapFrame to a Layer/Bookmark/Extent (or extent having object).
Source code in src/arcpie/project/elements.py
3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 | |
MapSeries
¶
MapSeries(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: Element[MapSeries, CIMMapSeries, Layout]
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__iter__ |
|
__len__ |
|
__repr__ |
|
diff |
Generate a diff of two Layers using |
export |
Export the MapSeries. |
get_cim |
Get the CIM definition for the Element. |
refresh |
Refresh all cached elements. |
reload |
Refresh/Reload the mapseries (refresh is shadowed by Element cache control) |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
clip_to_features |
Determine if the MapSeries will clip features to the MapFrame.
TYPE:
|
current_page_name |
The name of the current MapSeries page.
TYPE:
|
current_page_number |
The number of the current MapSeries page. |
elem |
|
enabled |
Determine if the MapSeries is enabled.
TYPE:
|
features |
A mapping of page numbers (strings) to feature records. |
layer |
The sereies Layer for the MapSeries
TYPE:
|
map_frame |
The target MapFrame for the MapSeries.
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
Name override for MapSeries, set the name with
TYPE:
|
page_count |
Total pages in the MapSeries.
TYPE:
|
page_map |
A mapping of all page numbers to page names. |
page_name_field |
The name field for the MapSeries.
TYPE:
|
page_names |
String values for all page names in the MapSeries. |
page_numbers |
String values for all page numbers in the MapSeries. |
page_range |
A range object representing the page numbers (e.g. 10 pages ==
TYPE:
|
page_row |
Return a dictionary representing the current map page feature. |
parent |
|
short_name |
A short name for the Element (
TYPE:
|
unique_name |
|
uri |
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
clip_to_features
property
writable
¶
clip_to_features: bool
Determine if the MapSeries will clip features to the MapFrame.
current_page_number
property
¶
The number of the current MapSeries page.
features
property
¶
A mapping of page numbers (strings) to feature records.
page_numbers
property
¶
String values for all page numbers in the MapSeries.
page_range
property
¶
page_range: range
A range object representing the page numbers (e.g. 10 pages == range(1, 11))
page_row
property
¶
Return a dictionary representing the current map page feature.
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__iter__
¶
Source code in src/arcpie/project/elements.py
4267 4268 4269 4270 4271 4272 4273 4274 4275 | |
__len__
¶
__len__() -> int
Source code in src/arcpie/project/elements.py
4277 4278 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
4280 4281 4282 4283 4284 4285 4286 4287 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
export
¶
export(
format: _MSFormat | _MSFormatAlt | _MSFormatName,
*,
out: None = None,
antialiasing: Antialiasing | None = ...,
mapseries_options: MapSeriesExportOptions | None = ...,
custom_pages: str | None = ...,
multi_file: bool = ...,
export_pages: ExportPages = ...,
print_count: bool = ...,
) -> tuple[bytes, ...]
export(
format: _MSFormat | _MSFormatAlt | _MSFormatName,
*,
out: Path | str = ...,
antialiasing: Antialiasing | None = ...,
mapseries_options: MapSeriesExportOptions | None = ...,
custom_pages: str | None = ...,
multi_file: bool = ...,
export_pages: ExportPages = ...,
print_count: bool = ...,
) -> tuple[Path, ...]
export(
format: _MSFormat | _MSFormatAlt | _MSFormatName,
*,
out: Path | str | None = None,
antialiasing: Antialiasing | None = None,
mapseries_options: MapSeriesExportOptions | None = None,
custom_pages: str | None = None,
multi_file: bool = False,
export_pages: ExportPages = 'ALL',
prefix: str | None = None,
print_count: bool = False,
) -> tuple[Path, ...] | tuple[bytes, ...]
Export the MapSeries.
| PARAMETER | DESCRIPTION |
|---|---|
|
A string name for the output format or a Formatter object.
TYPE:
|
|
An optional output file for the export. |
|
Antialiazing level for the export.
TYPE:
|
|
MapSeriesExportOptions object (additional kwargs will set this too.)
TYPE:
|
|
An optional custom page range string for the export.
TYPE:
|
|
Export the mapseries as multiple files (one per page).
TYPE:
|
|
Page export type (All, Current, Selected, etc.)
TYPE:
|
|
A prefix to add to the output files.
TYPE:
|
|
When exporting with
TYPE:
|
Source code in src/arcpie/project/elements.py
4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
reload
¶
reload() -> None
Refresh/Reload the mapseries (refresh is shadowed by Element cache control)
Source code in src/arcpie/project/elements.py
4263 4264 4265 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
MapSurroundElement
¶
MapSurroundElement(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: LayoutElement[MapSurroundElement, CIMMapSurround]
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
apply_style |
Apply a |
delete |
Delete the LayuoutElement from its parent Layout (if it has one). |
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
move |
Shift the element by the provided x/y deltas. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
anchor |
LayoutElement anchor point.
TYPE:
|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
elem |
|
group |
GroupElement the LayoutElement belongs to if it exists.
TYPE:
|
height |
LayoutElement height in page units.
TYPE:
|
locked |
The editability state of the LayoutElement.
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
rotation |
LayoutElement rotation in degrees. (
TYPE:
|
short_name |
A short name for the Element (
TYPE:
|
type |
The string name for the LayoutElement type.
TYPE:
|
unique_name |
|
uri |
|
visible |
Visibility state for the LayoutElement.
TYPE:
|
width |
LayoutElement width in page units.
TYPE:
|
x |
The X position of the LayoutElement anchor point in page units.
TYPE:
|
y |
The Y position of the LayoutElement anchor point in page units.
TYPE:
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
rotation
property
writable
¶
rotation: float
LayoutElement rotation in degrees. (TableFrameElements cannot be rotated)
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
apply_style
¶
apply_style(style_item: StyleItemLike) -> None
Apply a MAP_SURROUND StyleItem to the MapSurroundElement.
Source code in src/arcpie/project/elements.py
4957 4958 4959 4960 4961 4962 | |
delete
¶
delete() -> None
Delete the LayuoutElement from its parent Layout (if it has one).
Source code in src/arcpie/project/elements.py
4944 4945 4946 4947 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
move
¶
Shift the element by the provided x/y deltas.
Source code in src/arcpie/project/elements.py
4949 4950 4951 4952 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
MapView
¶
MapView(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: Element[MapView, CIMMapView, Project]
- Modules Project
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
create_bookmark |
Create a new Bookmark from the current MapView |
diff |
Generate a diff of two Layers using |
export |
Export the MapView. |
get_cim |
Get the CIM definition for the Element. |
layer_extent |
Get the Extent for a Layer in the MapView. |
pan_to |
Pan the MapView to an Extent/Layer/Polygon. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
zoom_all |
Zoom the MapView to all layers. |
zoom_to |
Zoom the MapView to a Layer or Bookmark. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
camera |
Get the camera of the MapView
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
elem |
|
extent |
Get the current extent of the MapView camera
TYPE:
|
map |
Get the Map that the MapView is associated with (parent is actually Project)
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
short_name |
A short name for the Element (
TYPE:
|
unique_name |
|
uri |
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
map
property
¶
map: Map
Get the Map that the MapView is associated with (parent is actually Project)
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
create_bookmark
¶
create_bookmark(
name: str | None = None, description: str | None = None
) -> Bookmark
Create a new Bookmark from the current MapView
| PARAMETER | DESCRIPTION |
|---|---|
|
An optional name of the Bookmark. (default:
TYPE:
|
|
An optional description for the Bookmark.
TYPE:
|
Source code in src/arcpie/project/elements.py
2160 2161 2162 2163 2164 2165 2166 2167 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
export
¶
export(
format: Format | ExportFormat | Format,
*,
outfile: None = None,
antialiasing: Antialiasing | None = ...,
) -> bytes
export(
format: Format | ExportFormat | Format,
*,
outfile: Path | str | None = None,
antialiasing: Antialiasing | None = None,
) -> Path | bytes
Export the MapView.
| PARAMETER | DESCRIPTION |
|---|---|
|
A Format object or a string format (string option will use defaults)
TYPE:
|
|
An optional output file location to use (will override format filePath) |
|
Antialiasing options for the output file
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Path
|
If outfile is set |
bytes
|
If outfile is unset |
Source code in src/arcpie/project/elements.py
2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
layer_extent
¶
Get the Extent for a Layer in the MapView.
| PARAMETER | DESCRIPTION |
|---|---|
|
The layer to get an Extent for.
TYPE:
|
|
Get the extent for only the selected features in the View.
TYPE:
|
|
Consider symbology when getting the Extent.
TYPE:
|
Source code in src/arcpie/project/elements.py
2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 | |
pan_to
¶
Pan the MapView to an Extent/Layer/Polygon.
| PARAMETER | DESCRIPTION |
|---|---|
|
A Layer, Polygon, or Extent to pan to.
TYPE:
|
Source code in src/arcpie/project/elements.py
2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
zoom_all
¶
zoom_all(
selected: bool = True, symbolized: bool = True
) -> None
Zoom the MapView to all layers.
| PARAMETER | DESCRIPTION |
|---|---|
|
Zoom to only the selected features.
TYPE:
|
|
Consider symbology when zooming.
TYPE:
|
Source code in src/arcpie/project/elements.py
2194 2195 2196 2197 2198 2199 2200 2201 | |
zoom_to
¶
zoom_to(
elem: LayerLike | BookmarkLike | Extent | HasExtent,
) -> None
Zoom the MapView to a Layer or Bookmark.
| PARAMETER | DESCRIPTION |
|---|---|
|
The Layer or Bookmark to zoom to.
TYPE:
|
Source code in src/arcpie/project/elements.py
2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 | |
PageQuery
¶
PictureElement
¶
PictureElement(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: LayoutElement[PictureElement, CIMPictureGraphic]
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
delete |
Delete the LayuoutElement from its parent Layout (if it has one). |
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
move |
Shift the element by the provided x/y deltas. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
alt_text |
The hover text of the PictureElement.
TYPE:
|
anchor |
LayoutElement anchor point.
TYPE:
|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
elem |
|
group |
GroupElement the LayoutElement belongs to if it exists.
TYPE:
|
height |
LayoutElement height in page units.
TYPE:
|
image_data |
Get the raw bytes for the source image. Will work with URLs and local filepaths.
TYPE:
|
locked |
The editability state of the LayoutElement.
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
rotation |
LayoutElement rotation in degrees. (
TYPE:
|
short_name |
A short name for the Element (
TYPE:
|
source |
A string representation of the source image path. (filepath or URL)
TYPE:
|
type |
The string name for the LayoutElement type.
TYPE:
|
unique_name |
|
uri |
|
visible |
Visibility state for the LayoutElement.
TYPE:
|
width |
LayoutElement width in page units.
TYPE:
|
x |
The X position of the LayoutElement anchor point in page units.
TYPE:
|
y |
The Y position of the LayoutElement anchor point in page units.
TYPE:
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
image_data
property
¶
image_data: bytes
Get the raw bytes for the source image. Will work with URLs and local filepaths.
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
rotation
property
writable
¶
rotation: float
LayoutElement rotation in degrees. (TableFrameElements cannot be rotated)
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
source
property
writable
¶
source: str
A string representation of the source image path. (filepath or URL)
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
delete
¶
delete() -> None
Delete the LayuoutElement from its parent Layout (if it has one).
Source code in src/arcpie/project/elements.py
4944 4945 4946 4947 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
move
¶
Shift the element by the provided x/y deltas.
Source code in src/arcpie/project/elements.py
4949 4950 4951 4952 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
Project
¶
Bases: Element[ArcGISProject, CIMGISProject]
ArcGISProject wrapper
A wrapper for the mp.ArcGISProject class that converts all child elements to wrapped elements.
All methods of base object can be accessed using project.elem or directly called if they have
no implemented wrapper version.
Example
>>> prj = Project(...)
>>> prj.maps
[Map(Map 1), Map(Map 2)]
>>> with prj:
... prj.maps['Map 1'].unwrap().set_name('My Map')
>>> prj.reopen()
>>> prj.maps
[Map(My Map), Map(Map 2)]
| METHOD | DESCRIPTION |
|---|---|
__enter__ |
|
__eq__ |
|
__exit__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
add_database |
|
close |
Close the Project if is is open (cannot close |
close_views |
Close open views for a |
copy_item |
Create a copy of a Map/Layout/Report element in the Project |
create |
Create a new Project from scratch. |
create_graphic_element |
Create a new GraphicElement in the Project. |
create_group_element |
Create a new GroupElement in the Project. |
create_layout |
Create a new Layout in the Project. |
create_map |
Create a new Map in the Project. |
create_picture_element |
Create a new PictureElement in the Project. |
create_predefined_graphics_element |
Create a new GraphicElement in the Project using a predefined style. |
create_report |
Create a new Report in the Project. |
create_text_element |
Create a new TextElement in the Project. |
delete |
Delete the project. |
diff |
Generate a diff of two Layers using |
from_directory |
Create an aprx file from a previously unzipped directory (see: |
get_cim |
Get the CIM definition for the Element. |
import_document |
Import a document file into this project using |
import_mapx |
Import a |
import_mxd |
Import a |
import_pagx |
Import a |
import_rptx |
Import a |
open |
Open the project if it is not open (stores an |
read_cim_file |
Open the aprx and read a file inside it (useful for extracting images). |
refresh |
Refresh all cached elements. |
reopen |
Close and re-open a Project |
save |
Save the project. |
save_as |
Save a copy of the project |
set_cim |
Set a CIM definition for an Element set |
start |
Open the project using |
to_directory |
Unzip the aprx file to a target directory. |
update_connection |
Update a connection at the Project level |
| ATTRIBUTE | DESCRIPTION |
|---|---|
active_map |
The active map for the Project. Check for active map using
TYPE:
|
active_view |
The active map for the View. Check for active map using |
aprx |
Alias for
TYPE:
|
basemaps |
Get the basemap names for the Project |
cache |
|
cache_enabled |
|
children |
|
cim |
Load the CIM data from the
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
color_ramps |
Get the color ramps in the project
TYPE:
|
databases |
Get a list of all |
date_saved |
The datetime the project was last saved
TYPE:
|
default_database |
Get an
TYPE:
|
elem |
TYPE:
|
folder_connections |
A list of Folder Connections in the Project
TYPE:
|
has_active_map |
Check to see if the Project has an active map set
TYPE:
|
has_active_view |
Check to see if the Project has an active view set
TYPE:
|
home |
A
TYPE:
|
index |
|
is_current |
TYPE:
|
is_open |
TYPE:
|
is_read_only |
TYPE:
|
layouts |
An
TYPE:
|
maps |
An
TYPE:
|
metadata |
Get the metadata object for the Project
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The final path component of the Project file including the .aprx suffix
TYPE:
|
nodes |
TYPE:
|
parent |
|
path |
A
TYPE:
|
raw_nodes |
|
reports |
An
TYPE:
|
short_name |
A short name for the Element (
TYPE:
|
styles |
An
TYPE:
|
toolboxes |
A list of Toolboxes in the Project.
TYPE:
|
unique_name |
|
uri |
|
version |
A string representation of the ArcGIS Pro version the project was created/saved in
TYPE:
|
Source code in src/arcpie/project/elements.py
738 739 740 741 742 743 744 745 746 747 | |
active_map
property
¶
active_map: Map
The active map for the Project. Check for active map using has_active_map to avoid AttributeError
Raises:
AttributeError: If the Project has no active map
active_view
property
writable
¶
The active map for the View. Check for active map using has_active_view to avoid AttributeError
Raises:
AttributeError: If the Project has no active view
cim
property
writable
¶
cim: CIMGISProject
Load the CIM data from the GISProject.json file in the aprx zip directory
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
databases
property
¶
Get a list of all arcpie.Dataset objects in the Project.
By default these are cached on first load
default_database
property
writable
¶
default_database: Dataset
Get an arcpie.Dataset object for the default project database
folder_connections
property
writable
¶
folder_connections: list[FolderConf]
A list of Folder Connections in the Project
layouts
property
¶
layouts: ElementList[Layout]
An ElementList of Layouts in the Project.
By default this property is cached on first load
maps
property
¶
maps: ElementList[Map]
An ElementList of Maps in the Project.
By default this property is cached on first load
name
property
writable
¶
name: str
The final path component of the Project file including the .aprx suffix
reports
property
¶
reports: ElementList[Report]
An ElementList of Reports in the Project.
By default this property is cached on first load
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
styles
property
writable
¶
styles: ElementList[Style]
An ElementList of Styles in the Project.
By default this property is cached on first load
version
property
¶
version: str
A string representation of the ArcGIS Pro version the project was created/saved in
MAJOR.MINOR.PATCH
__enter__
¶
__enter__() -> Self
Source code in src/arcpie/project/elements.py
1562 1563 1564 1565 1566 1567 | |
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__exit__
¶
__exit__(
exc_type: type[BaseException] | None,
exc: BaseException | None,
tb: TracebackType | None,
) -> bool | None
Source code in src/arcpie/project/elements.py
1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
790 791 | |
add_database
¶
Source code in src/arcpie/project/elements.py
1556 1557 1558 1559 1560 | |
close
¶
close() -> None
Close the Project if is is open (cannot close CURRENT project)
Source code in src/arcpie/project/elements.py
773 774 775 776 777 778 779 780 781 | |
close_views
¶
Close open views for a CURRENT project
| PARAMETER | DESCRIPTION |
|---|---|
|
The type of views to close (default:
TYPE:
|
|
A wildcard string that will filter the on the view parent (Map/Report/Layout name)
TYPE:
|
Raises:
PermissionError: If the Project is not CURRENT
Source code in src/arcpie/project/elements.py
1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 | |
copy_item
¶
copy_item(
item: LayoutLike, name: str | None = ...
) -> Layout
copy_item(
item: ReportLike, name: str | None = ...
) -> Report
copy_item(
item: MapLike | LayoutLike | ReportLike,
name: str | None = None,
) -> Map | Layout | Report
Create a copy of a Map/Layout/Report element in the Project
| PARAMETER | DESCRIPTION |
|---|---|
|
The item to copy
TYPE:
|
|
The new name (default:
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If the element is not a Map/Layout/Report |
Source code in src/arcpie/project/elements.py
1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 | |
create
classmethod
¶
create(
path: Path | str,
name: str,
*,
home_folder: Path | str | None = None,
default_database: Path | str | None = None,
default_toolbox: Path | str | None = None,
create_parents: bool = True,
) -> Self
Create a new Project from scratch.
| PARAMETER | DESCRIPTION |
|---|---|
|
The target location for the project home folder. |
|
The name of the project aprx file.
TYPE:
|
|
An optional path to the project home folder. (default: |
|
An optional path to the project default database. (default: |
|
An optional path to the project default toolbox. (default: |
|
Create the parent directories for the Project if they don't exist. (default: )
TYPE:
|
Source code in src/arcpie/project/elements.py
1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 | |
create_graphic_element
¶
create_graphic_element(
container: LayoutLike | GroupElementLike,
geometry: Point | Polyline | Polygon | HasCentroid,
style_item: StyleItemLike | None = None,
name: str | None = None,
lock_aspect_ratio: bool = True,
) -> GraphicElement
Create a new GraphicElement in the Project.
| PARAMETER | DESCRIPTION |
|---|---|
|
A Layout or GroupElement to create the GraphicElement in.
TYPE:
|
|
A Point/Polygon/Polyline or Centroid having object to use as the graphic shape.
TYPE:
|
|
An optional style to apply to the GraphicElement.
TYPE:
|
|
An optional name to give the GraphicElement. (default:
TYPE:
|
|
Lock the element aspect ratio to prevent skewing. (default:
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the container element is not a |
Source code in src/arcpie/project/elements.py
1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 | |
create_group_element
¶
create_group_element(
container: LayoutLike | GroupElementLike,
elements: Iterable[
LayoutElement[LayoutElement, Any] | LayoutElement
],
name: str | None,
) -> GroupElement
Create a new GroupElement in the Project.
| PARAMETER | DESCRIPTION |
|---|---|
|
A Layout or GroupElement to create the GroupElement in.
TYPE:
|
|
An iterable of LayoutElements to include in the group.
TYPE:
|
|
An optional name to give the GroupElement. (default:
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the container element is not a |
Source code in src/arcpie/project/elements.py
1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 | |
create_layout
¶
Create a new Layout in the Project.
| PARAMETER | DESCRIPTION |
|---|---|
|
The Layout width in
TYPE:
|
|
The Layout height in
TYPE:
|
|
The Layout page units
TYPE:
|
|
An optional name for the Layout (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 | |
create_map
¶
Create a new Map in the Project.
| PARAMETER | DESCRIPTION |
|---|---|
|
An optional name for the Map (default:
TYPE:
|
|
The map type to create (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
1135 1136 1137 1138 1139 1140 1141 1142 | |
create_picture_element
¶
create_picture_element(
container: LayoutLike | GroupElementLike,
geometry: Point | Polyline | Polygon | HasCentroid,
image: Path | str | bytes,
image_extension: str | None = None,
name: str | None = None,
lock_aspect_ratio: bool = True,
) -> PictureElement
Create a new PictureElement in the Project.
| PARAMETER | DESCRIPTION |
|---|---|
|
A Layout or GroupElement to create the PictureElement in.
TYPE:
|
|
A Point/Polygon/Polyline or Centroid having object to use as the graphic shape.
TYPE:
|
|
A file path or raw bytes to use as the image. |
|
If passing raw image bytes, provide an extension (no dot) here. (default:
TYPE:
|
|
An optional name to give the PictureElement. (default:
TYPE:
|
|
Lock the element aspect ratio to prevent skewing. (default:
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the container element is not a |
Source code in src/arcpie/project/elements.py
1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 | |
create_predefined_graphics_element
¶
create_predefined_graphics_element(
container: LayoutLike | GroupElementLike,
geometry: Point | Polyline | Polygon | HasCentroid,
shape_type: ShapeType,
style_item: StyleItemLike | None = None,
name: str | None = None,
lock_aspect_ratio: bool = True,
) -> GraphicElement
Create a new GraphicElement in the Project using a predefined style.
| PARAMETER | DESCRIPTION |
|---|---|
|
A Layout or GroupElement to create the GraphicElement in.
TYPE:
|
|
A Point/Polygon/Polyline or Centroid having object to use as the graphic shape.
TYPE:
|
|
The predefined shape type to create (see: docs).
TYPE:
|
|
An optional style item that matches the geometry type provided to the
TYPE:
|
|
An optional name to give the TextElement. (default:
TYPE:
|
|
Lock the element aspect ratio to prevent skewing. (default:
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the container element is not a |
Source code in src/arcpie/project/elements.py
1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 | |
create_report
¶
create_report(
units: PageUnits,
margin: Literal['NORMAL', 'NARROW', 'MODERATE', 'WIDE'],
source: LayerLike | TableLike,
fields: Iterable[ReportFieldConf],
stats: Iterable[ReportStatConf],
name: str | None = None,
template: Literal[
'ATTR_LIST',
'ATTR_LIST_GROUP',
'BASIC_SUM',
'BASIC_SUM_GROUP',
'PAGE_PER_FEATURE',
] = 'ATTR_LIST',
styling: Literal[
'BLACK_AND_WHITE',
'COOL_TONES',
'WARM_TONES',
'NO_STYLING',
] = 'BLACK_AND_WHITE',
) -> Report
Create a new Report in the Project.
| PARAMETER | DESCRIPTION |
|---|---|
|
The Report page units.
TYPE:
|
|
The Report margin width.
TYPE:
|
|
The Report data source (Layer or Table). |
|
A list of dictonaries defining the Report fields.
TYPE:
|
|
A list of dictonaries defining the Report statistics.
TYPE:
|
|
An optional name for the Layout. (default:
TYPE:
|
|
The Report template. (default:
TYPE:
|
|
The Report color styling. (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 | |
create_text_element
¶
create_text_element(
container: LayoutLike | GroupElementLike,
geometry: Point | Polyline | Polygon | HasCentroid,
text_type: TextType,
text: str,
size: float | None = None,
font: str | None = None,
style: str | None = None,
style_item: StyleItemLike | None = None,
name: str | None = None,
lock_aspect_ratio: bool = True,
) -> TextElement
Create a new TextElement in the Project.
| PARAMETER | DESCRIPTION |
|---|---|
|
A Layout or GroupElement to create the TextElement in.
TYPE:
|
|
A Point/Polygon/Polyline or Centroid having object to use as the graphic shape.
TYPE:
|
|
The type of textbox to create.
TYPE:
|
|
The text to add to the text element.
TYPE:
|
|
The font size (in points) of the text.
TYPE:
|
|
The font face to use (must be installed at system level).
TYPE:
|
|
The font style to use (e.g. bold, italic). Options depend on selected font face.
TYPE:
|
|
An optional style item that matches the geometry type provided to the
TYPE:
|
|
An optional name to give the TextElement. (default:
TYPE:
|
|
Lock the element aspect ratio to prevent skewing. (default:
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the container element is not a |
Source code in src/arcpie/project/elements.py
1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 | |
delete
¶
delete(*, home_folder: bool = False) -> None
Delete the project.
| PARAMETER | DESCRIPTION |
|---|---|
|
If set, recursively delete the homeFolder (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
from_directory
classmethod
¶
Create an aprx file from a previously unzipped directory (see: Project.to_directory)
| PARAMETER | DESCRIPTION |
|---|---|
|
The source directory (see: |
|
The target |
Source code in src/arcpie/project/elements.py
1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
import_document
¶
import_document(
doc: Path | str | bytes,
*,
include_layout: bool = True,
reuse_existing_maps: bool = True,
log: bool = True,
extension: str | None = None,
) -> Layout | Map | Report
Import a document file into this project using ArcGISProject.importDocument.
| PARAMETER | DESCRIPTION |
|---|---|
|
The path to the document. ( |
|
Include layouts with
TYPE:
|
|
Reuse existing maps with
TYPE:
|
|
Log the import in the ImportLog. (default:
TYPE:
|
|
If using bytes as the source document, supply the file extension (no dot)
TYPE:
|
Source code in src/arcpie/project/elements.py
1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 | |
import_mapx
¶
Import a .mapx file. (see: Project.import_document)
Source code in src/arcpie/project/elements.py
1526 1527 1528 1529 1530 1531 1532 1533 1534 | |
import_mxd
¶
Import a .mxd file. (see: Project.import_document)
Source code in src/arcpie/project/elements.py
1536 1537 1538 1539 1540 1541 1542 1543 1544 | |
import_pagx
¶
Import a .pagx file. (see: Project.import_document)
Source code in src/arcpie/project/elements.py
1516 1517 1518 1519 1520 1521 1522 1523 1524 | |
import_rptx
¶
Import a .rptx file. (see: Project.import_document)
Source code in src/arcpie/project/elements.py
1546 1547 1548 1549 1550 1551 1552 1553 1554 | |
open
¶
open() -> None
Open the project if it is not open (stores an ArcGISProject instance in elem)
Source code in src/arcpie/project/elements.py
764 765 766 767 768 769 770 771 | |
read_cim_file
¶
Open the aprx and read a file inside it (useful for extracting images).
Source code in src/arcpie/project/elements.py
1060 1061 1062 1063 1064 1065 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
reopen
¶
reopen() -> None
Close and re-open a Project
Source code in src/arcpie/project/elements.py
783 784 785 786 787 788 | |
save
¶
save() -> None
Save the project.
Source code in src/arcpie/project/elements.py
1415 1416 1417 1418 1419 1420 1421 1422 1423 | |
save_as
¶
Save a copy of the project
Source code in src/arcpie/project/elements.py
1425 1426 1427 1428 1429 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
start
¶
start() -> None
Open the project using os.startfile
Source code in src/arcpie/project/elements.py
1431 1432 1433 | |
to_directory
¶
Unzip the aprx file to a target directory.
| PARAMETER | DESCRIPTION |
|---|---|
|
The folder to unzip the Project into. |
|
Overwrite the contents of the target folder if it exists.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
FileExistsError
|
If |
Source code in src/arcpie/project/elements.py
1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 | |
update_connection
¶
update_connection(
new: str,
current: str | None = None,
auto_update: bool = True,
validate: bool = True,
ignore_case: bool = False,
)
Update a connection at the Project level
Source code in src/arcpie/project/elements.py
1067 1068 1069 | |
ProjectNode
¶
ReferenceDataSource
¶
Bases: TypedDict
-
Modules
Project
ReportSectionsource
| ATTRIBUTE | DESCRIPTION |
|---|---|
connection_info |
TYPE:
|
dataset |
TYPE:
|
workspace_factory |
TYPE:
|
Report
¶
Report(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: Element[Report, CIMReport, Project]
-
Modules
Project
ReportElement
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
diff |
Generate a diff of two Layers using |
export |
Export the MapSeries. |
get_cim |
Get the CIM definition for the Element. |
open_view |
Open the Report in the active Project. |
query_as |
Context manager for changing the query temporarily. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
definition_query |
SQL where clause that the report is filtered with.
TYPE:
|
elem |
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
report_layout_sections |
ElementList of all ReportLayoutSections
TYPE:
|
report_sections |
ElementList of all ReportSecions.
TYPE:
|
sections |
ElementList of all ReportSecions and ReportLayoutSections.
TYPE:
|
short_name |
A short name for the Element (
TYPE:
|
unique_name |
|
uri |
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
definition_query
property
writable
¶
definition_query: str
SQL where clause that the report is filtered with.
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
report_layout_sections
property
¶
report_layout_sections: ElementList[ReportLayoutSection]
ElementList of all ReportLayoutSections
report_sections
property
¶
report_sections: ElementList[ReportSection]
ElementList of all ReportSecions.
sections
property
¶
sections: ElementList[ReportElement[Any, Any]]
ElementList of all ReportSecions and ReportLayoutSections.
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
export
¶
export(
format: _RPTFormat | _RPTFormatAlt | _RPTFormatName,
*,
out: None = None,
antialiasing: Antialiasing | None = ...,
report_options: ReportExportOptions | None = ...,
custom_pages: str | None = ...,
page_offset: int = ...,
page_override: int = ...,
export_pages: ReportExportPages = ...,
) -> tuple[bytes, ...]
export(
format: _RPTFormat | _RPTFormatAlt | _RPTFormatName,
*,
out: Path | str = ...,
antialiasing: Antialiasing | None = ...,
report_options: ReportExportOptions | None = ...,
custom_pages: str | None = ...,
page_offset: int = ...,
page_override: int = ...,
export_pages: ReportExportPages = ...,
) -> tuple[Path, ...]
export(
format: _RPTFormat | _RPTFormatAlt | _RPTFormatName,
*,
out: Path | str | None = None,
antialiasing: Antialiasing | None = None,
report_options: ReportExportOptions | None = None,
custom_pages: str | None = None,
page_offset: int | None = None,
page_override: int | None = None,
export_pages: ReportExportPages = 'ALL',
) -> tuple[Path, ...] | tuple[bytes, ...]
Export the MapSeries.
| PARAMETER | DESCRIPTION |
|---|---|
|
A string name for the output format or a Formatter object.
TYPE:
|
|
An optional output file for the export. |
|
Antialiazing level for the export.
TYPE:
|
|
ReportExportOptions object (additional kwargs will set this too.)
TYPE:
|
|
An optional custom page range string for the export.
TYPE:
|
|
An optional offset on page numbers for the report.
TYPE:
|
|
Override the total number of pages.
TYPE:
|
|
The pages to export (Even, Odd, All, etc.)
TYPE:
|
Source code in src/arcpie/project/elements.py
4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
open_view
¶
open_view() -> None
Open the Report in the active Project.
Source code in src/arcpie/project/elements.py
4581 4582 4583 | |
query_as
¶
Context manager for changing the query temporarily.
| PARAMETER | DESCRIPTION |
|---|---|
|
The SQL where clause to use as the query.
TYPE:
|
Example:
>>> for q_name, sql in report_queries.items():
... with report.query_as(sql):
... report.export(..., out=q_name)
Source code in src/arcpie/project/elements.py
4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
ReportElement
¶
ReportElement(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: Element[MPElem, CIM, Report]
- Modules Project
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
elem |
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
short_name |
A short name for the Element (
TYPE:
|
unique_name |
|
uri |
|
visible |
Visibility state of the ReportElement.
TYPE:
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
ReportFieldConf
¶
Bases: TypedDict
-
Modules
Project
Projectcreate_report
| ATTRIBUTE | DESCRIPTION |
|---|---|
fieldName |
TYPE:
|
groupField |
TYPE:
|
sortInfo |
TYPE:
|
ReportLayoutSection
¶
ReportLayoutSection(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: ReportElement[ReportLayoutSection, CIMReportLayoutPageSection]
-
Modules
Project
Reportreport_layout_sections
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
elem |
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
short_name |
A short name for the Element (
TYPE:
|
unique_name |
|
uri |
|
visible |
Visibility state of the ReportElement.
TYPE:
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
ReportSection
¶
ReportSection(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: ReportElement[ReportSection, CIMReportSection]
-
Modules
Project
Reportreport_sections
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
query_as |
Create a query context for the ReportSection. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
set_report_source |
Set the related Report data source. |
set_source |
Set the ReportSection data source to something that has data. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
definition_query |
SQL where clause that filters the ReportSection.
TYPE:
|
elem |
|
fields |
A list of ReportSectionFields dictionaries for the ReportSection.
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
short_name |
A short name for the Element (
TYPE:
|
source |
A ReferenceDataSource dictionary that defines the data connection.
TYPE:
|
statistics |
A list of ReportStatistic dictionaries for the ReportSection.
TYPE:
|
unique_name |
|
uri |
|
visible |
Visibility state of the ReportElement.
TYPE:
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
definition_query
property
writable
¶
definition_query: str
SQL where clause that filters the ReportSection.
fields
property
writable
¶
fields: list[ReportSectionField]
A list of ReportSectionFields dictionaries for the ReportSection.
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
source
property
¶
source: ReferenceDataSource
A ReferenceDataSource dictionary that defines the data connection.
statistics
property
¶
statistics: list[ReportStatistic]
A list of ReportStatistic dictionaries for the ReportSection.
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
query_as
¶
Create a query context for the ReportSection.
| PARAMETER | DESCRIPTION |
|---|---|
|
SQL where clause to set for the context block.
TYPE:
|
Example:
>>> for q_name, sql in section_queries.items():
... with report_section.query_as(sql):
... report.export(..., name=q_name)
Source code in src/arcpie/project/elements.py
4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
set_report_source
¶
set_report_source(
source: LayerLike
| TableLike
| FeatureClass
| Table
| Path
| str,
name: str | None = None,
rel_class: str | None = None,
)
Set the related Report data source.
| PARAMETER | DESCRIPTION |
|---|---|
|
Any valid data source for a Report.
TYPE:
|
|
The name of the datasource.
TYPE:
|
|
The name of the new relationship class.
TYPE:
|
Source code in src/arcpie/project/elements.py
4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 | |
set_source
¶
Set the ReportSection data source to something that has data.
| PARAMETER | DESCRIPTION |
|---|---|
|
Any valid source object (Layer, Table, FeatureClass, URL, Path, etc.)
TYPE:
|
Source code in src/arcpie/project/elements.py
4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 | |
ReportSectionField
¶
Bases: TypedDict
-
Modules
Project
ReportSectionfields
| ATTRIBUTE | DESCRIPTION |
|---|---|
fieldName |
TYPE:
|
groupField |
TYPE:
|
sortOrder |
TYPE:
|
ReportStatConf
¶
ReportStatistic
¶
Bases: TypedDict
-
Modules
Project
ReportSectionstatistics
| ATTRIBUTE | DESCRIPTION |
|---|---|
fieldName |
TYPE:
|
statistic |
TYPE:
|
SomeLayerProps
¶
Bases: TypedDict
| ATTRIBUTE | DESCRIPTION |
|---|---|
URI |
TYPE:
|
brightness |
TYPE:
|
connectionProperties |
TYPE:
|
contrast |
TYPE:
|
dataSource |
TYPE:
|
definitionQuery |
TYPE:
|
elevation |
TYPE:
|
is3DLayer |
TYPE:
|
isBasemapLayer |
TYPE:
|
isBroken |
TYPE:
|
isFeatureLayer |
TYPE:
|
isGraphicsLayer |
TYPE:
|
isGroupLayer |
TYPE:
|
isNetworkAnalystLayer |
TYPE:
|
isNetworkDatasetLayer |
TYPE:
|
isParcelFabricLayer |
TYPE:
|
isRasterLayer |
TYPE:
|
isSceneLayer |
TYPE:
|
isTimeEnabled |
TYPE:
|
isWebLayer |
TYPE:
|
longName |
TYPE:
|
maxThreshold |
TYPE:
|
metadata |
TYPE:
|
minThreshold |
TYPE:
|
name |
TYPE:
|
showLabels |
TYPE:
|
symbology |
TYPE:
|
time |
TYPE:
|
transparency |
TYPE:
|
visible |
TYPE:
|
Style
¶
Bases: Element[None, None, Project]
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
__str__ |
|
diff |
Generate a diff of two Layers using |
filter_by |
Apply a filter to the StyleItems in the Sytle group. |
get_cim |
Get the CIM definition for the Element. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
by_class |
Group the StyleItems by styleClass.
TYPE:
|
by_key |
Create a mapping of each item to its unique key. |
by_name |
Group the StyleItems by name.
TYPE:
|
by_tags |
Group the StyleItems by tag. (will create duplicate item refrences)
TYPE:
|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
elem |
|
fullname |
|
items |
ElementList of StyleItems associated with the Style/stylx.
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
TYPE:
|
parent |
|
short_name |
A short name for the Element (
TYPE:
|
unique_name |
|
uri |
|
Source code in src/arcpie/project/elements.py
4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 | |
by_class
property
¶
by_class: dict[StyleClass, ElementList[StyleItem]]
Group the StyleItems by styleClass.
by_tags
property
¶
by_tags: dict[str, ElementList[StyleItem]]
Group the StyleItems by tag. (will create duplicate item refrences)
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
items
property
¶
items: ElementList[StyleItem]
ElementList of StyleItems associated with the Style/stylx.
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__()
Source code in src/arcpie/project/elements.py
4623 4624 | |
__str__
¶
__str__() -> str
Source code in src/arcpie/project/elements.py
4626 4627 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
filter_by
¶
filter_by(
key: str | None = None,
name: str | None = None,
style_class: StyleClass | None = None,
tags: Iterable[str] | str | None = None,
) -> ElementList[StyleItem]
Apply a filter to the StyleItems in the Sytle group.
| PARAMETER | DESCRIPTION |
|---|---|
|
A unique key to filter by.
TYPE:
|
|
A name expression to filter by.
TYPE:
|
|
A style class to filter by.
TYPE:
|
|
Tags to filter by. |
Source code in src/arcpie/project/elements.py
4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
StyleItem
¶
StyleItem(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: Element[StyleItem, None, Style]
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
category |
The category of the StyleItem.
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
elem |
|
key |
The uniqiue key for the StyleItem.
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
short_name |
A short name for the Element (
TYPE:
|
style |
The string representation of the parent Style. (use
|
style_class |
The style class of the StyleItem.
TYPE:
|
tags |
A set of tags applied to the StyleItem. |
unique_name |
|
uri |
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
4707 4708 4709 4710 4711 4712 4713 4714 4715 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
Table
¶
Table(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: Element[Table, CIMFeatureTable, Map | GroupLayer]
| METHOD | DESCRIPTION |
|---|---|
__bool__ |
|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__iter__ |
|
__len__ |
|
__repr__ |
|
clear_selection |
Clear the current selection. |
clone_properties |
Copy specified properties from another Table. |
diff |
Generate a diff of two Layers using |
export_csv |
Export the table data to a CSV file. |
export_lyrx |
Export the |
get_cim |
Get the CIM definition for the Element. |
open_view |
Open the Table view in the avtive project. |
query_as |
Context manager for setting the active DefinitionQuery string. |
refresh |
Refresh all cached elements. |
select |
Set a selection on the Table using a predicate or query and a method. |
select_all |
Select all rows in the Table. |
selected |
Get a list of all selected table records. |
set_cim |
Set a CIM definition for an Element set |
unselected |
Get a list of all unselected table records. |
update_connection |
Update the connection properties of the Table. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
chart_map |
Chart objects for the Table grouped by chart type. (all types included, empty list for types that don't exist)
TYPE:
|
charts |
All Chart objects associated with the Table. |
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
CIM definition of the Table in dictionary format. |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
data_source |
The Table data source as a string.
TYPE:
|
definition_queries |
A list of all DefinitionQueries for the Table.
TYPE:
|
definition_query |
The SQL string of the active DefinitionQuery.
|
elem |
|
lyrx |
A dictionary representation of the table |
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
selection |
Get the selected record OID set. |
short_name |
A short name for the Element (
TYPE:
|
source_data |
Alias for
TYPE:
|
table |
The base Table object for the Table Layer.
TYPE:
|
unique_name |
|
uri |
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
chart_map
property
¶
chart_map: ChartMap
Chart objects for the Table grouped by chart type. (all types included, empty list for types that don't exist)
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
definition_queries
property
writable
¶
definition_queries: list[DefinitionQuery]
A list of all DefinitionQueries for the Table.
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
source_data
property
¶
source_data: Table
Alias for table that allows using Tables and Layers in duck typed loops.
__bool__
¶
__bool__() -> Literal[True]
Source code in src/arcpie/project/elements.py
3197 3198 3199 | |
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__iter__
¶
Source code in src/arcpie/project/elements.py
3194 3195 | |
__len__
¶
__len__() -> int
Source code in src/arcpie/project/elements.py
3191 3192 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
clear_selection
¶
clear_selection() -> Self
Clear the current selection.
Source code in src/arcpie/project/elements.py
3265 3266 3267 | |
clone_properties
¶
clone_properties(
from_table: TableLike,
properties: TablePasteProperties = 'ALL',
)
Copy specified properties from another Table.
Source code in src/arcpie/project/elements.py
3319 3320 3321 3322 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
export_csv
¶
export_csv(
outdir: Path | str,
*,
name: str | None = None,
fields: Iterable[str] | None = None,
sep: str = ',',
newline: str = '\n',
) -> Path
Export the table data to a CSV file.
| PARAMETER | DESCRIPTION |
|---|---|
|
The output directory or file. |
|
An optional name to give the file (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 | |
export_lyrx
¶
Export the lyrx definition of the Table to a file.
| PARAMETER | DESCRIPTION |
|---|---|
|
The directory to place the |
|
An optional name for the
TYPE:
|
|
Indentation level in the output
TYPE:
|
|
Convert all absolute paths in the
|
Source code in src/arcpie/project/elements.py
3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
open_view
¶
open_view(show_selected: bool = False) -> None
Open the Table view in the avtive project.
Source code in src/arcpie/project/elements.py
3324 3325 3326 | |
query_as
¶
query_as(query: str | None)
Context manager for setting the active DefinitionQuery string.
Example:
>>> print(len(table))
250
>>> with lay.query_as("STATUS = 'ACTIVE'"):
... print(len(table))
125
Source code in src/arcpie/project/elements.py
3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
select
¶
select(
*,
predicate: Callable[[dict[str, Any]], bool]
| None = None,
query: str | None = None,
method: Method | Literal['CLEAR', 'ALL'] = 'NEW',
) -> Self
Set a selection on the Table using a predicate or query and a method.
| PARAMETER | DESCRIPTION |
|---|---|
|
A function that takes a feature record and returns True if it is to be selected. |
|
A SQL where clause that will define the selection (ignored if
TYPE:
|
|
How to resolve the selection with existing selection.
TYPE:
|
Note
Calling with method = 'CLEAR' and no other arguments will clear the selection.
Calling with method = 'ALL' and no other arguments will select all features.
Source code in src/arcpie/project/elements.py
3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 | |
select_all
¶
select_all() -> Self
Select all rows in the Table.
Source code in src/arcpie/project/elements.py
3269 3270 3271 | |
selected
¶
Get a list of all selected table records.
Source code in src/arcpie/project/elements.py
3255 3256 3257 3258 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
unselected
¶
Get a list of all unselected table records.
Source code in src/arcpie/project/elements.py
3260 3261 3262 3263 | |
update_connection
¶
update_connection(
new: str,
current: str | None = None,
auto_update: bool = True,
validate: bool = True,
ignore_case: bool = False,
) -> None
Update the connection properties of the Table.
| PARAMETER | DESCRIPTION |
|---|---|
|
The new connection string.
TYPE:
|
|
The connection string to replace.
TYPE:
|
|
Update joins and relates.
TYPE:
|
|
Validate the Table connection before setting it.
TYPE:
|
|
Ignore case in queries.
TYPE:
|
Source code in src/arcpie/project/elements.py
3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 | |
TableFrameElement
¶
TableFrameElement(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: LayoutElement[TableFrameElement, CIMTableFrame]
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
apply_style |
Apply a |
delete |
Delete the LayuoutElement from its parent Layout (if it has one). |
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
move |
Shift the element by the provided x/y deltas. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
| ATTRIBUTE | DESCRIPTION |
|---|---|
anchor |
LayoutElement anchor point.
TYPE:
|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
elem |
|
group |
GroupElement the LayoutElement belongs to if it exists.
TYPE:
|
height |
LayoutElement height in page units.
TYPE:
|
locked |
The editability state of the LayoutElement.
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
parent |
|
rotation |
LayoutElement rotation in degrees. (
TYPE:
|
short_name |
A short name for the Element (
TYPE:
|
type |
The string name for the LayoutElement type.
TYPE:
|
unique_name |
|
uri |
|
visible |
Visibility state for the LayoutElement.
TYPE:
|
width |
LayoutElement width in page units.
TYPE:
|
x |
The X position of the LayoutElement anchor point in page units.
TYPE:
|
y |
The Y position of the LayoutElement anchor point in page units.
TYPE:
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
rotation
property
writable
¶
rotation: float
LayoutElement rotation in degrees. (TableFrameElements cannot be rotated)
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
apply_style
¶
apply_style(style_item: StyleItemLike) -> None
Apply a TABLE_FRAME StyleItem to the TableFrameElement.
Source code in src/arcpie/project/elements.py
4967 4968 4969 4970 4971 4972 | |
delete
¶
delete() -> None
Delete the LayuoutElement from its parent Layout (if it has one).
Source code in src/arcpie/project/elements.py
4944 4945 4946 4947 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
move
¶
Shift the element by the provided x/y deltas.
Source code in src/arcpie/project/elements.py
4949 4950 4951 4952 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
TextElement
¶
TextElement(
elem: MPElem | Element[MPElem, CIMDef, Parent],
parent: Parent | None = None,
)
Bases: LayoutElement[TextElement, CIMGraphicElement]
| METHOD | DESCRIPTION |
|---|---|
__eq__ |
|
__getattr__ |
|
__hash__ |
|
__repr__ |
|
apply_style |
Apply a |
clone |
Make a copy of the TextElement in the parent Layout. |
delete |
Delete the LayuoutElement from its parent Layout (if it has one). |
diff |
Generate a diff of two Layers using |
get_cim |
Get the CIM definition for the Element. |
move |
Shift the element by the provided x/y deltas. |
refresh |
Refresh all cached elements. |
set_cim |
Set a CIM definition for an Element set |
set_text |
Set properties of the TextElement text. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
anchor |
LayoutElement anchor point.
TYPE:
|
cache |
|
cache_enabled |
See if cache is enabled for this Element
TYPE:
|
children |
|
cim |
The CIM object for the Element
TYPE:
|
cim_dict |
The Element CIM definition as a Python dictionary |
cim_type |
The CIM object returned by
TYPE:
|
cim_type_name |
The name of the CIM object returned by
TYPE:
|
elem |
|
font_family |
The Font Family of the Text Element. (must be proper name of an installed font)
TYPE:
|
font_style |
The style name of the font (bold, italic, regular, etc.). Must be supported by font family.
TYPE:
|
group |
GroupElement the LayoutElement belongs to if it exists.
TYPE:
|
height |
LayoutElement height in page units.
TYPE:
|
locked |
The editability state of the LayoutElement.
TYPE:
|
mp_type |
|
mp_type_name |
|
name |
The name of the element (either
|
overflowing |
Determine if the TextElement text is overflowing the TextElement boundary.
TYPE:
|
parent |
|
rotation |
LayoutElement rotation in degrees. (
TYPE:
|
short_name |
A short name for the Element (
TYPE:
|
text |
The text string of the TextElement.
TYPE:
|
text_angle |
The rotation angle of the text in degrees.
TYPE:
|
text_size |
The text size in points.
TYPE:
|
type |
The string name for the LayoutElement type.
TYPE:
|
unique_name |
|
uri |
|
visible |
Visibility state for the LayoutElement.
TYPE:
|
width |
LayoutElement width in page units.
TYPE:
|
x |
The X position of the LayoutElement anchor point in page units.
TYPE:
|
y |
The Y position of the LayoutElement anchor point in page units.
TYPE:
|
Source code in src/arcpie/project/elements.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
cache_enabled
property
writable
¶
cache_enabled: bool
See if cache is enabled for this Element
Element cache sits on top of the base ArcGIS cache and will not be invalidated
unless this flag is set to False or an explicit refresh call is made
When accessing element items in a tight loop, this cache can be ~100x faster (~1us vs ~100us) at the cost of de-sync if lots of changes are being made to the element children/state (e.g. adding maps/layers in a loop).
Methods implemented on the arcpie wrappers will manage this cache, but changes that happen outside arcpie will require manual cache invaludation.
cim_type_name
property
¶
cim_type_name: str
The name of the CIM object returned by getDefinition('V3')
font_family
property
writable
¶
font_family: str
The Font Family of the Text Element. (must be proper name of an installed font)
font_style
property
writable
¶
font_style: str
The style name of the font (bold, italic, regular, etc.). Must be supported by font family.
name
property
writable
¶
name
The name of the element (either longName, name, URI, or ID:{hex(id(elem)})
overflowing
property
¶
overflowing: bool
Determine if the TextElement text is overflowing the TextElement boundary.
rotation
property
writable
¶
rotation: float
LayoutElement rotation in degrees. (TableFrameElements cannot be rotated)
short_name
property
¶
short_name: str
A short name for the Element (elem.name) if one exists otherwise the same as self.name
__eq__
¶
Source code in src/arcpie/project/elements.py
499 500 | |
__getattr__
¶
__getattr__(name: str)
Source code in src/arcpie/project/elements.py
488 489 490 491 492 493 494 | |
__hash__
¶
__hash__() -> int
Source code in src/arcpie/project/elements.py
502 503 | |
__repr__
¶
__repr__() -> str
Source code in src/arcpie/project/elements.py
496 497 | |
apply_style
¶
apply_style(style_item: StyleItemLike) -> None
Apply a TEXT StyleItem to the TextElement.
Source code in src/arcpie/project/elements.py
5442 5443 5444 5445 5446 5447 | |
clone
¶
Make a copy of the TextElement in the parent Layout.
| PARAMETER | DESCRIPTION |
|---|---|
|
An optional name to give the copy. (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
5449 5450 5451 5452 5453 5454 5455 5456 5457 | |
delete
¶
delete() -> None
Delete the LayuoutElement from its parent Layout (if it has one).
Source code in src/arcpie/project/elements.py
4944 4945 4946 4947 | |
diff
classmethod
¶
Generate a diff of two Layers using cim_dict and difflib.unified_diff
| PARAMETER | DESCRIPTION |
|---|---|
|
The A Element of the diff
TYPE:
|
|
The B Element of the diff
TYPE:
|
|
An optional |
Source code in src/arcpie/project/elements.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_cim
¶
get_cim() -> CIMDef
Get the CIM definition for the Element.
Source code in src/arcpie/project/elements.py
447 448 449 450 451 452 453 454 455 456 457 458 459 | |
move
¶
Shift the element by the provided x/y deltas.
Source code in src/arcpie/project/elements.py
4949 4950 4951 4952 | |
refresh
¶
refresh(*props: str) -> None
Refresh all cached elements.
By default, all list* function results are cached and copies of those objects are returned. If a state change occurs (elements are added/removed) refresh() should be called.
| PARAMETER | DESCRIPTION |
|---|---|
|
varargs for all cache entries to clear (default:
TYPE:
|
Source code in src/arcpie/project/elements.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
set_cim
¶
set_cim(cim: CIMDef, _force: bool = False) -> None
Set a CIM definition for an Element set _force to False to allow CIMType change.
(must be valid instance of original CIM by default)
Source code in src/arcpie/project/elements.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
set_text
¶
set_text(
*,
text: str | None = None,
family: str | None = None,
style: str | None = None,
size: float | None = None,
angle: float | None = None,
) -> None
Set properties of the TextElement text.
| PARAMETER | DESCRIPTION |
|---|---|
|
Set the text.
TYPE:
|
|
Set the font family.
TYPE:
|
|
Set the font style.
TYPE:
|
|
Set the font size.
TYPE:
|
|
Set the font angle.
TYPE:
|
Source code in src/arcpie/project/elements.py
5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 | |
ToolboxConf
¶
UnwrapError
¶
Bases: KeyError, ValueError, IndexError
-
Modules
Project
ElementListunwrap
| ATTRIBUTE | DESCRIPTION |
|---|---|
expects |
|
have |
|
Source code in src/arcpie/project/elements.py
527 528 529 530 | |