Domains

Overview

A geospatial domain is a region in physical space where data can be measured. For example, a collection of rain gauge stations can be represented as a point set in the map. Similarly, a collection of states in a given country can be represented as a set of 2D shapes.

We provide flexible domain types for advanced geospatial workflows via the Meshes.jl project. Please check their documentation for more details.

Examples

PointSet

pset = PointSet(rand(3,100))
100 PointSet{3,Float64}
  └─Point(0.8214494559283716, 0.5746866814619669, 0.8862245615519445)
  └─Point(0.03369223402986288, 0.09983848728798017, 0.7388704641194683)
  └─Point(0.6972095805825059, 0.7262147971718785, 0.08207952049302436)
  └─Point(0.3809960633387829, 0.9379671610052385, 0.8409634275183161)
  └─Point(0.09112676275634057, 0.6033325396969826, 0.39557155927247867)
  ⋮
  └─Point(0.1261506959537364, 0.17772985480601533, 0.5936057322207109)
  └─Point(0.14819428544518032, 0.6996753389148203, 0.31852191047688294)
  └─Point(0.557550172253934, 0.7437970596665237, 0.3937639786972661)
  └─Point(0.5828964349007756, 0.9842183272986613, 0.5539190728725615)
  └─Point(0.2640308681610525, 0.3787527034254077, 0.06345375337340042)
plot(pset, camera=(30,60))

GeometrySet

t = Triangle((0.0,0.0), (1.0,1.0), (0.0,1.0))
q = Quadrangle((1.0,1.0), (2.0,1.0), (2.0,2.0), (1.0,2.0))

gset = GeometrySet([t, q])
2 GeometrySet{2,Float64}
  └─Triangle(Point(0.0, 0.0), Point(1.0, 1.0), Point(0.0, 1.0))
  └─Quadrangle(Point(1.0, 1.0), Point(2.0, 1.0), Point(2.0, 2.0), Point(1.0, 2.0))
plot(gset, fillcolor=:gray90, linecolor=:black)

CartesianGrid

grid = CartesianGrid(10,10,10)
10×10×10 CartesianGrid{3,Float64}
  minimum: Point(0.0, 0.0, 0.0)
  maximum: Point(10.0, 10.0, 10.0)
  spacing: (1.0, 1.0, 1.0)
plot(grid, camera=(30,60))

SimpleMesh

points = Point2[(0,0), (1,0), (0,1), (1,1), (0.25,0.5), (0.75,0.5)]
connec = connect.([(1,5,3),(4,6,2),(1,2,6,5),(4,3,5,6)], Ngon)
mesh   = SimpleMesh(points, connec)
4 SimpleMesh{2,Float64}
  6 vertices
    └─Point(0.0, 0.0)
    └─Point(1.0, 0.0)
    └─Point(0.0, 1.0)
    └─Point(1.0, 1.0)
    └─Point(0.25, 0.5)
    └─Point(0.75, 0.5)
  4 elements
    └─Triangle(1, 5, 3)
    └─Triangle(4, 6, 2)
    └─Quadrangle(1, 2, 6, 5)
    └─Quadrangle(4, 3, 5, 6)
plot(mesh, fillcolor=:gray90, linecolor=:black)