> ## Documentation Index
> Fetch the complete documentation index at: https://docs.countrystatecity.in/llms.txt
> Use this file to discover all available pages before exploring further.

# City Types

> Reference for the 35 distinct values of the cities.type field, their meanings, and how to filter down to genuine settlements

Every city record carries an optional `type` field describing what kind of place it is. The value is inherited from the upstream [GeoNames](https://www.geonames.org/) feature classification.

<Note>
  The `type` field mixes two ideas — *what a place is* (`city`, `town`, `village`) and *what administrative role it fills* (`adm2`, `county`, `parish`). The same place can be tagged either way. For example, **Dallas** is `adm2` because it is the seat of Dallas County, and major Australian cities are `adm1` because they are seats of state-level governments.
</Note>

## All Type Values

There are **35 distinct values** across **153,765** city rows.

| `type`                 |  Count | Settlement? | Meaning                                                                               |
| ---------------------- | -----: | :---------: | ------------------------------------------------------------------------------------- |
| `city`                 | 96,098 |      ✅      | Actual city                                                                           |
| `adm2`                 | 20,796 |      ✅      | 2nd-order admin division — usually a real city that is also a county/district seat    |
| `adm3`                 | 15,774 |      ✅      | Mostly real municipalities/communes tagged with their admin role                      |
| `section`              |  5,346 |      ✅      | Suburbs and districts of larger cities                                                |
| `county`               |  4,409 |      ❌      | County-level admin unit — not a settlement                                            |
| `adm4`                 |  3,909 |      ✅      | Similar mix to `adm3`                                                                 |
| `adm1`                 |  3,505 |      ✅      | 1st-order admin division — usually a state/region seat (e.g. major Australian cities) |
| `district`             |  2,381 |      ✅      | District-level populated place                                                        |
| *(null)*               |  1,900 |      ⚠️     | No type assigned — see below                                                          |
| `regency`              |    390 |      ❌      | Indonesian *kabupaten* — admin division                                               |
| `prefecture`           |    369 |      ❌      | Prefecture-level admin division                                                       |
| `locality`             |    319 |      ✅      | Named populated place                                                                 |
| `capital`              |    281 |      ✅      | National or regional capital                                                          |
| `municipality`         |    209 |      ✅      | Municipality                                                                          |
| `parish`               |     80 |      ❌      | Louisiana-style parish (= county)                                                     |
| `banner`               |     52 |      ❌      | Inner Mongolia *banner* — admin division                                              |
| `town`                 |     48 |      ✅      | Town                                                                                  |
| `province`             |     36 |      ❌      | Province-level admin division                                                         |
| `adm5`                 |     16 |      ✅      | 5th-order admin division (populated)                                                  |
| `abandoned`            |     15 |      ❌      | Abandoned place                                                                       |
| `cities`               |     13 |      ✅      | Data artifact of `city`                                                               |
| `area`                 |     12 |      ❌      | Generic administrative area                                                           |
| `village`              |     10 |      ✅      | Village                                                                               |
| `historical`           |      9 |      ❌      | Historical place — not a live settlement                                              |
| `settlement`           |      9 |      ✅      | Settlement                                                                            |
| `oblast`               |      8 |      ❌      | Oblast — admin division                                                               |
| `gov_seat`             |      6 |      ✅      | Government seat (populated)                                                           |
| `special municipality` |      6 |      ✅      | Special municipality                                                                  |
| `administrative zone`  |      5 |      ❌      | Administrative zone                                                                   |
| `region`               |      4 |      ❌      | Region-level admin division                                                           |
| `destroyed`            |      3 |      ❌      | Destroyed place                                                                       |
| `township`             |      3 |      ✅      | Township                                                                              |
| `religious`            |      2 |      ❌      | Religious site — not a settlement                                                     |
| `subdistrict`          |      1 |      ✅      | Subdistrict (populated)                                                               |
| `historical_capital`   |      1 |      ❌      | Former capital — not a live settlement                                                |

## Filtering to Genuine Settlements

For use cases like "find the nearest city to a location" or "populate a dropdown", you want to exclude admin-only and non-place types. Use an **exclusion list** rather than an inclusion list — any new settlement-style value added in the future is kept by default.

**Exclude these types:**

```
county, regency, prefecture, parish, banner, province, area, oblast,
administrative zone, region, abandoned, historical, destroyed, religious,
historical_capital
```

### SQL

```sql theme={null}
SELECT *
FROM cities
WHERE (
  type IS NULL
  OR type NOT IN (
    'county', 'regency', 'prefecture', 'parish', 'banner', 'province',
    'area', 'oblast', 'administrative zone', 'region',
    'abandoned', 'historical', 'destroyed', 'religious', 'historical_capital'
  )
)
AND latitude IS NOT NULL
AND longitude IS NOT NULL;
```

<Warning>
  `type NOT IN (...)` evaluates to `UNKNOWN` for rows where `type` is `NULL`, silently dropping them. The explicit `type IS NULL OR ...` keeps null-type rows. Remove the `type IS NULL` clause only if you want to exclude them.
</Warning>

### JavaScript

```javascript theme={null}
const EXCLUDED_TYPES = new Set([
  'county', 'regency', 'prefecture', 'parish', 'banner', 'province',
  'area', 'oblast', 'administrative zone', 'region',
  'abandoned', 'historical', 'destroyed', 'religious', 'historical_capital',
]);

const settlements = cities.filter(
  (c) => !EXCLUDED_TYPES.has(c.type) && c.latitude != null && c.longitude != null
);
```

### Python

```python theme={null}
EXCLUDED_TYPES = {
  'county', 'regency', 'prefecture', 'parish', 'banner', 'province',
  'area', 'oblast', 'administrative zone', 'region',
  'abandoned', 'historical', 'destroyed', 'religious', 'historical_capital',
}

settlements = [
  c for c in cities
  if c.get('type') not in EXCLUDED_TYPES
  and c.get('latitude') is not None
  and c.get('longitude') is not None
]
```

## Records with No Type

About **1,900** rows have a `null` type. They are a mix of legitimate places and unclassified entries. For strict settlement queries, the safest signal is the presence of valid coordinates (`latitude`/`longitude` not null), and — where available — a non-null `population`.

## Related

<CardGroup cols={2}>
  <Card title="Database Schema" icon="sitemap" href="/database/schema">
    Full cities table definition including the type field.
  </Card>

  <Card title="Multi-Level Territories" icon="map" href="/database/territories">
    How overseas territories and dual-modeled entities affect city queries.
  </Card>
</CardGroup>
