Added integration with django-jsonfield-compat. This means that we can now use django's native JSONField, even if geonode is still using django-jsonfield. This means that we can take advantage of the features provided by django's JSONField, such as queryset lookups.
Added the gfdrr_det.utils.calculate_taxonomic_counts function. It is able to get counts from an exposure layer and takes an optional bbox_ewkt parameter. When a bbox is supplied, counts are gotten from the database by leveraging PostGIS' ST_Intersection function.
The new function that calculates single layer taxonomy counts has been wired to both the ingestexposures management command and to the views.ExposureLayerViewSet. In the ingestion phase counts are calculated for the whole layer. At runtime, the client can supply the bbox={x0},{y0},{x1},{y1} query parameter and the counts are computed on-the-fly.
The following are two examples of requests and responses that show the pre-calculated values and the calculation on-the-fly (both requests are asking for layer 'uga_v10_buildings_136'):
This PR is connected to #13
Notable changes:
Added integration with
django-jsonfield-compat
. This means that we can now use django's nativeJSONField
, even if geonode is still usingdjango-jsonfield
. This means that we can take advantage of the features provided by django's JSONField, such as queryset lookups.Added the
gfdrr_det.utils.calculate_taxonomic_counts
function. It is able to get counts from an exposure layer and takes an optionalbbox_ewkt
parameter. When a bbox is supplied, counts are gotten from the database by leveraging PostGIS'ST_Intersection
function.The new function that calculates single layer taxonomy counts has been wired to both the
ingestexposures
management command and to theviews.ExposureLayerViewSet
. In the ingestion phase counts are calculated for the whole layer. At runtime, the client can supply thebbox={x0},{y0},{x1},{y1}
query parameter and the counts are computed on-the-fly.The following are two examples of requests and responses that show the pre-calculated values and the calculation on-the-fly (both requests are asking for layer 'uga_v10_buildings_136'):