Esempio n. 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
Esempio n. 2
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
Esempio n. 3
0
def enhance_getmetadata_request(dataset, layer, request):
    gettemp = request.GET.copy()

    # 'time' parameter
    dimensions = wms_handler.get_dimensions(request)

    newgets = dict(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),
                   elevation=wms_handler.get_elevation(request),
                   width=dimensions.width,
                   height=dimensions.height,
                   item=wms_handler.get_item(request))
    gettemp.update(newgets)
    request.GET = gettemp
    return request
Esempio n. 4
0
def enhance_getmetadata_request(dataset, layer, request):
    gettemp = request.GET.copy()

    # 'time' parameter
    dimensions = wms_handler.get_dimensions(request)

    newgets = dict(
        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),
        elevation=wms_handler.get_elevation(request),
        width=dimensions.width,
        height=dimensions.height,
        item=wms_handler.get_item(request)
    )
    gettemp.update(newgets)
    request.GET = gettemp
    return request
Esempio n. 5
0
def enhance_getfeatureinfo_request(dataset, layer, request):
    gettemp = request.GET.copy()
    # 'time' parameter
    times = wms_handler.get_times(request)
    xy = wms_handler.get_xy(request)
    dimensions = wms_handler.get_dimensions(request)
    bbox = wms_handler.get_bbox(request)
    crs = wms_handler.get_projection(request)
    targets = wms_handler.get_gfi_positions(xy, bbox, crs, dimensions)

    newgets = dict(starting=times.min,
                   ending=times.max,
                   latitude=targets.latitude,
                   longitude=targets.longitude,
                   elevation=wms_handler.get_elevation(request),
                   crs=crs,
                   info_format=wms_handler.get_info_format(request))
    gettemp.update(newgets)
    request.GET = gettemp
    return request
Esempio n. 6
0
def enhance_getfeatureinfo_request(dataset, layer, request):
    gettemp = request.GET.copy()
    # 'time' parameter
    times = wms_handler.get_times(request)
    xy = wms_handler.get_xy(request)
    dimensions = wms_handler.get_dimensions(request)
    bbox = wms_handler.get_bbox(request)
    crs = wms_handler.get_projection(request)
    targets = wms_handler.get_gfi_positions(xy, bbox, crs, dimensions)

    newgets = dict(
        starting=times.min,
        ending=times.max,
        latitude=targets.latitude,
        longitude=targets.longitude,
        elevation=wms_handler.get_elevation(request),
        crs=crs,
        info_format=wms_handler.get_info_format(request)
    )
    gettemp.update(newgets)
    request.GET = gettemp
    return request