Example #1
0
def enhance_getmap_request(dataset, layer, request):
    gettemp = request.GET.copy()

    # 'time' parameter
    times = wms_handler.get_times(request)
    dimensions = wms_handler.get_dimensions(request)
    defaults = layer.defaults

    newgets = dict(
        starting=times.min,
        ending=times.max,
        time=wms_handler.get_time(request),
        crs=wms_handler.get_projection(request),
        bbox=wms_handler.get_bbox(request),
        wgs84_bbox=wms_handler.get_wgs84_bbox(request),
        colormap=wms_handler.get_colormap(request, default=defaults.colormap),
        colorscalerange=wms_handler.get_colorscalerange(request, defaults.min, defaults.max),
        elevation=wms_handler.get_elevation(request),
        width=dimensions.width,
        height=dimensions.height,
        image_type=wms_handler.get_imagetype(request, default=defaults.image_type),
        logscale=wms_handler.get_logscale(request, defaults.logscale),
        vectorscale=wms_handler.get_vectorscale(request),
        vectorstep=wms_handler.get_vectorstep(request),
        numcontours=wms_handler.get_num_contours(request, default=defaults.numcontours)
    )
    gettemp.update(newgets)
    request.GET = gettemp

    # Check required parameters here and raise a ValueError if needed

    return request
Example #2
0
def enhance_getlegendgraphic_request(dataset, layer, request):
    gettemp = request.GET.copy()

    dimensions = wms_handler.get_dimensions(request, default_width=110, default_height=264)
    defaults = layer.defaults

    default_min = defaults.min or 0
    default_max = defaults.max or 10

    newgets = dict(
        colorscalerange=wms_handler.get_colorscalerange(request, default_min, default_max),
        width=dimensions.width,
        height=dimensions.height,
        image_type=wms_handler.get_imagetype(request, parameter='style', default=defaults.image_type),
        colormap=wms_handler.get_colormap(request, parameter='style', default=defaults.colormap),
        format=wms_handler.get_format(request),
        showlabel=wms_handler.get_show_label(request),
        showvalues=wms_handler.get_show_values(request),
        units=wms_handler.get_units(request, layer.units),
        logscale=wms_handler.get_logscale(request, defaults.logscale),
        horizontal=wms_handler.get_horizontal(request),
        numcontours=wms_handler.get_num_contours(request, default=defaults.numcontours)
    )
    gettemp.update(newgets)
    request.GET = gettemp
    return request
Example #3
0
def enhance_getlegendgraphic_request(dataset, layer, request):
    gettemp = request.GET.copy()

    dimensions = wms_handler.get_dimensions(request, default_width=110, default_height=264)
    defaults = layer.defaults

    default_min = defaults.min or 0
    default_max = defaults.max or 10

    newgets = dict(
        colorscalerange=wms_handler.get_colorscalerange(request, default_min, default_max),
        width=dimensions.width,
        height=dimensions.height,
        image_type=wms_handler.get_imagetype(request, parameter='style', default=defaults.image_type),
        colormap=wms_handler.get_colormap(request, parameter='style', default=defaults.colormap),
        format=wms_handler.get_format(request),
        showlabel=wms_handler.get_show_label(request),
        showvalues=wms_handler.get_show_values(request),
        units=wms_handler.get_units(request, layer.units),
        logscale=wms_handler.get_logscale(request, defaults.logscale),
        horizontal=wms_handler.get_horizontal(request),
        numcontours=wms_handler.get_num_contours(request, default=defaults.numcontours)
    )
    gettemp.update(newgets)
    request.GET = gettemp
    return request
Example #4
0
def enhance_getmap_request(dataset, layer, request):
    gettemp = request.GET.copy()

    # 'time' parameter
    times = wms_handler.get_times(request)
    dimensions = wms_handler.get_dimensions(request)
    defaults = layer.defaults

    newgets = dict(
        starting=times.min,
        ending=times.max,
        time=wms_handler.get_time(request),
        crs=wms_handler.get_projection(request),
        bbox=wms_handler.get_bbox(request),
        wgs84_bbox=wms_handler.get_wgs84_bbox(request),
        colormap=wms_handler.get_colormap(request, default=defaults.colormap),
        colorscalerange=wms_handler.get_colorscalerange(request, defaults.min, defaults.max),
        elevation=wms_handler.get_elevation(request),
        width=dimensions.width,
        height=dimensions.height,
        image_type=wms_handler.get_imagetype(request, default=defaults.image_type),
        logscale=wms_handler.get_logscale(request, defaults.logscale),
        vectorscale=wms_handler.get_vectorscale(request),
        vectorstep=wms_handler.get_vectorstep(request),
        numcontours=wms_handler.get_num_contours(request, default=defaults.numcontours)
    )
    gettemp.update(newgets)
    request.GET = gettemp

    # Check required parameters here and raise a ValueError if needed

    return request