# Path: qgis/compat_qgis.py
# COMPAT_QGIS_UNSUPPORTED_MSG = 'Unsupported QGIS version'
# COMPAT_QGIS_VERSION = None
# COMPAT_QT_VERSION = None
#     COMPAT_QGIS_VERSION = 3
#     COMPAT_QT_VERSION = 5
#     COMPAT_QGIS_VERSION = 2
#     COMPAT_QT_VERSION = 4
# COMPAT_PYQT_VERSION = QtCore.PYQT_VERSION_STR
# COMPAT_PYQT_VERSION = COMPAT_PYQT_VERSION.split('.')
# class CompatQgis:
# class CompatQt:
#     def is_qgis_2(cls):
#     def layers_registry(cls):
#     def layers_tree(cls, iface):
#     def add_legend_action(cls, iface, action, menu_name, layer_type, all_layers):
#     def remove_legend_action(cls, iface, action):
#     def wkt_geometry(cls, geometry):
#     def coordinate_transform_obj(cls, crs, import_crs, project):
#     def set_field_alias(cls, layer, field_name, field_alias):
#     def get_inner_geometry(cls, geometry): # returns non-const geometry
#     def is_geom_empty(cls, geometry):
#     def get_wkb_type(cls, wkb_type):
#     def is_layer_checked(cls, qgs_layer):
#     def decode_reply_escape(cls, ba):
#     def decode_reply_escape_log(cls, msg):
#     def set_section_resize_mod(cls, header, mode):
#     def get_dialog_result_path(cls, filepath):
#     def has_redirect_policy(cls):
#     def get_clean_python_value(cls, v):


from qgis.PyQt.QtCore import *
from qgis.PyQt.QtNetwork import *
from qgis.core import QgsVectorLayer, QgsRasterLayer, QgsMapLayer, QgsProject, QgsRectangle
from ..core.ngw_vector_layer import NGWVectorLayer
from ..core.ngw_raster_layer import NGWRasterLayer
from ..core.ngw_wfs_service import NGWWfsService
from ..core.ngw_qgis_style import NGWQGISStyle
from ..utils import log
from .compat_qgis import CompatQgis, CompatQgisMsgLogLevel, CompatQgisMsgBarLevel, CompatQgisGeometryType, CompatQgisWkbType
    qgs_geojson_layer = _add_geojson_layer(resource)

    _add_aliases(qgs_geojson_layer, resource)

    CompatQgis.layers_registry().addMapLayer(qgs_geojson_layer)

    if return_extent:
        if qgs_geojson_layer.extent().isEmpty() and qgs_geojson_layer.type() == QgsMapLayer.VectorLayer:
            qgs_geojson_layer.updateExtents()
            return qgs_geojson_layer.extent()


def add_resource_as_geojson_with_style(resource, style_resource, return_extent=False):
    qgs_geojson_layer = _add_geojson_layer(resource)

    _apply_style(style_resource, qgs_geojson_layer)

    _add_aliases(qgs_geojson_layer, resource)

    CompatQgis.layers_registry().addMapLayer(qgs_geojson_layer)

    if return_extent:
        if qgs_geojson_layer.extent().isEmpty() and qgs_geojson_layer.type() == QgsMapLayer.VectorLayer:
            qgs_geojson_layer.updateExtents()
            return qgs_geojson_layer.extent()


def add_resource_as_cog_raster(resource):
    qgs_raster_layer = _add_cog_raster_layer(resource)


# Path: qgis/compat_qgis.py
# COMPAT_QGIS_UNSUPPORTED_MSG = 'Unsupported QGIS version'
# COMPAT_QGIS_VERSION = None
# COMPAT_QT_VERSION = None
#     COMPAT_QGIS_VERSION = 3
#     COMPAT_QT_VERSION = 5
#     COMPAT_QGIS_VERSION = 2
#     COMPAT_QT_VERSION = 4
# COMPAT_PYQT_VERSION = QtCore.PYQT_VERSION_STR
# COMPAT_PYQT_VERSION = COMPAT_PYQT_VERSION.split('.')
# class CompatQgis:
# class CompatQt:
#     def is_qgis_2(cls):
#     def layers_registry(cls):
#     def layers_tree(cls, iface):
#     def add_legend_action(cls, iface, action, menu_name, layer_type, all_layers):
#     def remove_legend_action(cls, iface, action):
#     def wkt_geometry(cls, geometry):
#     def coordinate_transform_obj(cls, crs, import_crs, project):
#     def set_field_alias(cls, layer, field_name, field_alias):
#     def get_inner_geometry(cls, geometry): # returns non-const geometry
#     def is_geom_empty(cls, geometry):
#     def get_wkb_type(cls, wkb_type):
#     def is_layer_checked(cls, qgs_layer):
#     def decode_reply_escape(cls, ba):
#     def decode_reply_escape_log(cls, msg):
#     def set_section_resize_mod(cls, header, mode):
#     def get_dialog_result_path(cls, filepath):
#     def has_redirect_policy(cls):
#     def get_clean_python_value(cls, v):


# Path: qgis/resource_to_map.py
from qgis.PyQt.QtCore import *
from qgis.PyQt.QtNetwork import *
from qgis.core import QgsVectorLayer, QgsRasterLayer, QgsMapLayer, QgsProject, QgsRectangle
from ..core.ngw_vector_layer import NGWVectorLayer
from ..core.ngw_raster_layer import NGWRasterLayer
from ..core.ngw_wfs_service import NGWWfsService
from ..core.ngw_qgis_style import NGWQGISStyle
from ..utils import log
from .compat_qgis import CompatQgis, CompatQgisMsgLogLevel, CompatQgisMsgBarLevel, CompatQgisGeometryType, CompatQgisWkbType

    qgs_geojson_layer = _add_geojson_layer(resource)

    _add_aliases(qgs_geojson_layer, resource)

    CompatQgis.layers_registry().addMapLayer(qgs_geojson_layer)

    if return_extent:
        if qgs_geojson_layer.extent().isEmpty() and qgs_geojson_layer.type() == QgsMapLayer.VectorLayer:
            qgs_geojson_layer.updateExtents()
            return qgs_geojson_layer.extent()


def add_resource_as_geojson_with_style(resource, style_resource, return_extent=False):
    qgs_geojson_layer = _add_geojson_layer(resource)

    _apply_style(style_resource, qgs_geojson_layer)

    _add_aliases(qgs_geojson_layer, resource)

    CompatQgis.layers_registry().addMapLayer(qgs_geojson_layer)

    if return_extent:
        if qgs_geojson_layer.extent().isEmpty() and qgs_geojson_layer.type() == QgsMapLayer.VectorLayer:
            qgs_geojson_layer.updateExtents()
            return qgs_geojson_layer.extent()


def add_resource_as_cog_raster(resource):
    qgs_raster_layer = _add_cog_raster_layer(resource)


    map_layer = CompatQgis.layers_registry().addMapLayer(qgs_raster_layer)