# DCW. Get list of states within a country?

**URL:** <https://forum.generic-mapping-tools.org/t/dcw-get-list-of-states-within-a-country/2076>\
**Category:** Q&A\
**Created:** [September 10, 2021, 4:51pm UTC](https://forum.generic-mapping-tools.org/t/dcw-get-list-of-states-within-a-country/2076 "2021-09-10T16:51:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [September 10, 2021, 4:51pm UTC](https://forum.generic-mapping-tools.org/t/dcw-get-list-of-states-within-a-country/2076/1 "2021-09-10T16:51:58Z")

</div>

A can get a list of countries within a continent with

`gmt coast -E=SA+l`

Is there any way to get the same with a country and its states?

Something like `gmt coast -Ecountry+L`?

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [September 10, 2021, 6:10pm UTC](https://forum.generic-mapping-tools.org/t/dcw-get-list-of-states-within-a-country/2076/2 "2021-09-10T18:10:33Z")

</div>

Something like a gmt version of

```auto
grep "US" /usr/local/Cellar/gmt/HEAD-c796a90_1/share/gmt/dcw/dcw-states.txt 

```

?

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [September 12, 2021, 9:24pm UTC](https://forum.generic-mapping-tools.org/t/dcw-get-list-of-states-within-a-country/2076/3 "2021-09-12T21:24:47Z")

</div>

For the record. Now fix in master version.

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [September 12, 2021, 9:33pm UTC](https://forum.generic-mapping-tools.org/t/dcw-get-list-of-states-within-a-country/2076/4 "2021-09-12T21:33:30Z")

</div>

Another question.  
If a run `gmt coast -E=SA+gred+p -png mapa -Baf` I get a map of South America with the boundaries of its countries (from the DCW dataset).

 ![mapa](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/5/5c65f180a32fe6b05e850e80a298bd151ffad49d.png)

How can I get the same for the countries which have states data (i.e. the country with the states boundaries from the DCW dataset)? Is is possible?

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [September 13, 2021, 4:41pm UTC](https://forum.generic-mapping-tools.org/t/dcw-get-list-of-states-within-a-country/2076/5 "2021-09-13T16:41:28Z")

</div>

Like `coast -N` ?

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [September 13, 2021, 5:18pm UTC](https://forum.generic-mapping-tools.org/t/dcw-get-list-of-states-within-a-country/2076/6 "2021-09-13T17:18:36Z")

</div>

I think -N uses the GSHHG dataset. I want to use the DCW dataset. In the previous map will only show the boundaries of the states of Brazil and Argentina.

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [September 13, 2021, 6:40pm UTC](https://forum.generic-mapping-tools.org/t/dcw-get-list-of-states-within-a-country/2076/7 "2021-09-13T18:40:38Z")

</div>

The problem is that DCW are polygons and you do not want to draw that outline as “political boundary” as you end up painting coastlines as well.

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [September 13, 2021, 6:50pm UTC](https://forum.generic-mapping-tools.org/t/dcw-get-list-of-states-within-a-country/2076/8 "2021-09-13T18:50:01Z")

</div>

I am ok with coastlines (as in the case of SA map).
