def showActivityWMS(request): ''' Fuller featured Activities view using bootstrap and ajax features of querystoqs.html. Displays Resources of activity along with tracks on the map and perhaps a get data button. Could be a useful results page from a search of the database. ''' logger.debug("inside showActivityWMS") # This queryset could result from a collection of Q objects constructed similar to what STOQSQManager does # TODO: Implement this qs = mod.Activity.objects.all().order_by('startdate') geo_query = '''geom from (select a.maptrack as geom, a.id as gid, a.name as name, a.comment as comment, a.startdate as startdate, a.enddate as enddate from stoqs_activity a) as subquery using unique gid using srid=4326''' platform_string = '' for p in qs: platform_string += p.name + ',' platform_string = platform_string[:-1] station_union_layer_string = '' # TODO: populate station_union_layer_string and make activityWMS.html av = ActivityView(request, addAttributeToListItems(qs, 'geo_query', geo_query), platform_string, station_union_layer_string) return av.process_request(webPageTemplate = 'activityWMS.html')
def showActivitiesWMS(request): '''Render Activities as WMS via mapserver''' list = mod.Activity.objects.all().order_by('startdate') geo_query = '''geom from (select a.maptrack as geom, a.id as gid, a.name as name, a.comment as comment, a.startdate as startdate, a.enddate as enddate from stoqs_activity a) as subquery using unique gid using srid=4326''' av = ActivityView(request, addAttributeToListItems(list, 'geo_query', geo_query),'') return av.process_request(webPageTemplate = 'activitiesWMS.html')
def showActivitiesWMS(request): '''Render Activities as WMS via mapserver''' list = mod.Activity.objects.all().order_by('startdate') geo_query = '''geom from (select a.maptrack as geom, a.id as gid, a.name as name, a.comment as comment, a.startdate as startdate, a.enddate as enddate from stoqs_activity a) as subquery using unique gid using srid=4326''' av = ActivityView(request, addAttributeToListItems(list, 'geo_query', geo_query), '') return av.process_request(webPageTemplate='activitiesWMS.html')
def showActivitiesWMSAnimate(request): '''Render Activities as WMS via mapserver''' list = mod.Activity.objects.all().order_by('startdate') for a in list: a.isostartdate = a.startdate.strftime('%Y-%m-%dT%H:%M:%S') a.isoenddate = a.enddate.strftime('%Y-%m-%dT%H:%M:%S') geo_query = '''geom from (select m.geom as geom, ip.id as gid, ip.timevalue as timevalue from stoqs_instantpoint ip inner join stoqs_measurement m on (m.instantpoint_id = ip.id) order by ip.timevalue ) as subquery using unique gid using srid=4326''' av = ActivityView(request, addAttributeToListItems(list, 'geo_query', geo_query), '', 'activitiesWMSAnimate.html') return av.process_request(webPageTemplate='activitiesWMSAnimate.html', mapfile='activitypoint.map')
def showActivitiesWMS(request): '''Render Activities as WMS via mapserver''' # This queryset could result from a collection of Q objects constructed similar to what STOQSQManager does # TODO: Implement this qs = mod.Activity.objects.all().order_by('startdate') geo_query = '''geom from (select a.maptrack as geom, a.id as gid, a.name as name, a.comment as comment, a.startdate as startdate, a.enddate as enddate from stoqs_activity a) as subquery using unique gid using srid=4326''' platform_string = ','.join([p.name for p in qs]) station_union_layer_string = '' # TODO: populate station_union_layer_string and make activityWMS.html av = ActivityView(request, addAttributeToListItems(qs, 'geo_query', geo_query), platform_string, station_union_layer_string) return av.process_request(webPageTemplate = 'activitiesWMS.html')
def showParametersWMS(request): '''Render Activities that have specified parameter as WMS via mapserver''' # This queryset could result from a collection of Q objects constructed similar to what STOQSQManager does # TODO: Implement this qs = mod.Parameter.objects.all().order_by('name') geo_query = '''geom from (select a.maptrack as geom, a.id as aid, p.id as gid, a.name as name, a.comment as comment, a.startdate as startdate, a.enddate as enddate from stoqs_activity a inner join stoqs_activityparameter ap on (a.id = ap.activity_id) inner join stoqs_parameter p on (ap.parameter_id = p.id) order by p.name) as subquery using unique gid using srid=4326''' platform_string = ','.join([p.name for p in qs]) station_union_layer_string = '' # TODO: populate station_union_layer_string and make activityWMS.html av = ActivityView(request, addAttributeToListItems(qs, 'geo_query', geo_query), platform_string, station_union_layer_string) return av.process_request()