def generate(self, eo_object, group_layer, suffix, options):
        name = eo_object.identifier + "_bands"
        layer = Layer(name)
        layer.setMetaData("ows_title", name)
        layer.setMetaData("wms_label", name)
        layer.addProcessing("CLOSE_CONNECTION=CLOSE")
    
        coverage = eo_object.cast()
        range_type = coverage.range_type

        req_bands = options["bands"]
        band_indices = []
        bands = []

        for req_band in req_bands:
            if isinstance(req_band, int):
                band_indices.append(req_band + 1)

                bands.append(range_type[req_band])
            else:
                for i, band in enumerate(range_type):
                    if band.name == req_band:
                        band_indices.append(i + 1)
                        bands.append(band)
                        break
                else:
                    raise Exception(
                        "Coverage '%s' does not have a band with name '%s'." 
                    )

        if len(req_bands) in (3, 4):
            indices_str = ",".join(map(str, band_indices))
            offsite_indices = map(lambda v: v-1, band_indices[:3])
        elif len(req_bands) == 1:
            indices_str = ",".join(map(str, band_indices * 3))
            v = band_indices[0] - 1
            offsite_indices = [v, v, v]
        else:
            raise Exception("Invalid number of bands requested.")

        layer.setProcessingKey("BANDS", indices_str)
        layer.offsite = self.offsite_color_from_range_type(
            range_type, offsite_indices
        )
        
        # TODO: seems to break rendering
        #layer.setProcessingKey("SCALE", "100,200")

        yield (layer, coverage.data_items.all())
    def render(self, collections, coverages, request_values):
        conf = CapabilitiesConfigReader(get_eoxserver_config())

        suffixes = self.suffixes

        map_ = Map()
        map_.setMetaData({
            "enable_request": "*",
            "onlineresource": conf.http_service_url,
            "service_onlineresource": conf.onlineresource,
            "updateSequence": conf.update_sequence,
            "name": conf.name,
            "title": conf.title,
            "abstract": conf.abstract,
            "accessconstraints": conf.access_constraints,
            "addresstype": "postal",
            "address": conf.delivery_point,
            "stateorprovince": conf.administrative_area,
            "city": conf.city,
            "postcode": conf.postal_code,
            "country": conf.country,
            "contactelectronicmailaddress": conf.electronic_mail_address,
            "contactfacsimiletelephone": conf.phone_facsimile,
            "contactvoicetelephone": conf.phone_voice,
            "contactperson": conf.individual_name,
            "contactorganization": conf.provider_name,
            "contactposition": conf.position_name,
            "fees": conf.fees,
            "keywordlist": ",".join(conf.keywords),
            "srs": " ".join(crss.getSupportedCRS_WCS(format_function=crss.asShortCode)),
        }, namespace="ows")
        map_.setProjection("EPSG:4326")
        map_.setMetaData({
            "getmap_formatlist": ",".join([f.mimeType for f in self.get_wms_formats()]),
            "getfeatureinfo_formatlist": "text/html,application/vnd.ogc.gml,text/plain",
        }, namespace="wms")

        map_extent = None

        for collection in collections:
            group_name = None
            
            # calculate extent and timextent for every collection
            extent = collection.extent_wgs84
            # save overall map extent
            map_extent = self.join_extents(map_extent, extent)

            eo_objects = collection.eo_objects.filter(
                begin_time__isnull=False, end_time__isnull=False
            )
            timeextent = ",".join(
                map(
                    lambda o: (
                        "/".join(
                            map(isoformat, o.time_extent)
                        ) + "/PT1S"
                    ), eo_objects
                )
            )

            if len(suffixes) > 1:
                # create group layer, if there is more than one suffix for this 
                # collection
                group_name = collection.identifier + "_group"
                group_layer = Layer(group_name)
                group_layer.setMetaData({
                    "title": group_name,
                    "abstract": group_name,
                    "extent": " ".join(map(str, extent)),
                }, namespace="wms")

                group_layer.setExtent(*extent)

                # add default style
                default_class = Class("default")
                default_style= Style("default")
                default_class.insertStyle(default_style)
                group_layer.insertClass(default_class)

                map_.insertLayer(group_layer)

            for suffix in suffixes:
                layer_name = collection.identifier + (suffix or "")
                layer = Layer(layer_name)
                if group_name:
                    layer.setMetaData({
                        "layer_group": "/" + group_name
                    }, namespace="wms")

                layer.setMetaData({
                    "title": layer_name,
                    "abstract": layer_name,
                    "extent": " ".join(map(str, extent)),
                    "timeextent": timeextent,
                }, namespace="wms")
                map_.insertLayer(layer)

        for coverage in coverages:
            extent = coverage.extent_wgs84

            # save overall map extent
            map_extent = self.join_extents(map_extent, extent)

            layer_name = coverage.identifier
            layer = Layer(layer_name)
            layer.setMetaData({
                "title": layer_name,
                "abstract": layer_name,
                "extent": " ".join(map(str, extent)),
            }, namespace="wms")

            layer.setExtent(*extent)

            map_.insertLayer(layer)

        # set the map_extent to a reasonable default value
        # in case there is no coverage or collection
        if map_extent is None: 
            map_extent = (0.0, 0.0, 1.0, 1.0)

        map_.setExtent(*map_extent)

        request = create_request(request_values)
        raw_result = map_.dispatch(request)
        result = result_set_from_raw_data(raw_result)
        return result, get_content_type(result)
