# Interpolating data on a spherical shell

**URL:** <https://discourse.julialang.org/t/interpolating-data-on-a-spherical-shell/130584>\
**Category:** Offtopic\
**Created:** [July 9, 2025, 6:45pm UTC](https://discourse.julialang.org/t/interpolating-data-on-a-spherical-shell/130584 "2025-07-09T18:45:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![trung](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/trung/32/49217_2.png) [@trung](https://discourse.julialang.org/u/trung)\
**Post date:** [July 9, 2025, 6:45pm UTC](https://discourse.julialang.org/t/interpolating-data-on-a-spherical-shell/130584/1 "2025-07-09T18:45:19Z")

</div>

I currently have data that is set on a spherical shell. The data that I have is something like temperature. The coordinates associated with temperature are in latitude and longitude. The latitude has a regular spacing of 1 degree while the longitude has a regular spacing of 2 degree. What are the methods that you would suggest to interpolate the temperature for a given latitude and longitude (i.e. latitude = 42.3 degrees and longitude = 23.9 degrees)?

---

<div class="post-metadata">

**Author:** ![raman\_kumar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raman_kumar/32/26782_2.png) [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Post date:** [July 9, 2025, 6:58pm UTC](https://discourse.julialang.org/t/interpolating-data-on-a-spherical-shell/130584/2 "2025-07-09T18:58:32Z")

</div>

You can use Meshes.jl to create a [Sphere](https://juliageometry.github.io/MeshesDocs/stable/domains/meshes/#Meshes.StructuredGrid). You can supply _Temperature_ array to color variable.

```julia
using Meshes, GLMakie, CoordRefSystems
# grid with latitude and longitude coordinates
LAT = [i for i in -90.0 : 0.1 : 90.0, j in 0.0 : 2.0 : 360.0]
LON = [j for i in -90.0 : 0.1 : 90.0, j in 0.0 : 2.0 : 360.0]
C = typeof(LatLon(0, 0))
grid = StructuredGrid{🌐,C}(LAT, LON)

viz(grid, color = 1:nvertices(grid))

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/a/d/ad9d049110d3198b42670f9152602350b474ae9d.png)

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [July 9, 2025, 7:11pm UTC](https://discourse.julialang.org/t/interpolating-data-on-a-spherical-shell/130584/3 "2025-07-09T19:11:40Z")

</div>

@trung highly recommend reading the GeoStats.jl docs in the interpolation section. If you load your data from a file format recognized by GeoIO.jl, all you need to do is call the `Interpolate` or `InterpolateNeighbors` transforms.

We are gradually adding spherical methods inside these high-level routines. Currently, they will convert the distances to Euclidean distances using the actual size of the Earth.

Also, check this workshop material I prepared for the FOSS4G conference last year:

> **[GitHub - Arpeggeo/FOSS4G2024: GeoStats.jl @ FOSS4G 2024](https://github.com/Arpeggeo/FOSS4G2024)**
>
> GeoStats.jl @ FOSS4G 2024

It is very much related to your question.

---

<div class="post-metadata">

**Author:** ![trung](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/trung/32/49217_2.png) [@trung](https://discourse.julialang.org/u/trung)\
**Post date:** [July 9, 2025, 9:29pm UTC](https://discourse.julialang.org/t/interpolating-data-on-a-spherical-shell/130584/4 "2025-07-09T21:29:03Z")

</div>

Thanks for the link for the workshop and GeoStats.jl for ideas on interpolations on a sphere. Unfortunately, the data uses the IDL format which seems to be unsupported by GeoIO.jl.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [July 9, 2025, 9:35pm UTC](https://discourse.julialang.org/t/interpolating-data-on-a-spherical-shell/130584/5 "2025-07-09T21:35:31Z")

</div>

You can load the data into normal Julia arrays and then use the georef function to convert to a geotable. That is what GeoIO.jl does. Let me know if the docs are not clear.
