# Overlay coastline on tile

**URL:** <https://discourse.holoviz.org/t/overlay-coastline-on-tile/3052>\
**Category:** GeoViews\
**Created:** [November 8, 2021, 11:52am UTC](https://discourse.holoviz.org/t/overlay-coastline-on-tile/3052 "2021-11-08T11:52:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zxdawn](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/zxdawn/32/2325_2.png) [@zxdawn](https://discourse.holoviz.org/u/zxdawn)\
**Post date:** [November 8, 2021, 11:52am UTC](https://discourse.holoviz.org/t/overlay-coastline-on-tile/3052/1 "2021-11-08T11:52:54Z")

</div>

Hi, if there’s a image over map, we need to draw coastline to make it easier to read.

 ![image](https://discourse.holoviz.org/uploads/default/original/2X/4/407d030c111d48946568fdb5533c8656b1e5978c.jpeg)

I have tried this:

```auto
import geoviews as gv
import geoviews.feature as gf

gv.tile_sources.OSM() * gf.coastline.opts(projection=ccrs.GOOGLE_MERCATOR)

```

The result is wrong although the coastline has been reprojected.

 ![image](https://discourse.holoviz.org/uploads/default/original/2X/1/18895a841fec4de57dfec7a1100cb63b538f758e.png)

---

<div class="post-metadata">

**Author:** ![ahuang11](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/ahuang11/32/4947_2.png) [@ahuang11](https://discourse.holoviz.org/u/ahuang11)\
**Post date:** [November 8, 2021, 4:48pm UTC](https://discourse.holoviz.org/t/overlay-coastline-on-tile/3052/2 "2021-11-08T16:48:30Z")

</div>

What if you just do

```auto
import geoviews as gv
import cartopy.crs as ccrs
gv.extension("bokeh")

gv.Points(([-88], [40])).opts(projection=ccrs.GOOGLE_MERCATOR, global_extent=True) * gv.feature.coastline() * gv.tile_sources.OSM()

```

![image](https://discourse.holoviz.org/uploads/default/original/2X/b/b9a2e422bfed44b86fd36c71c344d01168b6b7eb.png)

---

<div class="post-metadata">

**Author:** ![ahuang11](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/ahuang11/32/4947_2.png) [@ahuang11](https://discourse.holoviz.org/u/ahuang11)\
**Post date:** [November 8, 2021, 4:49pm UTC](https://discourse.holoviz.org/t/overlay-coastline-on-tile/3052/3 "2021-11-08T16:49:52Z")

</div>

Another way:

```auto
import xarray as xr
import hvplot.xarray
ds = xr.tutorial.open_dataset("air_temperature")
ds.hvplot("lon", "lat", coastline=True, projection="GOOGLE_MERCATOR")

```

 ![image](https://discourse.holoviz.org/uploads/default/original/2X/a/a87e77232a7d2a340427aa4492c565a596b5c924.png)

---

<div class="post-metadata">

**Author:** ![zxdawn](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/zxdawn/32/2325_2.png) [@zxdawn](https://discourse.holoviz.org/u/zxdawn)\
**Post date:** [November 8, 2021, 5:34pm UTC](https://discourse.holoviz.org/t/overlay-coastline-on-tile/3052/4 "2021-11-08T17:34:02Z")

</div>

Ha, interesting. `Projected points` \* `coastline` \* `tile` works. Don’t know the logic behind it, hah. Anyway, thanks for the solution.

---

<div class="post-metadata">

**Author:** ![ahuang11](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/ahuang11/32/4947_2.png) [@ahuang11](https://discourse.holoviz.org/u/ahuang11)\
**Post date:** [November 8, 2021, 6:26pm UTC](https://discourse.holoviz.org/t/overlay-coastline-on-tile/3052/5 "2021-11-08T18:26:06Z")

</div>

> [@zxdawn](#):
>
> `gv.tile_sources.OSM() * gf.coastline.opts(projection=ccrs.GOOGLE_MERCATOR)`

I think this works too if you zoom out / set .opts(global\_extent=True)