Ejemplo n.º 3
0
    def generate(self, eo_object, group_layer, suffix, options):
        name = eo_object.identifier + "_bands"
        layer = Layer(name)
        layer.setMetaData("ows_title", name)
        layer.setMetaData("wms_label", name)
        layer.addProcessing("CLOSE_CONNECTION=CLOSE")

        coverage = eo_object.cast()
        range_type = coverage.range_type

        req_bands = options["bands"]
        band_indices = []
        bands = []

        for req_band in req_bands:
            if isinstance(req_band, int):
                band_indices.append(req_band + 1)

                bands.append(range_type[req_band])
            else:
                for i, band in enumerate(range_type):
                    if band.name == req_band:
                        band_indices.append(i + 1)
                        bands.append(band)
                        break
                else:
                    raise Exception(
                        "Coverage '%s' does not have a band with name '%s'." %
                        (coverage.identifier, req_band))

        if len(req_bands) in (3, 4):
            indices_str = ",".join(map(str, band_indices))
            offsite_indices = map(lambda v: v - 1, band_indices[:3])
        elif len(req_bands) == 1:
            indices_str = ",".join(map(str, band_indices * 3))
            v = band_indices[0] - 1
            offsite_indices = [v, v, v]
        else:
            raise Exception("Invalid number of bands requested.")

        offsite = self.offsite_color_from_range_type(range_type,
                                                     offsite_indices)
        options = self.get_render_options(coverage)
        self.set_render_options(layer, offsite, options)

        layer.setProcessingKey("BANDS", indices_str)

        if options.bands_scale_min and options.bands_scale_max:
            bands_scale_min = str(options.bands_scale_min).split(',')
            bands_scale_max = str(options.bands_scale_max).split(',')
            idx1, idx2, idx3 = offsite_indices
            layer.setProcessingKey(
                "SCALE_1",
                "%s,%s" % (bands_scale_min[idx1], bands_scale_max[idx1]))
            layer.setProcessingKey(
                "SCALE_2",
                "%s,%s" % (bands_scale_min[idx2], bands_scale_max[idx2]))
            layer.setProcessingKey(
                "SCALE_3",
                "%s,%s" % (bands_scale_min[idx3], bands_scale_max[idx3]))

        yield (layer, coverage.data_items.all())
