...
As a geopointset is simply a container for geopoints variables, most operations on a geopointset are performed on each of its component geopoints. For example, the following line of code with return a new geopointset where each geopoints variable has had the cos()
function applied to its values:
Code Block | ||
---|---|---|
| ||
cgset = cos(gset) |
Operations between geopointsets and numbers are performed on each geopoints, e.g.
Code Block | ||
---|---|---|
| ||
gsetplus1 = gset + 1 # add 1 to each value in each geopoints var in gset |
Operations can be performed between geopointsets are performed on each pair of geopoints, as geopointsets and geopointsets, or geopointsets and fieldsets, as long as they both contain the same number of geopointsitems, or one geopoints variable. For example:
Code Block |
---|
gsetdiff = gset1 - gset2 |
If gset1
and gset2
both contain 5 geopoints, then 5 operations will be performed (gset1[1] - gset2[1]
, etc). If gset1
contains 1 geopoints, then the result will again be 5 geopoints - the difference between gset1[1] and gset2[1..5]
.
Operations between geopointsets and fieldsets are performed on each (geopoints, field) pair, as long as they both contain the same number of items, or one item. For example:
Code Block |
---|
fcobsdiff = fc_fieldset - obs_geoset |
...
they contain exactly one item. Otherwise, if they contain a different number of items, the computation will fail.
For example, if gset_5a
and gset_5b
each contain 5 geopoints variables, the following code will add each pair of geopoints variables, giving a resulting geopointset of size 5:
Code Block | ||
---|---|---|
| ||
gsetsum_r1 = gset_5a + gset_5b # gset_5b[n] is added to gset_5a[n] |
If gset_1c
contains a single geopoints variable, the following code will produce a geopointset with 5 items, the result of adding gset_1c[1]
to each item in gset_5a
:
Code Block | ||
---|---|---|
| ||
gsetsum_r2 = gset_5a + gset_1c # gset_1c[1] is added to each gset_5a[n] |
Likewise, geopointset/fieldset operations work the same way:
Code Block | ||
---|---|---|
| ||
gsetdiff_r1 = fc_fieldset_5 - gset_5a # gset_5a[n] is subtracted from fc_fieldset_5[n]
gsetdiff_r2 = fc_fieldset_5 - gset_1c # gset_1c[1] is subtracted from each field |
The Geopointset file format
...