# \[ANN\] GeoStats.jl - Geospatial Data Science and Geostatistical Modeling in Julia

**URL:** <https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054>\
**Category:** Package Announcements\
**Tags:** package, announcement, statistics, geo, geostatistics\
**Created:** [July 1, 2023, 4:10pm UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054 "2023-07-01T16:10:30Z")\
**Posts on this page:** 20\
**Page:** 1

<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 1, 2023, 4:10pm UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/1 "2023-07-01T16:10:30Z")

</div>

> This topic will be used for future release updates of the [GeoStats.jl](https://github.com/JuliaEarth/GeoStats.jl) framework. Past topics can be found at [v0.10](https://discourse.julialang.org/t/ann-geostats-jl-v0-10/30436), [v0.11](https://discourse.julialang.org/t/ann-geostats-jl-v0-11/36909), [v0.14](https://discourse.julialang.org/t/ann-geostats-jl-v0-14/43230), [v0.18](https://discourse.julialang.org/t/ann-geostats-jl-v0-18/48951), [v0.24](https://discourse.julialang.org/t/ann-geostats-jl-v0-24/58585), [v0.33](https://discourse.julialang.org/t/geostats-jl-v0-33/86516) and [v0.36](https://discourse.julialang.org/t/ann-geostats-jl-v0-36/90708).

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

# OVERVIEW

GeoStats.jl v0.40 is out with [revised documentation](https://juliaearth.github.io/GeoStats.jl/stable) using Makie.jl recipes, new algorithms for simulation of [spatial point patterns](https://juliaearth.github.io/GeoStats.jl/stable/pointpatterns/pointprocs.html), and important improvements in geometric algorithms.

**This is the last release with support for Julia v1.6 (LTS), next releases will require Julia v1.9.**

# RELEASE NOTES

## FEATURES

- New `Repair` transforms for fixing ill-formed meshes and geometries. These repair operations are parameterized with a number (e.g. `Repair{0}`) that is documented [here](https://juliageometry.github.io/Meshes.jl/stable/transforms.html#Repair).
- Parameterization of geometries meaning that now one can call geometries as `segment(t)` with t \in [0,1] or `quad(u, v)` with (u, v) \in [0,1]^2 or `hex(u, v, w)` with (u, v, w) \in [0,1]^3 to get points in these geometries. The function `isparameterized` can be used to check if an implementation is available for a given geometry.
- New `JarvisMarch` convex hull algorithm for 2D point sets besides the existing `GrahamScan` algorithm. This algorithm has O(nh) complexity where n is the number of points and h is the number of points in the hull. Compare it with the `GrahamScan` algorithm, which has O(n^2) complexity and you can see the speed up clearly when the convex hull has a very small number of vertices compared to the original point set (see [docs](https://juliageometry.github.io/Meshes.jl/stable/algorithms/hulls.html)).
- New `merge` operation between geometries and meshes.
- New `vertex` function to retrieve a single vertex of a `Polytope` geometry or `Domain`.
- New `pointify` function to extract “vertices” of geometries even when they are not expressed in terms of a finite set of vertices. This function was useful to generalize some transforms and algorithms.
- New `Primitive` geometries such as `Cone`, `ConeSurface`, `Torus` (see [docs](https://juliageometry.github.io/Meshes.jl/stable/geometries/primitives.html)).
- New `MultiGridPath` to traverse `Grid` subtypes in a hierarchical order.
- New `Selinger` simplification algorithm to simplify polygons and closed chains (see [docs](https://juliageometry.github.io/Meshes.jl/stable/algorithms/simplification.html)).
- New `Potrace` transform to trace closed regions with holes in raster images (see [docs](https://juliaearth.github.io/GeoStats.jl/stable/transforms.html#Potrace)).
- New `Detrend` transform to remove trends from geospatial data over any domain (see [docs](https://juliaearth.github.io/GeoStats.jl/stable/transforms.html#Detrend)).
- New inhomogeneous `PoissonProcess`, `InhibitionProcess` and `ClusterProcess` (see [docs](https://juliaearth.github.io/GeoStats.jl/stable/pointpatterns/pointprocs.html))

## IMPROVEMENTS

- Improvements to the default triangulation algorithm for polygons, which now performs a couple of repairs to the vertices before actual triangulation. This improvement was implemented to handle real data in agriculture projects at [Arpeggeo®](https://arpeggeo.tech/).
- Less memory allocations in `Chain` algorithms that are now specialized for `Ring` and `Rope` subtypes.
- Various implementations of missing methods for various geometry types such as discretization, sampling, convexhull, etc.
- `hasintersect` methods for all 0D, 1D and 2D geometries. This means that we can now easily filter a heterogeneous collection of geometries that intersect any other geometry in 2D space (see [docs](https://juliageometry.github.io/Meshes.jl/stable/algorithms/intersection.html)).
- `Point` is now a `Geometry` subtype. This enabled the generalization of a few algorithms in the stack.
- `Segment` is now a `Chain` which is equivalent to a `Polytope{1}`.
- Improvement of IO methods for geometries to display more meaningful names in interactive use.
- Support for progress logging in all geostatistical simulation solvers.
- The new documentation now makes extensive use of the visualization stack built with Makie.jl. The visualization stack built with Plots.jl is already in maintenance mode.
- Various improvements to the [GeoTables.jl](https://github.com/JuliaEarth/GeoTables.jl) package that can now load and save all types of geospatial data from disk including shp, geojson, gpkg, kml using pure Julia backends whenever possible. The package also implements fixes to the different backend’s results to improve the experience of end-users who don’t know or wan’t to deal with low-level interfaces.

## BREAKING

- Replace passive rotations from [ReferenceFrameRotations.jl](https://github.com/JuliaSpace/ReferenceFrameRotations.jl) by active rotations from [Rotations.jl](https://github.com/JuliaGeometry/Rotations.jl)
- Replace `Chain` concrete type by an abstract type with two subtypes `Ring` (for closed chains) and `Rope` (for open chains). This way the closedness is part of the type, and we can avoid some internal copies of vertices.
- Replace `Collection` by `GeometrySet` and add support for heterogeneous collections of geometries. This means that points, segments, rings, polygons, etc. can be processed together in some algorithms.
- Refactoring of `IntersectionType` to a reduced list of types. This code simplification enabled more flexible intersections with meshes and domain types and also improved maintainability.  
Refactoring of `Cylinder` and `CylinderSurface` constructors for greater usability.
- Replace `uniquecoords` by `UniqueCoords` transform.

### Acknowledgements

Thanks to all contributors that made this release possible 🫶 :julia: 🌍

DianaPat jwscook vickydeka lihua-cat @stla @dorn-gerhard @jackbeagley @cserteGT3 @kylebeggs @ErickChacon @mfsch @longemen3000 @hyrodium conordoherty spaette @eliascarv

Would like to support us? Leave a ⭐ on GitHub if you didn’t already!

> **[GitHub - JuliaEarth/GeoStats.jl: An extensible framework for geospatial data...](https://github.com/JuliaEarth/GeoStats.jl)**
>
> An extensible framework for geospatial data science and geostatistical modeling fully written in Julia

---

<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:** [August 8, 2023, 7:11pm UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/2 "2023-08-08T19:11:59Z")

</div>

# [GeoStats.jl v0.42](https://juliaearth.github.io/GeoStats.jl/stable)

## OVERVIEW

This release comes with various **performance improvements** after a complete review of Meshes.jl internals to use static lists of vertices in geometries whenever possible. We reviewed many algorithms, which are now free of unnecessary memory allocations, implemented geometric optimizations, and **fixed various bugs** found within industrial applications.

The project now uses package extensions from Julia v1.9 to load Makie.jl recipes automatically for end users. This means that _all recipe packages (e.g. GeoStatsPlots.jl and GeoStatsViz.jl) are deprecated_.

Users can now start their geospatial data science workflows with:

```julia
using GeoStats

import GLMakie as Mke # choose a backend

```

We highly recommend reading the updated [Quickstart](https://juliaearth.github.io/GeoStats.jl/stable/quickstart.html).

## FEATURES

- New robust estimator of variograms by Cressie & Hawkins (see [docs](https://juliaearth.github.io/GeoStats.jl/stable/variography/empirical.html#Variography.EmpiricalVariogram))
- New `CylindricalTrajectory` domain to represent wells in geosciences (see [docs](https://juliageometry.github.io/MeshesDocs/dev/domains/trajectories.html))
- New recipes for plotting variograms and varioplanes (see [docs](https://juliaearth.github.io/GeoStats.jl/stable/variography/empirical.html))

## IMPROVEMENTS

- Estimation solvers (Kriging, IDW, LWR) now make use of a consistent set of neighborhood search methods and domain traversal options
- Estimation (a.k.a. Interpolation) with Unitful.jl objects works with all solvers now, including affine units, which are automatically converted to absolute units (e.g. Celsius → Kelvin)
- All loss functions from the LossFunctions.jl submodule are reexported by default
- DensityRationEstimation.jl now loads optimization backends with package extensions
- Better documentation for our geometric predicates (see [docs](https://juliageometry.github.io/MeshesDocs/dev/predicates.html))

### Acknowledgements

We would like to acknowledge all contributors and supporters of this project. It is been super fun to develop it more, and continuously apply it in industry. We fixed tons of bugs and corner cases these last months with real data, and will continue to do so.

This last week we reached 5k tests in our Meshes.jl submodule alone, and this is evidence of our commitment to provide a robust experience to our users.

Join our community channel if you would like to receive more updates:

[https://julialang.zulipchat.com/#narrow/stream/276201-geostats.2Ejl](https://julialang.zulipchat.com/#narrow/stream/276201-geostats.2Ejl)

---

<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:** [November 6, 2023, 9:33pm UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/3 "2023-11-06T21:33:52Z")

</div>

# [GeoStats.jl v0.47](https://juliaearth.github.io/GeoStatsDocs/stable)

## OVERVIEW

Various new features described in the [Geospatial Data Science with Julia](https://juliaearth.github.io/geospatial-data-science-with-julia) book and other improvements to the end-user experience.

## FEATURES

- New GeoTables.jl implementation with better methods, including efficient show methods with PrettyTables.jl:

```julia
julia> georef((a=rand(10, 10), b=rand(Int, 10, 10)))
100×3 GeoTable over 10×10 CartesianGrid{2,Float64}
┌────────────┬──────────────────────┬─────────────────────────────────────────┐
│ a │ b │ geometry │
│ Continuous │ Categorical │ Quadrangle │
│ [NoUnits] │ [NoUnits] │ │
├────────────┼──────────────────────┼─────────────────────────────────────────┤
│ 0.516603 │ 6789588642647594681 │ Quadrangle((0.0, 0.0), ..., (0.0, 1.0)) │
│ 0.998433 │ 9150524320540539883 │ Quadrangle((1.0, 0.0), ..., (1.0, 1.0)) │
│ 0.263977 │ 4931893769895542016 │ Quadrangle((2.0, 0.0), ..., (2.0, 1.0)) │
│ 0.427032 │ -3491437907112294822 │ Quadrangle((3.0, 0.0), ..., (3.0, 1.0)) │
│ 0.906068 │ -7822066656579038303 │ Quadrangle((4.0, 0.0), ..., (4.0, 1.0)) │
│ 0.556998 │ -2408182908005467907 │ Quadrangle((5.0, 0.0), ..., (5.0, 1.0)) │
│ 0.881187 │ -1985601647472655905 │ Quadrangle((6.0, 0.0), ..., (6.0, 1.0)) │
│ 0.64524 │ -4982792138183876424 │ Quadrangle((7.0, 0.0), ..., (7.0, 1.0)) │
│ 0.495152 │ -5114448186852198900 │ Quadrangle((8.0, 0.0), ..., (8.0, 1.0)) │
│ 0.288213 │ 8738486151747287386 │ Quadrangle((9.0, 0.0), ..., (9.0, 1.0)) │
│ 0.0709234 │ -4113799560159813356 │ Quadrangle((0.0, 1.0), ..., (0.0, 2.0)) │
│ 0.223479 │ 5773465236920674180 │ Quadrangle((1.0, 1.0), ..., (1.0, 2.0)) │
│ 0.940171 │ -3409105571799614662 │ Quadrangle((2.0, 1.0), ..., (2.0, 2.0)) │
│ 0.139222 │ 4016690596386790401 │ Quadrangle((3.0, 1.0), ..., (3.0, 2.0)) │
│ 0.81553 │ 5437077184799252660 │ Quadrangle((4.0, 1.0), ..., (4.0, 2.0)) │
│ 0.734611 │ -9116300046534728476 │ Quadrangle((5.0, 1.0), ..., (5.0, 2.0)) │
│ 0.827469 │ -1031902277811757514 │ Quadrangle((6.0, 1.0), ..., (6.0, 2.0)) │
│ 0.463852 │ -7694874758022304794 │ Quadrangle((7.0, 1.0), ..., (7.0, 2.0)) │
│ 0.430009 │ 383006486861661319 │ Quadrangle((8.0, 1.0), ..., (8.0, 2.0)) │
│ 0.114523 │ -6621173923176021272 │ Quadrangle((9.0, 1.0), ..., (9.0, 2.0)) │
│ 0.453332 │ -9063031855995266727 │ Quadrangle((0.0, 2.0), ..., (0.0, 3.0)) │
│ 0.848071 │ -2619300603579320095 │ Quadrangle((1.0, 2.0), ..., (1.0, 3.0)) │
│ 0.791306 │ 5963621929024569325 │ Quadrangle((2.0, 2.0), ..., (2.0, 3.0)) │
│ 0.0642176 │ 2203217482885317616 │ Quadrangle((3.0, 2.0), ..., (3.0, 3.0)) │
│ 0.420784 │ -5727490695202776996 │ Quadrangle((4.0, 2.0), ..., (4.0, 3.0)) │
│ 0.468374 │ 9193956341378230306 │ Quadrangle((5.0, 2.0), ..., (5.0, 3.0)) │
│ 0.836219 │ 8769101217160787406 │ Quadrangle((6.0, 2.0), ..., (6.0, 3.0)) │
│ 0.473154 │ 7874585605426519179 │ Quadrangle((7.0, 2.0), ..., (7.0, 3.0)) │
│ 0.507466 │ -3296044975691403512 │ Quadrangle((8.0, 2.0), ..., (8.0, 3.0)) │
│ 0.973035 │ 2395941252317957301 │ Quadrangle((9.0, 2.0), ..., (9.0, 3.0)) │
│ 0.12081 │ 7515712133164922671 │ Quadrangle((0.0, 3.0), ..., (0.0, 4.0)) │
│ ⋮ │ ⋮ │ ⋮ │
└────────────┴──────────────────────┴─────────────────────────────────────────┘
                                                                69 rows omitted

```

- New DataScienceTraits.jl in place of ScientificTypes.jl with better support for Unitful.jl, DynamicQuantities.jl and `missing` values.
- New GeoStatsProcesses.jl with stochastic fields and point processes
- New GeoStatsTransforms.jl with various advanced geostatistical transforms
- New GeoIO.jl for saving/loading geotables to different file formats
- New GeoArtifacts.jl for loading geotables from different databases
- Support for geotables with geometry column only:

```julia
julia> georef(nothing, CartesianGrid(10,10))
100×1 GeoTable over 10×10 CartesianGrid{2,Float64}
┌─────────────────────────────────────────┐
│ geometry │
│ Quadrangle │
│ │
├─────────────────────────────────────────┤
│ Quadrangle((0.0, 0.0), ..., (0.0, 1.0)) │
│ Quadrangle((1.0, 0.0), ..., (1.0, 1.0)) │
│ Quadrangle((2.0, 0.0), ..., (2.0, 1.0)) │
│ Quadrangle((3.0, 0.0), ..., (3.0, 1.0)) │
│ Quadrangle((4.0, 0.0), ..., (4.0, 1.0)) │
│ Quadrangle((5.0, 0.0), ..., (5.0, 1.0)) │
│ Quadrangle((6.0, 0.0), ..., (6.0, 1.0)) │
│ Quadrangle((7.0, 0.0), ..., (7.0, 1.0)) │
│ Quadrangle((8.0, 0.0), ..., (8.0, 1.0)) │
│ Quadrangle((9.0, 0.0), ..., (9.0, 1.0)) │
│ Quadrangle((0.0, 1.0), ..., (0.0, 2.0)) │
│ Quadrangle((1.0, 1.0), ..., (1.0, 2.0)) │
│ Quadrangle((2.0, 1.0), ..., (2.0, 2.0)) │
│ Quadrangle((3.0, 1.0), ..., (3.0, 2.0)) │
│ Quadrangle((4.0, 1.0), ..., (4.0, 2.0)) │
│ Quadrangle((5.0, 1.0), ..., (5.0, 2.0)) │
│ Quadrangle((6.0, 1.0), ..., (6.0, 2.0)) │
│ Quadrangle((7.0, 1.0), ..., (7.0, 2.0)) │
│ Quadrangle((8.0, 1.0), ..., (8.0, 2.0)) │
│ Quadrangle((9.0, 1.0), ..., (9.0, 2.0)) │
│ Quadrangle((0.0, 2.0), ..., (0.0, 3.0)) │
│ Quadrangle((1.0, 2.0), ..., (1.0, 3.0)) │
│ Quadrangle((2.0, 2.0), ..., (2.0, 3.0)) │
│ Quadrangle((3.0, 2.0), ..., (3.0, 3.0)) │
│ Quadrangle((4.0, 2.0), ..., (4.0, 3.0)) │
│ Quadrangle((5.0, 2.0), ..., (5.0, 3.0)) │
│ Quadrangle((6.0, 2.0), ..., (6.0, 3.0)) │
│ Quadrangle((7.0, 2.0), ..., (7.0, 3.0)) │
│ Quadrangle((8.0, 2.0), ..., (8.0, 3.0)) │
│ Quadrangle((9.0, 2.0), ..., (9.0, 3.0)) │
│ Quadrangle((0.0, 3.0), ..., (0.0, 4.0)) │
│ ⋮ │
└─────────────────────────────────────────┘
                            69 rows omitted

```

## BREAKING

- Deprecation of GeoClustering.jl, which now lives in GeoStatsTransforms.jl
- Deprecation of PointPatterns.jl, which now lives in GeoStatsProcesses.jl
- Kriging, IDW, etc. are now GeoStatsModels.jl instead of solvers
- GeoTables.jl now only holds the GeoTable type, and GeoIO.jl is the new home of load/save functions

Join our [community channel](https://julialang.zulipchat.com/#narrow/stream/276201-geostats.2Ejl) if you need help updating.

---

<div class="post-metadata">

**Author:** ![gvdr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gvdr/32/6387_2.png) [@gvdr](https://discourse.julialang.org/u/gvdr)\
**Post date:** [November 7, 2023, 12:26am UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/4 "2023-11-07T00:26:55Z")

</div>

Amazing.

Is, by any chance, anyone thinking/working on levereging the new Makie datashader for geo visualization?

---

<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:** [November 7, 2023, 12:43am UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/5 "2023-11-07T00:43:41Z")

</div>

Not working at the moment, but any contribution is welcome.

---

<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:** [December 21, 2023, 9:16pm UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/6 "2023-12-21T21:16:55Z")

</div>

# GeoStats.jl v0.49

New exciting features, including lazy transforms on meshes. This means that we can now map large geotiff, netcdf, grib, etc files to lazy `TransformedGrid` with the correct coordinates from the file, without any memory allocation:

```julia-auto
using GeoStats
using GeoIO

geotable = GeoIO.load("world.tif")

```

```julia
2097152×4 GeoTable over 2097152 TransformedGrid{2,Float64}
┌─────────────┬─────────────┬─────────────┬────────────────────────────────────────────────────────┐
│ BAND1 │ BAND2 │ BAND3 │ geometry │
│ Categorical │ Categorical │ Categorical │ Quadrangle │
│ [NoUnits] │ [NoUnits] │ [NoUnits] │ │
├─────────────┼─────────────┼─────────────┼────────────────────────────────────────────────────────┤
│ 12 │ 11 │ 68 │ Quadrangle((-180.0, 90.0), ..., (-180.0, 89.8242)) │
│ 12 │ 11 │ 68 │ Quadrangle((-179.824, 90.0), ..., (-179.824, 89.8242)) │
│ 12 │ 11 │ 68 │ Quadrangle((-179.648, 90.0), ..., (-179.648, 89.8242)) │
│ 12 │ 11 │ 68 │ Quadrangle((-179.473, 90.0), ..., (-179.473, 89.8242)) │
│ 12 │ 11 │ 68 │ Quadrangle((-179.297, 90.0), ..., (-179.297, 89.8242)) │
│ 12 │ 11 │ 68 │ Quadrangle((-179.121, 90.0), ..., (-179.121, 89.8242)) │
│ ⋮ │ ⋮ │ ⋮ │ ⋮ │
└─────────────┴─────────────┴─────────────┴────────────────────────────────────────────────────────┘
                                                                                2097146 rows omitted

```

Even though this grid has 2048 x 1024 quadrangles, we can see that the size of the geometry column is 120 bytes:

```julia
sizeof(geotable.geometry)

```

```julia-auto
120

```

We can still visualize the grid efficiently with Makie:

```julia-auto
import GLMakie as Mke

viz(geotable.geometry, color = geotable.BAND1)

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/4/3417e2381c075cdc675315c85f8bac65daf5b779.jpeg)

This puts us one step closer to the new coordinate system infrastructure, which is planned for the first semester of 2024.

Happy new year! 🥂

---

<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:** [January 22, 2024, 10:23am UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/7 "2024-01-22T10:23:35Z")

</div>

# GeoStats.jl v0.49.2

- Multi-threaded `geojoin`
- 3D `intersects`
- `viz` of large `Polygon` sets

and other small improvements on simulation of geospatial stochastic processes (e.g. Gaussian).

---

<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:** [March 27, 2024, 4:56pm UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/8 "2024-03-27T16:56:23Z")

</div>

# GeoStats.jl v0.53

- New transforms:
  - `Aggregate`
  - `Transfer`
  - `Downscale`
  - `Upscale`

Given a geotable over a grid:

```julia
X = [i/20 * cos(3π/2 * (j-1) / (30-1)) for i in 1:20, j in 1:30]
Y = [i/20 * sin(3π/2 * (j-1) / (30-1)) for i in 1:20, j in 1:30]
sgrid = StructuredGrid(X, Y)
gtb = georef((a=rand(Float64, 551), b=rand(Int, 551)), sgrid)

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/9/e9b859ddb377b8bffb2bda6fb0701789bffe9b66.png)

These transforms can be used to change the resolution, or transfer the variables to other domains with nearest neighbor interpolation:

```julia
ngtb = gtb |> Downscale(2, 2)

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/4/e/4e35aaac39bede4cfade522fda35cf9b7f1e2a8a.jpeg)

They work with any `Grid` subtype, including `CartesianGrid`, `RectilinearGrid` and `StructuredGrid`. Please check the docstrings to learn more.

---

<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:** [April 8, 2024, 4:59pm UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/9 "2024-04-08T16:59:12Z")

</div>

# GeoStats.jl v0.54

Various fixes and improvements to color treatment in `viz` and `viewer`.

## Breaking

- `showfacets` has been renamed to `showsegments` and `showpoints`
- `facetcolor` has been renamed to `segmentcolor` and `pointcolor`
- `colorscheme` has been renamed to `colormap`

## Features

- Now it is possible to pass the `colorrange` option to customize the color limits associated with a vector of values.
- New `cbar` for colorbars based on custom vectors of arbitrary Julia objects, including missing values, categorical, Distributions.jl, etc.

---

<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:** [May 29, 2024, 3:54pm UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/10 "2024-05-29T15:54:45Z")

</div>

# GeoStats.jl v0.57

We are super excited with this release, which comes with full support for coordinate reference systems (CRS). Highly recommend the update if you are still using old versions of the project:

```julia
julia> using GeoStats

julia> grid = CartesianGrid(10, 10)
10×10 CartesianGrid
├─ minimum: Point(x: 0.0 m, y: 0.0 m)
├─ maximum: Point(x: 10.0 m, y: 10.0 m)
└─ spacing: (1.0 m, 1.0 m)

julia> geotable = georef((; T = rand(100)u"K"), grid)
100×2 GeoTable over 10×10 CartesianGrid
┌────────────┬─────────────────────────────────────────────────────────────┐
│ T │ geometry │
│ Continuous │ Quadrangle │
│ [K] │ │
├────────────┼─────────────────────────────────────────────────────────────┤
│ 0.18959 K │ Quadrangle((x: 0.0 m, y: 0.0 m), ..., (x: 0.0 m, y: 1.0 m)) │
│ 0.620354 K │ Quadrangle((x: 1.0 m, y: 0.0 m), ..., (x: 1.0 m, y: 1.0 m)) │
│ 0.609181 K │ Quadrangle((x: 2.0 m, y: 0.0 m), ..., (x: 2.0 m, y: 1.0 m)) │
│ 0.577826 K │ Quadrangle((x: 3.0 m, y: 0.0 m), ..., (x: 3.0 m, y: 1.0 m)) │
│ 0.417657 K │ Quadrangle((x: 4.0 m, y: 0.0 m), ..., (x: 4.0 m, y: 1.0 m)) │
│ 0.995937 K │ Quadrangle((x: 5.0 m, y: 0.0 m), ..., (x: 5.0 m, y: 1.0 m)) │
│ 0.134751 K │ Quadrangle((x: 6.0 m, y: 0.0 m), ..., (x: 6.0 m, y: 1.0 m)) │
│ 0.581671 K │ Quadrangle((x: 7.0 m, y: 0.0 m), ..., (x: 7.0 m, y: 1.0 m)) │
│ 0.968301 K │ Quadrangle((x: 8.0 m, y: 0.0 m), ..., (x: 8.0 m, y: 1.0 m)) │
│ 0.89252 K │ Quadrangle((x: 9.0 m, y: 0.0 m), ..., (x: 9.0 m, y: 1.0 m)) │
│ 0.570824 K │ Quadrangle((x: 0.0 m, y: 1.0 m), ..., (x: 0.0 m, y: 2.0 m)) │
│ ⋮ │ ⋮ │
└────────────┴─────────────────────────────────────────────────────────────┘
                                                             89 rows omitted

```

For example, notice the units in the regionalized variable and in the lags of empirical variograms:

```julia
julia> EmpiricalVariogram(geotable, :T)
EmpiricalVariogram
├─ abscissa: [0.0353553 m, 0.106066 m, 0.176777 m, ..., 1.23744 m, 1.30815 m, 1.41421 m]
├─ ordinate: [0.0 K^2, 0.0 K^2, 0.0 K^2, ..., 0.0 K^2, 0.0 K^2, 0.0783147 K^2]
├─ distance: Euclidean(0.0)
├─ estimator: MatheronEstimator()
└─ npairs: 342

```

Every single geometry and domain now has well-defined units, which is useful for various sorts of estimates in the physical world:

```julia
julia> quad = grid[1]
Quadrangle
├─ Point(x: 0.0 m, y: 0.0 m)
├─ Point(x: 1.0 m, y: 0.0 m)
├─ Point(x: 1.0 m, y: 1.0 m)
└─ Point(x: 0.0 m, y: 1.0 m)

julia> area(quad)
1.0 m^2

```

---

<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:** [June 8, 2024, 10:44am UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/11 "2024-06-08T10:44:47Z")

</div>

# GeoStats.jl v0.58

A quick release that makes the CRS explicit in `GeoTable`s:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/4/3/43930214619bc21721c3a044b5a26f90fa0e077b.png)

Notice the `🖈 Cartesian{NoDatum}` in the sub-header of the `geometry` column.

---

<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:** [June 15, 2024, 5:45pm UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/12 "2024-06-15T17:45:36Z")

</div>

# GeoStats.jl v0.59

Another quick release to track the improvements in the Meshes.jl submodule:

> [@\[ANN\] Meshes.jl - Computational Geometry in Julia](https://discourse.julialang.org/t/ann-announcing-meshes-jl/53973/53):
>
> Meshes.jl v0.45 New transforms: Proj for changing the CRS of geometries, domains and geotables [image] Shadow for computing the “shadow” of a 3D domain onto XY, XZ or YZ [image] LenghtUnit for changing the lenght unit of geometries and domains [image] New discretization/tesselation: DelaunayTriangulation of geometries [image] DelaunayTesselation of point sets [image] VoronoiTesselation of point sets [image] Breaking changes (Multi-)polygons with more than 5000 vertices are now discreti…

---

<div class="post-metadata">

**Author:** ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Post date:** [June 16, 2024, 4:50am UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/13 "2024-06-16T04:50:13Z")

</div>

For someone who has not used GeoStats.jl before, is there a tutorial to get started? I am interested in coordinates transform. Ie. Get my GPS utm Datum and transform them into X,Y,Z coordinates to compare WGS84 with AGD56 points.

---

<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:** [June 16, 2024, 5:41am UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/14 "2024-06-16T05:41:39Z")

</div>

Did you check the official documentation and the GDSJL book? They are the recommended resources. The book is a good starting point.

---

<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 4, 2024, 11:13am UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/15 "2024-07-04T11:13:23Z")

</div>

# GeoStats.jl v0.60

A few quality of life updates and speedups:

- New `sideof(point, ring)` and `point ∈ poly` with Hao et al. algorithm, which we implemented with multiple-threads. Speedup of ~12x. The algorithm is quite robust, and can handle all sorts of degenerate cases in 2D polygonal areas:

> **Code**
>
> ```julia
> using GeoStats
> import GLMakie as Mke
> 
> r = rand(Ring{2})
> b = boundingbox(r)
> g = CartesianGrid(minimum(b), maximum(b), dims=(300,300))
> ps = (centroid(g, i) for i in 1:nelements(g))
> ss = sideof(ps, r)
> 
> viz(r)
> viz!(g, color = ss .== IN, alpha = 0.5)
> 
> ```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/7/9/7943ce409efbb10ac300a986d5f67d2954cdab2a.png)

- `GeoTable`s can now be explored in the VSCode viewer:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/4/f/4fa1e7df012a82f6967f677f16702298be09dd4e.png)

- GeoJSON files are now loaded with native Julia CRS:

> [@\[ANN\] GeoIO.jl - Load/save geospatial data in Julia](https://discourse.julialang.org/t/ann-geoio-jl-load-save-geospatial-data-in-julia/106031/5):
>
> GeoIO.jl v1.14 GeoJSON files are now loaded with native coordinate reference system (CRS) from CoordRefSystems.jl: Closer look: [image]

---

<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 26, 2024, 10:20pm UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/16 "2024-07-26T22:20:39Z")

</div>

# GeoStats.jl v0.62

Starting in this release, `viz` and `viewer` are aware of CRS and manifold of geometries stored in geotables. To give an example, here is how you visualize a geotable with `LatLon` coordinates:

```julia
using GeoStats
using GeoArtifacts

import GLMakie as Mke

table = NaturalEarth.get("admin_0_countries", 110)

viz(table.geometry)

```

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

You can also send the geotable to the `viewer` to explore different variables over the globe. For example, I selected the variable `ABBREV` in the dropdown menu:

```julia
table |> viewer

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/a/f/afce615f3b745161d0e0aa9bd30b5f50ff2b7fdb.jpeg)

---

<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:** [August 8, 2024, 10:03pm UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/17 "2024-08-08T22:03:13Z")

</div>

A few tweaks here and there, and we are now able to visualize moderately large “raster” data stored in GeoTIFF files with any CRS in **native Julia**.

To illustrate the feature, consider the following example with data from the NaturalEarth project:

```julia
using GeoStats
using GeoIO

import GLMakie as Mke

# https://www.naturalearthdata.com/downloads/50m-raster-data/50m-gray-earth
raster = GeoIO.load("GRAY_50M_SR_OB.tif") |> Coerce(Continuous)

# upscale for 3D mesh visualization
coarse = raster |> Upscale(10, 10) # needs to be optimized

# send coarse scale to viewer
coarse |> viewer

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/f/4/f40de44f61a9b98c177552176a3338b45d17f446.jpeg)

Let’s add additional geometries to the visualization:

```julia
# https://www.naturalearthdata.com/downloads/50m-cultural-vectors
bounds = GeoIO.load("ne_50m_admin_0_boundary_lines_land.shp").geometry

viz!(bounds, color="cyan")

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/4/7/47870121f1a635c2d423d7827415b2260d645e81.jpeg)

Now let’s add a random set of points with `LatLon` coordinates:

```julia
points = rand(Point, 100, crs=LatLon)

viz!(points, color="yellow")

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/b/db523669450f2a8ef167fe39b065a42f160c294a.jpeg)

Now let’s demonstrate the real benefit of native Julia CRS as opposed to “raw” numbers with the PROJ library. Let’s project our data to a `Robinson` CRS and visualize again:

```julia
projcoarse = coarse |> Proj(Robinson)
projbounds = bounds |> Proj(Robinson)
projpoints = points |> Proj(Robinson)

projcoarse |> viewer
viz!(projbounds, color="cyan")
viz!(projpoints, color="yellow")

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/c/ecaaa873589c533bf6163e35d2583a2b98b2127e.jpeg)

Let’s do the same with another favorite of mine, the `WinkelTripel`:

```julia
projcoarse = coarse |> Proj(WinkelTripel)
projbounds = bounds |> Proj(WinkelTripel)
projpoints = points |> Proj(WinkelTripel)

projcoarse |> viewer
viz!(projbounds, color="cyan")
viz!(projpoints, color="yellow")

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/8/0/80684e2cae7ad6801805d0afc4fbf986b1bb39bc.jpeg)

Notice how the visualization automatically chooses a 2D axis for the `Projected` CRS types using Julia’s multiple-dispatch. It is very easy to build advanced geographic maps in a few lines of code, and to parallelize things with multiple threads.

Of course there are tons of optimizations pending to make this experience more interactive and fast. We are working on it, and welcome pull requests with performance improvements.

You can reproduce the example above with the latest stable release of the stack.

---

<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:** [August 13, 2024, 1:40pm UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/18 "2024-08-13T13:40:34Z")

</div>

It is so easy to optimize code in Julia ❤ In less than a week we addressed a couple of performance bottlenecks:

- The `Upscale`, `Downscale`, `Aggregate` and `Transfer` transforms were specialized for domains that are `Grid` using TiledIteration.jl instead of NearestNeighbors.jl. This means that they can be used with arbitrarily large “rasters” now, and will produce instant results.
- GeoIO.jl now loads GeoTIFF datasets using true Colors.jl, and the `viewer` has been updated accordingly to show these colors. Below is an example with another NaturalEarth dataset:

```julia
using GeoStats
using GeoIO

raster = GeoIO.load("NE1_50M_SR_W.tif")
coarse = raster |> Upscale(10, 10)
coarse |> viewer

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/2/8/28af011d73d5cdadc99509ac5c3d608206cce681.jpeg)

- It turns out that many of our transforms were taking some time to precompile. For example, `Rasterize` was taking 12s. We added these transforms to our precompilation workload with PrecompileTools.jl and they are instant now on the first usage.

You can take advantage of these new features and speedups by updating your environment.

---

<div class="post-metadata">

**Author:** ![asinghvi17](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asinghvi17/32/8272_2.png) [@asinghvi17](https://discourse.julialang.org/u/asinghvi17)\
**Post date:** [August 13, 2024, 8:26pm UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/19 "2024-08-13T20:26:07Z")

</div>

This is pretty cool! It looks like the normals on that spherical mesh are inverted though.

---

<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:** [August 17, 2024, 1:05pm UTC](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054/20 "2024-08-17T13:05:48Z")

</div>

# GeoStats.jl v0.64

The `viz` and `viewer` were refactored to eliminate intermediate allocations. We are now calling the most efficient Makie.jl functions based on the rich information that is stored in our parametric geometry/mesh types.

To give a concrete example, we can now visualize large transformed “rasters” transformed with any transform pipeline, including nonlinear transforms like `Proj`. You can repeat the example I gave in previous posts with `Upscale(2, 2)` and the resulting geotable with 5400x2700 pixels will be displayed in ~20s:

 ![robinson](https://global.discourse-cdn.com/julialang/original/3X/4/b/4b787896a7e73d60c3afe25e1c27a24664028ae4.jpeg)  
 ![winkeltripel](https://global.discourse-cdn.com/julialang/original/3X/0/d/0d0b38058f279be4be74e8310735655145cb438b.jpeg)

### Breaking changes

1. All topological relations (`Boundary`, `Coboundary` and `Adjacency`) return tuples instead of vectors. They no longer allocate for `GridTopology`, which gives a huge speed up in various parts of the project.
2. Nonlinear transforms with `Primitive` geometries are delayed with a new `TransformedGeometry` type. For example, we can `Proj` a geodesic `Ball` over the ellipsoid of the Earth to a flat Euclidean space and its `boundary` will be properly transformed.

[Next page](https://discourse.julialang.org/t/ann-geostats-jl-geospatial-data-science-and-geostatistical-modeling-in-julia/101054.md?page=2)