Ejemplo n.º 4
0
 def generate_group(self, name):
     return Layer(name)
    def generate(self, eo_object, group_layer, suffix, options):
        name = eo_object.identifier + "_bands"
        layer = Layer(name)
        layer.setMetaData("ows_title", name)
        layer.setMetaData("wms_label", name)
        layer.addProcessing("CLOSE_CONNECTION=CLOSE")

        coverage = eo_object.cast()
        range_type = coverage.range_type

        req_bands = options["bands"]
        band_indices = []
        bands = []

        for req_band in req_bands:
            if isinstance(req_band, int):
                band_indices.append(req_band + 1)

                bands.append(range_type[req_band])
            else:
                for i, band in enumerate(range_type):
                    if band.name == req_band:
                        band_indices.append(i + 1)
                        bands.append(band)
                        break
                else:
                    raise Exception(
                        "Coverage '%s' does not have a band with name '%s'."
                        % (coverage.identifier, req_band)
                    )

        if len(req_bands) in (3, 4):
            indices_str = ",".join(map(str, band_indices))
            offsite_indices = map(lambda v: v-1, band_indices[:3])
        elif len(req_bands) == 1:
            indices_str = ",".join(map(str, band_indices * 3))
            v = band_indices[0] - 1
            offsite_indices = [v, v, v]
        else:
            raise Exception("Invalid number of bands requested.")

        offsite = self.offsite_color_from_range_type(
            range_type, offsite_indices
        )
        options = self.get_render_options(coverage)
        self.set_render_options(layer, offsite, options)

        layer.setProcessingKey("BANDS", indices_str)

        if options.bands_scale_min and options.bands_scale_max:
            bands_scale_min = str(options.bands_scale_min).split(',')
            bands_scale_max = str(options.bands_scale_max).split(',')
            idx1, idx2, idx3 = offsite_indices
            layer.setProcessingKey("SCALE_1", "%s,%s" % (
                bands_scale_min[idx1], bands_scale_max[idx1]
            ))
            layer.setProcessingKey("SCALE_2", "%s,%s" % (
                bands_scale_min[idx2], bands_scale_max[idx2]
            ))
            layer.setProcessingKey("SCALE_3", "%s,%s" % (
                bands_scale_min[idx3], bands_scale_max[idx3]
            ))

        yield (layer, coverage.data_items.all())
    def render(self, params):
        conf = CapabilitiesConfigReader(get_eoxserver_config())

        map_ = Map()
        map_.setMetaData({
            "enable_request": "*",
            "onlineresource": conf.http_service_url,
            "service_onlineresource": conf.onlineresource,
            "updateSequence": conf.update_sequence,
            "name": conf.name,
            "title": conf.title,
            "label": conf.title,
            "abstract": conf.abstract,
            "accessconstraints": conf.access_constraints,
            "addresstype": "",
            "address": conf.delivery_point,
            "stateorprovince": conf.administrative_area,
            "city": conf.city,
            "postcode": conf.postal_code,
            "country": conf.country,
            "contactelectronicmailaddress": conf.electronic_mail_address,
            "contactfacsimiletelephone": conf.phone_facsimile,
            "contactvoicetelephone": conf.phone_voice,
            "contactperson": conf.individual_name,
            "contactorganization": conf.provider_name,
            "contactposition": conf.position_name,
            "role": conf.role,
            "hoursofservice": conf.hours_of_service,
            "contactinstructions": conf.contact_instructions,
            "fees": conf.fees,
            "keywordlist": ",".join(conf.keywords),
            "formats": " ".join([f.wcs10name for f in self.get_wcs_formats()]),
            "srs": " ".join(crss.getSupportedCRS_WCS(format_function=crss.asShortCode)),
        }, namespace="ows")
        map_.setProjection("EPSG:4326")

        for outputformat in self.get_all_outputformats(False):
            map_.appendOutputFormat(outputformat)

        for coverage in params.coverages:
            layer = Layer(coverage.identifier)

            layer.setProjection(coverage.spatial_reference.proj)
            extent = coverage.extent
            size = coverage.size
            resolution = ((extent[2] - extent[0]) / float(size[0]),
                          (extent[1] - extent[3]) / float(size[1]))

            layer.setExtent(*extent)
            layer.setMetaData({
                "title": coverage.identifier,
                "label": coverage.identifier,
                "extent": "%.10g %.10g %.10g %.10g" % extent,
                "resolution": "%.10g %.10g" % resolution,
                "size": "%d %d" % size,
                "formats": " ".join([f.wcs10name for f in self.get_wcs_formats()]),
                "srs": " ".join(crss.getSupportedCRS_WCS(format_function=crss.asShortCode)),
            }, namespace="wcs")

            map_.insertLayer(layer)

        request = create_request(params)
        request.setParameter("version", params.version)
        raw_result = map_.dispatch(request)
        result = result_set_from_raw_data(raw_result)
        return result
    def generate(self, eo_object, group_layer, suffix, options):
        coverage = eo_object.cast()
        extent = coverage.extent
        sref = coverage.spatial_reference
        name = eo_object.identifier + "_intensity_mask"

        layer = Layer(name)
        if sref.srid is not None:
            short_epsg = "EPSG:%d" % sref.srid
            layer.setMetaData("ows_srs", short_epsg)
            layer.setMetaData("wms_srs", short_epsg)
        layer.setProjection(sref.proj)
        layer.setExtent(*extent)
        layer.setMetaData("wms_extent", "%f %f %f %f" % extent)
        layer.setMetaData("ows_title", name)
        layer.setMetaData("wms_label", name)
        layer.addProcessing("CLOSE_CONNECTION=CLOSE")

        coverage = eo_object.cast()

        request = options.get("request", {})
        color = self.COLORS[request.get("mask_style", self.DEFAULT_COLOR)]

        for value in xrange(1, 256):
            class_ = Class()
            class_.setExpression("([pixel] == %d)" % value)
            style = Style()
            style.color = Color(*color)
            style.opacity = value
            class_.insertStyle(style)
            layer.insertClass(class_)

        yield (layer, coverage.data_items.all())
    def generate(self, eo_object, group_layer, suffix, options):
        coverage = eo_object.cast()
        extent = coverage.extent
        sref = coverage.spatial_reference
        name = eo_object.identifier + "_value_mask"

        layer = Layer(name)
        if sref.srid is not None:
            short_epsg = "EPSG:%d" % sref.srid
            layer.setMetaData("ows_srs", short_epsg)
            layer.setMetaData("wms_srs", short_epsg)
        layer.setProjection(sref.proj)
        layer.setExtent(*extent)
        layer.setMetaData("wms_extent", "%f %f %f %f" % extent)
        layer.setMetaData("ows_title", name)
        layer.setMetaData("wms_label", name)
        layer.addProcessing("CLOSE_CONNECTION=CLOSE")

        coverage = eo_object.cast()

        request = options.get("request", {})
        value = request.get("mask_value", "0")
        color = self.COLORS[request.get("mask_style", self.DEFAULT_COLOR)]
        if value.startswith("!"):
            expression = "([pixel] != %g)" % float(value[1:])
        else:
            expression = "([pixel] == %g)" % float(value)

        class_ = Class()
        class_.setExpression(expression)
        style = Style()
        style.color = Color(*color)
        class_.insertStyle(style)
        layer.insertClass(class_)

        yield (layer, coverage.data_items.all())
