# Border coordinates

**URL:** <https://forum.generic-mapping-tools.org/t/border-coordinates/2037>\
**Category:** Q&A\
**Created:** [August 28, 2021, 11:41am UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037 "2021-08-28T11:41:31Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![palbi](https://avatars.discourse-cdn.com/v4/letter/p/ed655f/32.png) [@palbi](https://forum.generic-mapping-tools.org/u/palbi)\
**Post date:** [August 28, 2021, 11:41am UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037/1 "2021-08-28T11:41:31Z")

</div>

Dear All,  
I need to create a DB with all the coordinates like: 44.292951, 12.349290 of the borders nations. like Italy.  
Is there anybody that can help me to understand the best way to do this?

thank you a lot

---

<div class="post-metadata">

**Author:** ![seisman](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/seisman/32/4_2.png) [@seisman](https://forum.generic-mapping-tools.org/u/seisman)\
**Post date:** [August 28, 2021, 2:06pm UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037/2 "2021-08-28T14:06:38Z")

</div>

Is this what you need?

`gmt coast -EIT -M > Italy.txt`

---

<div class="post-metadata">

**Author:** ![palbi](https://avatars.discourse-cdn.com/v4/letter/p/ed655f/32.png) [@palbi](https://forum.generic-mapping-tools.org/u/palbi)\
**Post date:** [August 28, 2021, 2:45pm UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037/3 "2021-08-28T14:45:20Z")

</div>

> [@seisman](#):
>
> gmt coast -EIT -M \> Italy.txt

Dear Seisman, thank you. The file is created but show some coordinates in Eritrea, not Italy  
do I wrong something?  
thank you a lot

---

<div class="post-metadata">

**Author:** ![seisman](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/seisman/32/4_2.png) [@seisman](https://forum.generic-mapping-tools.org/u/seisman)\
**Post date:** [August 28, 2021, 2:59pm UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037/4 "2021-08-28T14:59:48Z")

</div>

Running `gmt coast -EIT -M | gmt plot -Baf -png map` gives me the following figure:

 ![map](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/c/c7d110021f6b468c547bc6d54007c5056c0dea95.png)

It looks correct, but I’m not familiar with European countries.

---

<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:** [August 28, 2021, 5:46pm UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037/5 "2021-08-28T17:46:33Z")

</div>

```
gmt coast -EIT -M | gmt info

<Standard Input>: N = 8276 <6.614898/18.513316439> <35.492207/47.0950299496>

```

Surely not Eritrea!

---

<div class="post-metadata">

**Author:** ![palbi](https://avatars.discourse-cdn.com/v4/letter/p/ed655f/32.png) [@palbi](https://forum.generic-mapping-tools.org/u/palbi)\
**Post date:** [August 28, 2021, 6:06pm UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037/6 "2021-08-28T18:06:36Z")

</div>

> [@pwessel](#):
>
> `gmt coast -EIT -M | gmt info`

I was wrong, my sorries  
it works  
THANK YOU

---

<div class="post-metadata">

**Author:** ![palbi](https://avatars.discourse-cdn.com/v4/letter/p/ed655f/32.png) [@palbi](https://forum.generic-mapping-tools.org/u/palbi)\
**Post date:** [August 28, 2021, 6:07pm UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037/7 "2021-08-28T18:07:07Z")

</div>

Sure my wrong  
thank you

---

<div class="post-metadata">

**Author:** ![palbi](https://avatars.discourse-cdn.com/v4/letter/p/ed655f/32.png) [@palbi](https://forum.generic-mapping-tools.org/u/palbi)\
**Post date:** [August 28, 2021, 6:07pm UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037/8 "2021-08-28T18:07:43Z")

</div>

Thank you seisman thank you a lot

---

<div class="post-metadata">

**Author:** ![palbi](https://avatars.discourse-cdn.com/v4/letter/p/ed655f/32.png) [@palbi](https://forum.generic-mapping-tools.org/u/palbi)\
**Post date:** [August 28, 2021, 6:21pm UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037/9 "2021-08-28T18:21:16Z")

</div>

I’m sorry may I ask?  
How can I do for europe and world?

---

<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:** [August 28, 2021, 7:12pm UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037/10 "2021-08-28T19:12:36Z")

</div>

THere are many ways, but it depends on what you want to use it for. Tell us what you are trying to achieve and then we can recommend the best solution.

---

<div class="post-metadata">

**Author:** ![palbi](https://avatars.discourse-cdn.com/v4/letter/p/ed655f/32.png) [@palbi](https://forum.generic-mapping-tools.org/u/palbi)\
**Post date:** [August 28, 2021, 7:33pm UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037/12 "2021-08-28T19:33:44Z")

</div>

thank you pwessel, I need coordinates of coast line (shore). full definition -Df for

this work well: gmt coast -EIT -M \> Italy.txt

is it possible only shorelines? and extend the zone, like europe?

thank you a lot

---

<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:** [August 28, 2021, 8:31pm UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037/13 "2021-08-28T20:31:05Z")

</div>

=EU should give you all of Europe. But again the best approach depends on what you want to do and I do not know what to recommend.

---

<div class="post-metadata">

**Author:** ![palbi](https://avatars.discourse-cdn.com/v4/letter/p/ed655f/32.png) [@palbi](https://forum.generic-mapping-tools.org/u/palbi)\
**Post date:** [August 29, 2021, 1:40pm UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037/14 "2021-08-29T13:40:09Z")

</div>

Dear pwessel, I need to find a way to build a DB with the coordinates of the line of a determinate coast. I just need a txt file with this coordinate as much accurate possible.

For istante I’d need to get the coordinates of the shoreline of the pictures.

 ![Schermata 2021-08-29 alle 11.17.27](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/7/7094862e97a2b7fa803f600559c0759a558a51ff.jpeg)

---

<div class="post-metadata">

**Author:** ![palbi](https://avatars.discourse-cdn.com/v4/letter/p/ed655f/32.png) [@palbi](https://forum.generic-mapping-tools.org/u/palbi)\
**Post date:** [August 29, 2021, 2:19pm UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037/15 "2021-08-29T14:19:00Z")

</div>

for istante I’d need a txt file with the coordinates of the shoreline of:

#!/bin/bash  
gmt begin word png  
gmt coast -R9:25/41:15/9:30/41:30r -Ggreen -Df  
gmt end show

![asinara](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/2/27ec4c08c763b92906f77eb6bcec9db67ce16d3d.png)

---

<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:** [August 29, 2021, 9:03pm UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037/16 "2021-08-29T21:03:28Z")

</div>

The highest resolution data will be from gmt coast -M -Rsomearea. -Df. I cannot advise beyond that since I still do not know the purpose of all of this, such as if grids will be involved, distances to coast, etc etc. for which different approaches may make more sense.

---

<div class="post-metadata">

**Author:** ![palbi](https://avatars.discourse-cdn.com/v4/letter/p/ed655f/32.png) [@palbi](https://forum.generic-mapping-tools.org/u/palbi)\
**Post date:** [August 30, 2021, 7:14am UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037/17 "2021-08-30T07:14:23Z")

</div>

Dear Paul, thank you very much for your help. Distance to coast is what I’m looking for.

would this work:

gmt coast -M -R9:25/41:15/9:30/41:30r -Df\> Italy.txt

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [August 30, 2021, 12:44pm UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037/18 "2021-08-30T12:44:44Z")

</div>

Pay attention to the fact that the coastlines in GMT are from last century and use a different datum than your likely position points. The difference between WGS84 and the datum used in the coastlines data is about 400 m. In an area of ~10x10 km that can be a non-negligible offset.

---

<div class="post-metadata">

**Author:** ![palbi](https://avatars.discourse-cdn.com/v4/letter/p/ed655f/32.png) [@palbi](https://forum.generic-mapping-tools.org/u/palbi)\
**Post date:** [September 1, 2021, 4:28pm UTC](https://forum.generic-mapping-tools.org/t/border-coordinates/2037/19 "2021-09-01T16:28:07Z")

</div>

dear Joaquim, thank you for your post. it is not then the right way for what I need.  
thank you
