Domain¶
| CLASS | DESCRIPTION |
|---|---|
CodedValueDomain |
Domain with a CodedValue component |
Domain |
General Domain object |
RangeDomain |
Domain with a Range component |
BaseDomain
¶
Base class for interacting with Domains.
General setup structure is pulled from pathlib.Path
| METHOD | DESCRIPTION |
|---|---|
sync |
Sync the domain with the workspace |
Source code in src/arcpie/schema/domain.py
126 127 128 129 130 131 132 133 134 | |
sync
¶
sync() -> None
Sync the domain with the workspace
Source code in src/arcpie/schema/domain.py
136 137 138 139 140 141 | |
CodedValueDomain
¶
Bases: Domain
Domain with a CodedValue component
| METHOD | DESCRIPTION |
|---|---|
add_to |
Add the domain to a root workspace/Dataset |
assign_to |
Assign the domain to a Field |
create |
Create a new domain |
delete |
Delete the domain |
from_dict |
Create a Domain object from a system domain definition |
from_table |
Create a CodedValue domain from a Table |
sync |
Sync the domain with the workspace |
to_dict |
Use with json.dump/dumps |
to_table |
Convert the domain to a Table in its workspace |
used_by |
Get a mapping of FeatureClass/Table -> [Field, ...] usage for the domain |
Source code in src/arcpie/schema/domain.py
126 127 128 129 130 131 132 133 134 | |
add_to
¶
add_to(workspace: Dataset) -> None
Add the domain to a root workspace/Dataset
Source code in src/arcpie/schema/domain.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |
assign_to
¶
assign_to(
table: Table | FeatureClass,
field: str,
*,
subtype_code: int | None = None,
) -> None
Assign the domain to a Field
| PARAMETER | DESCRIPTION |
|---|---|
|
The table to apply the domain to
TYPE:
|
|
The field in the table to apply the domain to
TYPE:
|
|
An optional subtype to apply the domain to
TYPE:
|
Source code in src/arcpie/schema/domain.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |
create
classmethod
¶
create(
workspace: str,
name: str,
*,
domain_type: Literal['CodedValue'],
field_type: DomainFieldType,
coded_values: CodedValues,
description: str,
split_policy: SplitPolicy = ...,
merge_policy: MergePolicy = ...,
) -> CodedValueDomain
create(
workspace: str,
name: str,
*,
domain_type: Literal['Range'],
field_type: DomainFieldType,
domain_range: RangeValue,
description: str,
split_policy: SplitPolicy = ...,
merge_policy: MergePolicy = ...,
) -> RangeDomain
create(
workspace: str,
name: str,
*,
domain_type: DomainType,
field_type: DomainFieldType,
description: str = '',
split_policy: SplitPolicy = 'Duplicate',
merge_policy: MergePolicy = 'DefaultValue',
domain_range: RangeValue | None = None,
coded_values: CodedValues | None = None,
) -> CodedValueDomain | RangeDomain
Create a new domain
Source code in src/arcpie/schema/domain.py
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | |
delete
¶
delete() -> None
Delete the domain
Source code in src/arcpie/schema/domain.py
260 261 262 | |
from_dict
classmethod
¶
Create a Domain object from a system domain definition
Source code in src/arcpie/schema/domain.py
431 432 433 434 435 | |
from_table
classmethod
¶
from_table(
table: FeatureClass | Table,
name: str,
*,
code_field: str,
description_field: str,
workspace: str | None = None,
description: str | None,
overwrite_existing: bool = False,
) -> CodedValueDomain
Create a CodedValue domain from a Table
| PARAMETER | DESCRIPTION |
|---|---|
|
The table or featureclass to create the domain from
TYPE:
|
|
The name of the domain
TYPE:
|
|
The field to use for codes
TYPE:
|
|
The field to use for descriptions
TYPE:
|
|
The workspace to create the domain in (default: table.workspace)
TYPE:
|
|
An optional description for the new domain
TYPE:
|
|
If set to
TYPE:
|
Source code in src/arcpie/schema/domain.py
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | |
sync
¶
sync() -> None
Sync the domain with the workspace
Source code in src/arcpie/schema/domain.py
136 137 138 139 140 141 | |
to_dict
¶
to_dict() -> DomainSchema
Use with json.dump/dumps
Source code in src/arcpie/schema/domain.py
214 215 216 217 218 219 220 221 222 223 224 225 226 | |
to_table
¶
to_table(
table_name: str,
*,
code_field: str = 'code',
description_field: str = 'description',
configuration_keyword: str | None = None,
) -> Table
Convert the domain to a Table in its workspace
| PARAMETER | DESCRIPTION |
|---|---|
|
The name of the output table
TYPE:
|
|
The field name for the codes
TYPE:
|
|
The field name for the descriptions
TYPE:
|
|
An optional config keyword for the database
TYPE:
|
Source code in src/arcpie/schema/domain.py
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | |
used_by
¶
used_by() -> FieldUsage
Get a mapping of FeatureClass/Table -> [Field, ...] usage for the domain
Source code in src/arcpie/schema/domain.py
228 229 230 | |
Domain
¶
Bases: BaseDomain
General Domain object
- Modules Domain
| METHOD | DESCRIPTION |
|---|---|
add_to |
Add the domain to a root workspace/Dataset |
assign_to |
Assign the domain to a Field |
create |
Create a new domain |
delete |
Delete the domain |
from_dict |
Create a Domain object from a system domain definition |
from_table |
Create a CodedValue domain from a Table |
sort |
CodedValue Only |
sync |
Sync the domain with the workspace |
to_dict |
Use with json.dump/dumps |
to_table |
Convert the domain to a Table in its workspace |
used_by |
Get a mapping of FeatureClass/Table -> [Field, ...] usage for the domain |
Source code in src/arcpie/schema/domain.py
126 127 128 129 130 131 132 133 134 | |
add_to
¶
add_to(workspace: Dataset) -> None
Add the domain to a root workspace/Dataset
Source code in src/arcpie/schema/domain.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |
assign_to
¶
assign_to(
table: Table | FeatureClass,
field: str,
*,
subtype_code: int | None = None,
) -> None
Assign the domain to a Field
| PARAMETER | DESCRIPTION |
|---|---|
|
The table to apply the domain to
TYPE:
|
|
The field in the table to apply the domain to
TYPE:
|
|
An optional subtype to apply the domain to
TYPE:
|
Source code in src/arcpie/schema/domain.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |
create
classmethod
¶
create(
workspace: str,
name: str,
*,
domain_type: Literal['CodedValue'],
field_type: DomainFieldType,
coded_values: CodedValues,
description: str,
split_policy: SplitPolicy = ...,
merge_policy: MergePolicy = ...,
) -> CodedValueDomain
create(
workspace: str,
name: str,
*,
domain_type: Literal['Range'],
field_type: DomainFieldType,
domain_range: RangeValue,
description: str,
split_policy: SplitPolicy = ...,
merge_policy: MergePolicy = ...,
) -> RangeDomain
create(
workspace: str,
name: str,
*,
domain_type: DomainType,
field_type: DomainFieldType,
description: str = '',
split_policy: SplitPolicy = 'Duplicate',
merge_policy: MergePolicy = 'DefaultValue',
domain_range: RangeValue | None = None,
coded_values: CodedValues | None = None,
) -> CodedValueDomain | RangeDomain
Create a new domain
Source code in src/arcpie/schema/domain.py
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | |
delete
¶
delete() -> None
Delete the domain
Source code in src/arcpie/schema/domain.py
260 261 262 | |
from_dict
classmethod
¶
Create a Domain object from a system domain definition
Source code in src/arcpie/schema/domain.py
431 432 433 434 435 | |
from_table
classmethod
¶
from_table(
table: FeatureClass | Table,
name: str,
*,
code_field: str,
description_field: str,
workspace: str | None = None,
description: str | None,
overwrite_existing: bool = False,
) -> CodedValueDomain
Create a CodedValue domain from a Table
| PARAMETER | DESCRIPTION |
|---|---|
|
The table or featureclass to create the domain from
TYPE:
|
|
The name of the domain
TYPE:
|
|
The field to use for codes
TYPE:
|
|
The field to use for descriptions
TYPE:
|
|
The workspace to create the domain in (default: table.workspace)
TYPE:
|
|
An optional description for the new domain
TYPE:
|
|
If set to
TYPE:
|
Source code in src/arcpie/schema/domain.py
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | |
sort
¶
CodedValue Only
Source code in src/arcpie/schema/domain.py
325 326 | |
sync
¶
sync() -> None
Sync the domain with the workspace
Source code in src/arcpie/schema/domain.py
136 137 138 139 140 141 | |
to_dict
¶
to_dict() -> DomainSchema
Use with json.dump/dumps
Source code in src/arcpie/schema/domain.py
214 215 216 217 218 219 220 221 222 223 224 225 226 | |
to_table
¶
to_table(
table_name: str,
*,
code_field: str = 'code',
description_field: str = 'description',
configuration_keyword: str | None = None,
) -> Table
Convert the domain to a Table in its workspace
| PARAMETER | DESCRIPTION |
|---|---|
|
The name of the output table
TYPE:
|
|
The field name for the codes
TYPE:
|
|
The field name for the descriptions
TYPE:
|
|
An optional config keyword for the database
TYPE:
|
Source code in src/arcpie/schema/domain.py
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | |
used_by
¶
used_by() -> FieldUsage
Get a mapping of FeatureClass/Table -> [Field, ...] usage for the domain
Source code in src/arcpie/schema/domain.py
228 229 230 | |
DomainManager
¶
Container for managing dataset domains
| METHOD | DESCRIPTION |
|---|---|
export_module |
Export the workspace domain to a Python module that contains literals and dictionary mappings. |
import_domains |
Import domains from a domain mapping (DOMAINS global in exported module) |
to_dict |
Use with json.dump/dumps |
usage |
A mapping of domains to features to fields that shows usage of a domain in a dataset |
Source code in src/arcpie/schema/domain.py
526 527 528 529 530 | |
export_module
¶
Export the workspace domain to a Python module that contains literals and dictionary mappings.
| PARAMETER | DESCRIPTION |
|---|---|
|
The export path to the module file |
Source code in src/arcpie/schema/domain.py
620 621 622 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 667 668 669 670 671 672 673 | |
import_domains
¶
Import domains from a domain mapping (DOMAINS global in exported module)
Source code in src/arcpie/schema/domain.py
675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 | |
to_dict
¶
Use with json.dump/dumps
Source code in src/arcpie/schema/domain.py
616 617 618 | |
usage
¶
usage(*domain_names: str) -> DomainUsageMap
A mapping of domains to features to fields that shows usage of a domain in a dataset
| PARAMETER | DESCRIPTION |
|---|---|
|
Varargs of all domain names to include in the output mapping
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DomainUsageMap
|
A Nested mapping of |
Source code in src/arcpie/schema/domain.py
586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 | |
RangeDomain
¶
Bases: Domain
Domain with a Range component
| METHOD | DESCRIPTION |
|---|---|
add_to |
Add the domain to a root workspace/Dataset |
assign_to |
Assign the domain to a Field |
create |
Create a new domain |
delete |
Delete the domain |
from_dict |
Create a Domain object from a system domain definition |
from_table |
Create a CodedValue domain from a Table |
sort |
CodedValue Only |
sync |
Sync the domain with the workspace |
to_dict |
Use with json.dump/dumps |
to_table |
Convert the domain to a Table in its workspace |
used_by |
Get a mapping of FeatureClass/Table -> [Field, ...] usage for the domain |
Source code in src/arcpie/schema/domain.py
126 127 128 129 130 131 132 133 134 | |
add_to
¶
add_to(workspace: Dataset) -> None
Add the domain to a root workspace/Dataset
Source code in src/arcpie/schema/domain.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |
assign_to
¶
assign_to(
table: Table | FeatureClass,
field: str,
*,
subtype_code: int | None = None,
) -> None
Assign the domain to a Field
| PARAMETER | DESCRIPTION |
|---|---|
|
The table to apply the domain to
TYPE:
|
|
The field in the table to apply the domain to
TYPE:
|
|
An optional subtype to apply the domain to
TYPE:
|
Source code in src/arcpie/schema/domain.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |
create
classmethod
¶
create(
workspace: str,
name: str,
*,
domain_type: Literal['CodedValue'],
field_type: DomainFieldType,
coded_values: CodedValues,
description: str,
split_policy: SplitPolicy = ...,
merge_policy: MergePolicy = ...,
) -> CodedValueDomain
create(
workspace: str,
name: str,
*,
domain_type: Literal['Range'],
field_type: DomainFieldType,
domain_range: RangeValue,
description: str,
split_policy: SplitPolicy = ...,
merge_policy: MergePolicy = ...,
) -> RangeDomain
create(
workspace: str,
name: str,
*,
domain_type: DomainType,
field_type: DomainFieldType,
description: str = '',
split_policy: SplitPolicy = 'Duplicate',
merge_policy: MergePolicy = 'DefaultValue',
domain_range: RangeValue | None = None,
coded_values: CodedValues | None = None,
) -> CodedValueDomain | RangeDomain
Create a new domain
Source code in src/arcpie/schema/domain.py
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | |
delete
¶
delete() -> None
Delete the domain
Source code in src/arcpie/schema/domain.py
260 261 262 | |
from_dict
classmethod
¶
Create a Domain object from a system domain definition
Source code in src/arcpie/schema/domain.py
431 432 433 434 435 | |
from_table
classmethod
¶
from_table(
table: FeatureClass | Table,
name: str,
*,
code_field: str,
description_field: str,
workspace: str | None = None,
description: str | None,
overwrite_existing: bool = False,
) -> CodedValueDomain
Create a CodedValue domain from a Table
| PARAMETER | DESCRIPTION |
|---|---|
|
The table or featureclass to create the domain from
TYPE:
|
|
The name of the domain
TYPE:
|
|
The field to use for codes
TYPE:
|
|
The field to use for descriptions
TYPE:
|
|
The workspace to create the domain in (default: table.workspace)
TYPE:
|
|
An optional description for the new domain
TYPE:
|
|
If set to
TYPE:
|
Source code in src/arcpie/schema/domain.py
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | |
sort
¶
CodedValue Only
Source code in src/arcpie/schema/domain.py
325 326 | |
sync
¶
sync() -> None
Sync the domain with the workspace
Source code in src/arcpie/schema/domain.py
136 137 138 139 140 141 | |
to_dict
¶
to_dict() -> DomainSchema
Use with json.dump/dumps
Source code in src/arcpie/schema/domain.py
214 215 216 217 218 219 220 221 222 223 224 225 226 | |
to_table
¶
to_table(
table_name: str,
*,
code_field: str = 'code',
description_field: str = 'description',
configuration_keyword: str | None = None,
) -> Table
Convert the domain to a Table in its workspace
| PARAMETER | DESCRIPTION |
|---|---|
|
The name of the output table
TYPE:
|
|
The field name for the codes
TYPE:
|
|
The field name for the descriptions
TYPE:
|
|
An optional config keyword for the database
TYPE:
|
Source code in src/arcpie/schema/domain.py
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | |
used_by
¶
used_by() -> FieldUsage
Get a mapping of FeatureClass/Table -> [Field, ...] usage for the domain
Source code in src/arcpie/schema/domain.py
228 229 230 | |