Ejemplo n.º 9
0
    def render(self, params):
        conf = CapabilitiesConfigReader(get_eoxserver_config())

        http_service_url = get_http_service_url(params.http_request)

        map_ = Map()
        map_.setMetaData(
            {
                "enable_request":
                "*",
                "onlineresource":
                http_service_url,
                "service_onlineresource":
                conf.onlineresource,
                "updateSequence":
                conf.update_sequence,
                "name":
                conf.name,
                "title":
                conf.title,
                "label":
                conf.title,
                "abstract":
                conf.abstract,
                "accessconstraints":
                conf.access_constraints,
                "addresstype":
                "",
                "address":
                conf.delivery_point,
                "stateorprovince":
                conf.administrative_area,
                "city":
                conf.city,
                "postcode":
                conf.postal_code,
                "country":
                conf.country,
                "contactelectronicmailaddress":
                conf.electronic_mail_address,
                "contactfacsimiletelephone":
                conf.phone_facsimile,
                "contactvoicetelephone":
                conf.phone_voice,
                "contactperson":
                conf.individual_name,
                "contactorganization":
                conf.provider_name,
                "contactposition":
                conf.position_name,
                "role":
                conf.role,
                "hoursofservice":
                conf.hours_of_service,
                "contactinstructions":
                conf.contact_instructions,
                "fees":
                conf.fees,
                "keywordlist":
                ",".join(conf.keywords),
                "formats":
                " ".join([f.wcs10name for f in self.get_wcs_formats()]),
                "srs":
                " ".join(
                    crss.getSupportedCRS_WCS(
                        format_function=crss.asShortCode)),
            },
            namespace="ows")
        map_.setProjection("EPSG:4326")

        for outputformat in self.get_all_outputformats(False):
            map_.appendOutputFormat(outputformat)

        for coverage in params.coverages:
            layer = Layer(coverage.identifier)

            render_coverage = Coverage.from_model(coverage)
            layer.setProjection(render_coverage.grid.spatial_reference.proj)
            extent = render_coverage.extent
            size = render_coverage.size
            resolution = ((extent[2] - extent[0]) / float(size[0]),
                          (extent[1] - extent[3]) / float(size[1]))

            layer.setExtent(*extent)
            layer.setMetaData(
                {
                    "title":
                    coverage.identifier,
                    "label":
                    coverage.identifier,
                    "extent":
                    "%.10g %.10g %.10g %.10g" % extent,
                    "resolution":
                    "%.10g %.10g" % resolution,
                    "size":
                    "%d %d" % size,
                    "formats":
                    " ".join([f.wcs10name for f in self.get_wcs_formats()]),
                    "srs":
                    " ".join(
                        crss.getSupportedCRS_WCS(
                            format_function=crss.asShortCode)),
                },
                namespace="wcs")

            map_.insertLayer(layer)

        request = create_request(params)
        request.setParameter("version", params.version)
        raw_result = map_.dispatch(request)
        result = result_set_from_raw_data(raw_result)
        xml_result = etree.fromstring(result[0].data)

        for elem in xml_result.xpath('//*[local-name() = "metadataLink"]'):
            elem.getparent().remove(elem)

        # Add CQL parameter to GetCapabilities operation
        for elem in xml_result.xpath(
                '//*[local-name() = "Operation"][@name = "GetCapabilities"]'):
            ows = elem.nsmap['ows']
            param = etree.SubElement(elem, '{%s}Parameter' % ows)
            param.attrib['name'] = 'cql'
            etree.SubElement(param, '{%s}AnyValue' % ows)

        xml_result_data = etree.tostring(xml_result,
                                         pretty_print=True,
                                         encoding='UTF-8',
                                         xml_declaration=True)

        result[0] = ResultBuffer(xml_result_data, result[0].content_type)
        return result
