Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs and file cleaning #1555

Merged
merged 1 commit into from May 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions python/src/main/python/pygw/base_models.py
Expand Up @@ -246,6 +246,17 @@ def query_statistics(self, q):
# TODO
raise NotImplementedError

"""
Get a single statistical result that matches the given query criteria

Args:
q (pygw.special_queries.StatisticsQuery): query the query criteria, use StatisticsQueryBuilder or its extensions and if you're
interested in a particular common statistics type use StatisticsQueryBuilder.factory()
Returns:
If the query does not define that statistics type it will return null as aggregation
only makes sense within a single type, otherwise aggregates the results of the query
into a single result that is returned
"""
def aggregate_statistics(self, q):
return self._java_ref.aggregateStatistics(q._java_ref)

Expand Down
13 changes: 0 additions & 13 deletions python/src/main/python/pygw/simple_test.py

This file was deleted.

10 changes: 8 additions & 2 deletions python/src/main/python/pygw/special_queries.py
Expand Up @@ -2,12 +2,18 @@
from pygw.base_models import PyGwJavaWrapper, QueryInterface

class StatisticsQuery(QueryInterface):
"type is 'bbox' or 'time_range'"
"""
Builds a statistics query for aggregate statistics.
To create a StatisticsQuery, for extended_id is the ID of the statisticqs query,
and type must either be 'bbox' 'time_range'
"""
def __init__(self, extended_id, type):
if type == "bbox":
builder = config.MODULE__geotime_query.VectorStatisticsQueryBuilder.newBuilder().factory().bbox()
else:
elif type == "time_range":
builder = config.MODULE__geotime_query.VectorStatisticsQueryBuilder.newBuilder().factory().timeRange()
else:
raise AttributeError("Invalid query type")

builder.fieldName(extended_id)
java_ref = builder.build()
Expand Down