...
Code Block | ||
---|---|---|
| ||
set1 = create_geo_set() # creates an empty set set2 = create_geo_set(g1, g2, g3) # assuming that g1,g2,g3 are geopoints variables set3 = set1 & g1 & g2 # set3 has 2 geopoints set4 = set2 & set3 # set4 has 5 geopoints |
Operations on geopointsets
Accessing geopintset elements
The The count()
function function returns the number of geopoints variables contained by the set.
Use the indexing operator []
to access the geopoints variables contained in a set. For example:
Code Block | ||
---|---|---|
| ||
print(type(set4)) # geopointset
print(count(set4)) # 5
g1 = set4[1] # extract the first item
print(type(g1)) # geopoints
print(count(g1)) # 244 (if there are 244 points in this geopoints variable) |
Operations on geopointsets
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:
...