# Set extent for WMTS tile

**URL:** <https://discourse.holoviz.org/t/set-extent-for-wmts-tile/3049>\
**Category:** GeoViews\
**Created:** [November 7, 2021, 9:40pm UTC](https://discourse.holoviz.org/t/set-extent-for-wmts-tile/3049 "2021-11-07T21:40:37Z")\
**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 7, 2021, 9:40pm UTC](https://discourse.holoviz.org/t/set-extent-for-wmts-tile/3049/1 "2021-11-07T21:40:37Z")

</div>

When setting the extent of WMTS tiles, we should convert degree to pass them as `xlim` or `ylim`.  
Here’s the example:

```auto
import geoviews as gv
from pyproj import Proj, transform

inProj = Proj(init='epsg:4326')
outProj = Proj(init='epsg:3857')

arctic_lon1, arctic_lat1 = transform(inProj,outProj,-180,60)
arctic_lon2, arctic_lat2 = transform(inProj,outProj,180,90)

gv.tile_sources.OSM().opts(xlim=(arctic_lon1, arctic_lon2), ylim=(arctic_lat1, arctic_lat2))

```

However, some white stripes exist on the top. Is it possible to crop correctly?

 ![image](https://discourse.holoviz.org/uploads/default/original/2X/7/7c4f689982565fc83927dc5739475bb88f5e03da.jpeg)

---

<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:57pm UTC](https://discourse.holoviz.org/t/set-extent-for-wmts-tile/3049/2 "2021-11-08T16:57:30Z")

</div>

> [@zxdawn](#):
>
> ```auto
> import geoviews as gv
> from pyproj import Proj, transform
> 
> inProj = Proj(init='epsg:4326')
> outProj = Proj(init='epsg:3857')
> 
> arctic_lon1, arctic_lat1 = transform(inProj,outProj,-180,60)
> arctic_lon2, arctic_lat2 = transform(inProj,outProj,180,90)
> 
> gv.tile_sources.OSM().opts(xlim=(arctic_lon1, arctic_lon2), ylim=(arctic_lat1, arctic_lat2))
> 
> ```

I think you can just change the width/height aspect

```auto
gv.Points(([-88], [40])).opts(projection=ccrs.GOOGLE_MERCATOR, global_extent=True, width=800, height=400) * gv.feature.coastline() * gv.tile_sources.OSM()

```

Or `aspect=2`

 ![image](https://discourse.holoviz.org/uploads/default/original/2X/0/0403f70d9ba6ae5b362813e5cdeea490121ad948.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:33pm UTC](https://discourse.holoviz.org/t/set-extent-for-wmts-tile/3049/3 "2021-11-08T17:33:05Z")

</div>

Thanks, but the default view I want is the Arctic region (60\<lat\<90, -180\<lon\<180).

---

<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:32pm UTC](https://discourse.holoviz.org/t/set-extent-for-wmts-tile/3049/4 "2021-11-08T18:32:25Z")

</div>

`gv.tile_sources.OSM().opts(xlim=(arctic_lon1, arctic_lon2), ylim=(arctic_lat1, arctic_lat2), aspect=360/30)`

---

<div class="post-metadata">

**Author:** ![dr\_clank](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/dr_clank/32/1910_2.png) [@dr\_clank](https://discourse.holoviz.org/u/dr_clank)\
**Post date:** [November 8, 2021, 8:57pm UTC](https://discourse.holoviz.org/t/set-extent-for-wmts-tile/3049/5 "2021-11-08T20:57:35Z")

</div>

In your original example the map is being limited correctly to 90°. You’re getting white space because there are no map tiles above ~85°. The web mercator coordinate system doesn’t extend beyond 85°.

> **[WGS 84 / Pseudo-Mercator - Spherical Mercator, Google Maps, OpenStreetMap,...](https://epsg.io/3857)**
>
> EPSG:3857 Projected coordinate system for World between 85.06°S and 85.06°N. Uses spherical development of ellipsoidal coordinates. Relative to WGS 84 / World Mercator (CRS code 3395) errors of 0.7 percent in scale and differences in northing of up...

`Area of use: World between 85.06°S and 85.06°N.`