Ejemplo n.º 10
0
    def render(self, params):
        conf = CapabilitiesConfigReader(get_eoxserver_config())

        http_service_url = get_http_service_url(params.http_request)

        map_ = Map()
        map_.setMetaData({
            "enable_request": "*",
            "onlineresource": http_service_url,
            "service_onlineresource": conf.onlineresource,
            "updateSequence": conf.update_sequence,
            "name": conf.name,
            "title": conf.title,
            "label": conf.title,
            "abstract": conf.abstract,
            "accessconstraints": conf.access_constraints,
            "addresstype": "",
            "address": conf.delivery_point,
            "stateorprovince": conf.administrative_area,
            "city": conf.city,
            "postcode": conf.postal_code,
            "country": conf.country,
            "contactelectronicmailaddress": conf.electronic_mail_address,
            "contactfacsimiletelephone": conf.phone_facsimile,
            "contactvoicetelephone": conf.phone_voice,
            "contactperson": conf.individual_name,
            "contactorganization": conf.provider_name,
            "contactposition": conf.position_name,
            "role": conf.role,
            "hoursofservice": conf.hours_of_service,
            "contactinstructions": conf.contact_instructions,
            "fees": conf.fees,
            "keywordlist": ",".join(conf.keywords),
            "formats": " ".join([f.wcs10name for f in self.get_wcs_formats()]),
            "srs": " ".join(crss.getSupportedCRS_WCS(format_function=crss.asShortCode)),
        }, namespace="ows")
        map_.setProjection("EPSG:4326")

        for outputformat in self.get_all_outputformats(False):
            map_.appendOutputFormat(outputformat)

        for coverage in params.coverages:
            layer = Layer(coverage.identifier)

            layer.setProjection(coverage.spatial_reference.proj)
            extent = coverage.extent
            size = coverage.size
            resolution = ((extent[2] - extent[0]) / float(size[0]),
                          (extent[1] - extent[3]) / float(size[1]))

            layer.setExtent(*extent)
            layer.setMetaData({
                "title": coverage.identifier,
                "label": coverage.identifier,
                "extent": "%.10g %.10g %.10g %.10g" % extent,
                "resolution": "%.10g %.10g" % resolution,
                "size": "%d %d" % size,
                "formats": " ".join([f.wcs10name for f in self.get_wcs_formats()]),
                "srs": " ".join(crss.getSupportedCRS_WCS(format_function=crss.asShortCode)),
            }, namespace="wcs")

            map_.insertLayer(layer)

        request = create_request(params)
        request.setParameter("version", params.version)
        raw_result = map_.dispatch(request)
        result = result_set_from_raw_data(raw_result)
        return result
