aggregated_cellbox
AggregatedCellBox(boundary, agg_data, id)
¶
a class represnts an aggrgated information within a geo-spatial/temporal boundary.
Attributes:
Note
All geospatial boundaries of a CellBox are given in a 'EPSG:4326' projection
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
boundary
|
Boundary
|
encapsulates latitude, longtitude and time range of the CellBox |
required |
agg_data
|
dict
|
a dictionary that contains data_names and agg values |
required |
id
|
string
|
a string represents cellbox id |
required |
contains_point(lat, long)
¶
Returns true if a given lat/long coordinate is contained within this cellbox.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lat
|
float
|
latitude of a given point |
required |
long
|
float
|
longitude of a given point |
required |
Returns:
| Name | Type | Description |
|---|---|---|
contains_points |
bool
|
True if this CellBox contains a point given by parameters (lat, long) |
from_json(cellbox_json)
classmethod
¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cellbox_json
|
Json
|
json object that encapsulates boundary, agg_data and id of the CellBox |
required |
get_agg_data()
¶
returns the agg_data
get_bounds()
¶
get the boundary of the CellBox
get_id()
¶
returns the id
set_agg_data(agg_data)
¶
sets the agg_data
set_bounds(boundary)
¶
set the boundary of the CellBox
set_id(id)
¶
sets the cellbox id
to_json()
¶
convert cellbox to JSON
The returned object is of the form -
{
"geometry" (String): POLYGON(...),
"cx" (float): ...,
"cy" (float): ...,
"dcx" (float): ...,
"dcy" (float): ...,
"agg_value_1" (float): ...,
...,
"agg_value_n" (float): ...
}
Returns:
| Name | Type | Description |
|---|---|---|
cell_json |
dict
|
A JSON parsable dictionary representation of this AggregatedCellBox |