A geopolitical unit, or `GpUnit`, describes any physical or virtual unit of
representation or vote/seat aggregation. Use this entity to define geopolitical
units such as cities, districts, jurisdictions, or precincts to associate
contests, offices, vote counts, or other information with those geographies.

> [!NOTE]
> **Note:** This entity is the same for all feed types.

## GpUnit

The following entities contain references to `GpUnit`:

- [`Election`](https://developers.google.com/civics-data/reference/election), [`Contest`](https://developers.google.com/civics-data/reference/contest), and [`Office`](https://developers.google.com/civics-data/reference/office) contain a required reference to a `GpUnit` element, which defines the jurisdiction of the election, contest, or office respectively.
- [`SummaryCounts`](https://developers.google.com/civics-data/reference/counts#summary-counts) and [`VoteCounts`](https://developers.google.com/civics-data/reference/counts#vote-counts) reference `GpUnit` to link summary or vote counts to `GpUnit` elements that are defined for precincts or other types of geopolitical units.

The parent-child relationships for similar `GpUnit` entities need to be
consistent. For example, all congressional districts must have a single parent,
which is a state, even if a particular congressional district is wholly
contained within a county.

### Attributes

The following table describes the attributes for `GpUnit`:

| Attribute | Required? | Type | Description |
|---|---|---|---|
| `objectId` | Required | `ID` | Unique internal identifier that's used by other elements to reference this element. |

### Elements

The following table describes the elements for `GpUnit`:

| Element | Multiplicity | Type | Description |
|---|---|---|---|
| `ComposingGpUnitIds` | 0 or 1 | `IDREFS` | Unique identifier for one or more `GpUnit` elements. Used to reference other `GpUnit` elements and associate them with the parent `GpUnit`. Each referenced element must be defined for a geopolitical unit that's contained within the parent `GpUnit` element. Use the `ComposingGpUnitIds` element to only represent direct children of that particular `GpUnit`. For example, if Precincts A and B are in City M, and City M is in County X, then list Precincts A and B as children of City M. Then City M is a child of County X, but *don't* make Precincts A and B children of County X. |
| `ExternalIdentifiers` | 0 or 1 | [`ExternalIdentifiers`](https://developers.google.com/civics-data/reference/external-identifier) | Associates an ID with the `GpUnit`, such as a district's or city's code. When you include `ExternalIdentifiers`, if the type isn't listed in the enumeration [`IdentifierType`](https://developers.google.com/civics-data/reference/identifier-type), use a `Type` of `other` and provide your custom type in `OtherType`. |
| `Name` | 0 or 1 | `string` | Name of the geopolitical unit. |
| `SummaryCounts` | 0 or more | [`SummaryCounts`](https://developers.google.com/civics-data/reference/summary-counts) | Ballot summary counts, such as overvotes, undervotes, and total ballots. They can optionally be broken down by device type and ballot class. `GpUnit` includes `SummaryCounts` to provide summary counts for the corresponding geopolitical geography. |

## ReportingUnit

Use `ReportingUnit` to define a geopolitical unit such as state, city, township,
or precinct with the [`ReportingUnitType`](https://developers.google.com/civics-data/reference/reporting-unit-type)
enumeration.

> [!NOTE]
> **Note:** This element is the same for all feed types.

[`Election`](https://developers.google.com/civics-data/reference/election) references this element to
identify the geographical scope of the election. In this case, the
`ReportingUnit` element that defines the scope of the election can include
`ElectionAdministration` to provide election authority-related information.

> [!NOTE]
> **Note:** The following applies to any
> [`ExternalIdentifiers`](https://developers.google.com/civics-data/reference/external-identifier)
> of a `ReportingUnit`:
>
> - A [stable identifier](https://developers.google.com/civics-data/guides/stable-identifiers) is required.
> - A canonical identifier from Open Civic Data Identifiers is required. Provide it with a `Type` of `ocd-id` and a `Value` taken from the [list of canonical Open Civic Data Identifiers](https://github.com/opencivicdata/ocd-division-ids).

A `ReportingUnit` can be the child of, at most, one other `ReportingUnit`.
However, if a `ReportingUnit` needs multiple parents because it legitimately
spans across parent `ReportingUnit` elements, reach out to your Google point of
contact for guidance.

The XML syntax for `ReportingUnit` is `<GpUnit xsi:type="ReportingUnit" ... />`.

### Elements

The following table describes the elements for `ReportingUnit`:

| Element | Multiplicity | Type | Description |
|---|---|---|---|
| `AuthorityIds` | 0 or 1 | `IDREFS` | The `objectId` of one or more [`Person`](https://developers.google.com/civics-data/reference/person) elements that describe an authority responsible for the reporting unit. |
| `ContactInformation` | 0 or 1 | [`ContactInformation`](https://developers.google.com/civics-data/reference/contact-information) | Associates contact information with the reporting unit, such as an address of a vote center. |
| `CountStatus` | 0 or more | [`CountStatus`](https://developers.google.com/civics-data/reference/count-status) | Provides various counting statuses for different types of ballots or other items. |
| `ElectionAdministration` | 0 or 1 | [`ElectionAdministration`](https://developers.google.com/civics-data/reference/election-administration) | Provides information about an election authority. Use this when the reporting unit serves as the authority in the election. |
| `InternationalizedName` | 1 | [`InternationalizedText`](https://developers.google.com/civics-data/reference/internationalized-text) | The localized, full, canonical name of the geo-political unit, not an abbreviation. For example, "Alaska" or "New York's 14th congressional district." |
| `IsDistricted` | 0 or 1 | [`boolean`](https://developers.google.com/civics-data/reference/simple-data-types#xs-boolean) | The `IsDistricted` boolean can be used in a number of ways. It isn't strictly necessary because it's possible to identify districts by their `Type` sub-element. You can also examine the [`Contest`](https://developers.google.com/civics-data/reference/contest) element's `ElectoralDistrictId` sub-element, which links to the electoral district associated with the contest. However, if a district is defined but not linked from a contest, or if the type of district is given with `OtherType`, then `IsDistricted` is necessary to identify the `GpUnit` as a district. The `IsDistricted` boolean can also be used to signify that a `GpUnit` that's defined as a jurisdiction, like a city, is also used as a district, for example for city-wide contests. |
| `IsMailOnly` | 0 or 1 | [`boolean`](https://developers.google.com/civics-data/reference/simple-data-types#xs-boolean) | Indicates whether the reporting unit handles only mail-in or absentee ballot elections. If not present, the default value is `false`. |
| `SubUnitsReported` | 0 or 1 | `integer` | Number of associated subunits, such as precincts, that have completed reporting. |
| `TotalSubUnits` | 0 or 1 | `integer` | Total number of associated subunits such as precincts. |
| `Type` | 1 | [`ReportingUnitType`](https://developers.google.com/civics-data/reference/reporting-unit-type) | Enumerated type of the reporting unit, such as state, city, district, or precinct. If the reporting unit type isn't listed in the enumeration `ReportingUnitType`, use a `Type` of `other`, and provide your custom reporting unit type in `OtherType`. |
| `OtherType` | 0 or 1 | [`string`](https://developers.google.com/civics-data/reference/simple-data-types#xs-string) | Used to specify the type of geopolitical unit when the value of `ReportingUnitType` is `other`. |
| `VotersParticipated` | 0 or 1 | `integer` | The number of voters who have participated in the election. That is, how many have shown up at the polls, which includes those who didn't cast ballots. |
| `VotersRegistered` | 0 or 1 | `integer` | The number of registered voters that reside within the boundaries of the geopolitical unit. |

### Examples

### XML

```xml
    <GpUnit objectId="ru-0081" xsi:type="ReportingUnit">
      <ComposingGpUnitIds>ru-wahlkreis1 ru-wahlkreis2</ComposingGpUnitIds>
      <ExternalIdentifiers>
        <ExternalIdentifier>
          <Type>other</Type>
          <OtherType>stable</OtherType>
          <Value>ru-state-0081</Value>
        </ExternalIdentifier>
        <ExternalIdentifier>
          <Type>ocd-id</Type>
          <Value>ocd-division/country:de/state:hb</Value>
        </ExternalIdentifier>
      </ExternalIdentifiers>
      <InternationalizedName>
        <Text language="en">Bremen</Text>
      </InternationalizedName>
      <Name>Bremen</Name>
      <Type>state</Type>
    </GpUnit>
```