Ejemplo n.º 11
0
    def render(self, collections, coverages, request_values, request):
        conf = CapabilitiesConfigReader(get_eoxserver_config())

        suffixes = self.suffixes

        http_service_url = get_http_service_url(request)

        map_ = Map()
        map_.setMetaData(
            {
                "enable_request":
                "*",
                "onlineresource":
                http_service_url,
                "service_onlineresource":
                conf.onlineresource,
                "updateSequence":
                conf.update_sequence,
                "name":
                conf.name,
                "title":
                conf.title,
                "abstract":
                conf.abstract,
                "accessconstraints":
                conf.access_constraints,
                "addresstype":
                "postal",
                "address":
                conf.delivery_point,
                "stateorprovince":
                conf.administrative_area,
                "city":
                conf.city,
                "postcode":
                conf.postal_code,
                "country":
                conf.country,
                "contactelectronicmailaddress":
                conf.electronic_mail_address,
                "contactfacsimiletelephone":
                conf.phone_facsimile,
                "contactvoicetelephone":
                conf.phone_voice,
                "contactperson":
                conf.individual_name,
                "contactorganization":
                conf.provider_name,
                "contactposition":
                conf.position_name,
                "fees":
                conf.fees,
                "keywordlist":
                ",".join(conf.keywords),
                "srs":
                " ".join(
                    crss.getSupportedCRS_WCS(
                        format_function=crss.asShortCode)),
            },
            namespace="ows")
        map_.setProjection("EPSG:4326")
        map_.setMetaData(
            {
                "getmap_formatlist":
                ",".join([f.mimeType for f in self.get_wms_formats()]),
                "getfeatureinfo_formatlist":
                "text/html,application/vnd.ogc.gml,text/plain",
            },
            namespace="wms")

        map_extent = None

        for collection in collections:
            group_name = None

            # calculate extent and timextent for every collection
            extent = collection.extent_wgs84
            # save overall map extent
            map_extent = self.join_extents(map_extent, extent)

            eo_objects = collection.eo_objects.filter(begin_time__isnull=False,
                                                      end_time__isnull=False)
            timeextent = ",".join(
                map(
                    lambda o:
                    ("/".join(map(isoformat, o.time_extent)) + "/PT1S"),
                    eo_objects))

            if len(suffixes) > 1:
                # create group layer, if there is more than one suffix for this
                # collection
                group_name = collection.identifier + "_group"
                group_layer = Layer(group_name)
                group_layer.setMetaData(
                    {
                        "title": group_name,
                        "abstract": group_name,
                        "extent": " ".join(map(str, extent)),
                    },
                    namespace="wms")

                minx, miny, maxx, maxy = extent
                group_layer.setExtent(minx, miny, maxx, maxy)

                # add default style
                default_class = Class("default")
                default_style = Style("default")
                default_class.insertStyle(default_style)
                group_layer.insertClass(default_class)

                map_.insertLayer(group_layer)

            for suffix in suffixes:
                layer_name = collection.identifier + (suffix or "")
                layer = Layer(layer_name)
                if group_name:
                    layer.setMetaData({"layer_group": "/" + group_name},
                                      namespace="wms")

                layer.setMetaData(
                    {
                        "title": layer_name,
                        "abstract": layer_name,
                        "extent": " ".join(map(str, extent)),
                        "timeextent": timeextent,
                    },
                    namespace="wms")
                map_.insertLayer(layer)

        for coverage in coverages:
            extent = coverage.extent_wgs84
            minx, miny, maxx, maxy = extent
            # save overall map extent
            map_extent = self.join_extents(map_extent, extent)

            layer_name = coverage.identifier
            layer = Layer(layer_name)
            layer.setMetaData(
                {
                    "title": layer_name,
                    "abstract": layer_name,
                    "extent": " ".join(map(str, extent)),
                },
                namespace="wms")
            minx, miny, maxx, maxy = extent
            layer.setExtent(minx, miny, maxx, maxy)

            map_.insertLayer(layer)

        # set the map_extent to a reasonable default value
        # in case there is no coverage or collection
        if map_extent is None:
            map_extent = (0.0, 0.0, 1.0, 1.0)

        map_minx, map_miny, map_maxx, map_maxy = map_extent
        map_.setExtent(map_minx, map_miny, map_maxx, map_maxy)

        request = create_request(request_values)
        raw_result = map_.dispatch(request)
        result = result_set_from_raw_data(raw_result)
        return result, get_content_type(result)