1
1
# Metadata
2
+ The ` Meta ` method provides metadata handling capabilities in GeometryBasics.
3
+
4
+ ### Syntax
5
+ ``` julia
6
+ meta (geometry, meta:: NamedTuple )
7
+ meta (geometry; meta... )
8
+ ```
9
+ To remove the metadata and keep only the geometry, use ` metafree ` , and for vice versa i.e., remove the geometry and keep the metadata use ` meta ` .
10
+ ### Syntax
11
+ ``` julia
12
+ metafree (meta- geometry)
13
+ meta (meta- geometry)
14
+ ```
15
+
16
+ #### Example:
2
17
``` julia
3
18
p1 = Point (2.2 , 3.6 )
4
19
5
- # geometries can carry metadata
6
20
poi = meta (p1, city= " Abuja" , rainfall= 1221.2 )
7
21
2 - element PointMeta{2 ,Int64,Point{2 ,Int64},(:city , :rainfall ),Tuple{String,Float64}} with indices SOneTo (2 ):
8
22
3
@@ -16,7 +30,6 @@ meta(poi)
16
30
poi. rainfall
17
31
1221.2
18
32
19
- # to remove the metadata and keep only the geometry, use metafree
20
33
metafree (poi)
21
34
2 - element Point{2 ,Int64} with indices SOneTo (2 ):
22
35
3
@@ -27,7 +40,25 @@ multipoi = MultiPointMeta([p1], city="Abuja", rainfall=1221.2)
27
40
1 - element MultiPointMeta{Point{2 ,Int64},MultiPoint{2 ,Int64,Point{2 ,Int64},Array{Point{2 ,Int64},1 }},(:city , :rainfall ),Tuple{String,Float64}}:
28
41
[3 , 1 ]
29
42
```
43
+ In the above example we have also used geometry specific meta methods.
30
44
45
+ #### Example:
46
+ ``` julia
47
+ GeometryBasics. MetaType (Polygon)
48
+ PolygonMeta
49
+
50
+ GeometryBasics. MetaType (Mesh)
51
+ MeshMeta
52
+ ```
53
+ The metageometry objects are infact composed of the original geometry types.
54
+ ``` julia
55
+ GeometryBasics. MetaFree (PolygonMeta)
56
+ Polygon
57
+
58
+ GeometryBasics. MetaFree (MeshMeta)
59
+ Mesh
60
+
61
+ ```
31
62
## MetaT
32
63
In GeometryBasics we can a have tabular layout for a collection meta-geometries by putting them into a StructArray that extends the Tables.jl API.
33
64
0 commit comments