예제 #1
0
def layer_crs_nongeom():
    product_layer = OWSProductLayer.__new__(OWSProductLayer)
    product_layer.name = "test_layer"
    product_layer.global_cfg = OWSConfig.__new__(OWSConfig)
    product_layer.global_cfg.published_CRSs = {
        "EPSG:3857": {  # Web Mercator
            "geographic": False,
            "horizontal_coord": "x",
            "vertical_coord": "y",
            "vertical_coord_first": False,
            "gml_name": "http://www.opengis.net/def/crs/EPSG/0/3857",
            "alias_of": None,
        },
        "EPSG:4326": {  # WGS-84
            "geographic": True,
            "vertical_coord_first": True,
            "horizontal_coord": "longitude",
            "vertical_coord": "latitude",
            "gml_name": "http://www.opengis.net/def/crs/EPSG/0/4326",
            "alias_of": None,
        },
        "EPSG:3577": {
            "geographic": False,
            "horizontal_coord": "x",
            "vertical_coord": "y",
            "vertical_coord_first": False,
            "gml_name": "http://www.opengis.net/def/crs/EPSG/0/3577",
            "alias_of": None,
        },
        "TEST:CRS": {
            "geographic": False,
            "horizontal_coord": "horrible_zonts",
            "vertical_coord": "vertex_calories",
            "vertical_coord_first": False,
            "gml_name": "TEST/CRS",
            "alias_of": None,
        },
        "TEST:NATIVE_CRS": {
            "geographic": False,
            "horizontal_coord": "hortizonal_cults",
            "vertical_coord": "verbal_tics",
            "vertical_coord_first": False,
            "gml_name": "TEST/NATIVE_CRS",
            "alias_of": None,
        },
    }
    product_layer.global_cfg.internal_CRSs = product_layer.global_cfg.published_CRSs
    product_layer.native_CRS = "TEST:NATIVE_CRS"
    product_layer.native_CRS_def = \
        product_layer.global_cfg.published_CRSs[
            product_layer.native_CRS
        ]
    return product_layer
예제 #2
0
def layer_crs_geom():
    product_layer = OWSProductLayer.__new__(OWSProductLayer)
    product_layer.name = "test_layer"
    product_layer.global_cfg = OWSConfig.__new__(OWSConfig)
    product_layer.global_cfg.published_CRSs = {
        "EPSG:3857": {  # Web Mercator
            "geographic": False,
            "horizontal_coord": "x",
            "vertical_coord": "y",
            "vertical_coord_first": False,
            "gml_name": "http://www.opengis.net/def/crs/EPSG/0/3857",
            "alias_of": False
        },
        "EPSG:4326": {  # WGS-84
            "geographic": True,
            "vertical_coord_first": True,
            "horizontal_coord": "longitude",
            "vertical_coord": "latitude",
            "gml_name": "http://www.opengis.net/def/crs/EPSG/0/4326",
            "alias_of": False
        },
        "EPSG:3577": {
            "geographic": False,
            "horizontal_coord": "x",
            "vertical_coord": "y",
            "vertical_coord_first": False,
            "gml_name": "http://www.opengis.net/def/crs/EPSG/0/3577",
            "alias_of": False
        },
    }
    product_layer.global_cfg.internal_CRSs = product_layer.global_cfg.published_CRSs
    product_layer.native_CRS = "EPSG:3577"
    product_layer.native_CRS_def = \
        product_layer.global_cfg.published_CRSs[
            product_layer.native_CRS
        ]
    product_layer.grids = {
        'EPSG:3857': {
            'origin': (12324052.573696733, -5742240.963567746),
            'resolution': (24.631092099500425, -27.828535092231032)
        },
        'EPSG:4326': {
            'origin': (-8.95553593506657, 157.105656164263),
            'resolution': (-0.00017552732376162043, 0.0002723248887547909)
        },
        'EPSG:3577': {
            'origin': (-2407984.8524648934, -5195512.771063174),
            'resolution': (25, -25)
        },
    }
    times = [datetime.date(2013, 1, 1), datetime.date(2014, 1, 1), datetime.date(2015, 1, 1),
              datetime.date(2016, 1, 1), datetime.date(2017, 1, 1), datetime.date(2018, 1, 1)]
    product_layer.dynamic = False
    product_layer._ranges = {
        'lat': {
            'min': -34.5250413940276,
            'max': -33.772472435988
        },
        'lon': {
            'min': 150.330509919584,
            'max': 151.258021405841
        },
        'times': times,
        'start_time': datetime.date(2013, 1, 1),
        'end_time': datetime.date(2018, 1, 1),
        'time_set': set(times),
        'bboxes': {
            'EPSG:3111': {
                'top': 5725844.213533809, 'left': -1623290.9363678931,
                'right': 3983581.449863785, 'bottom': 1042109.9920098772
            },
            'EPSG:3577': {
                'top': -936185.3115191332, 'left': -2407984.8524648934,
                'right': 2834259.110253384, 'bottom': -5195512.771063174
            },
            'EPSG:3857': {
                'top': -1001009.9542990683, 'left': 12324052.573696733,
                'right': 17488921.644948877, 'bottom': -5742240.963567746
            },
            'EPSG:4326': {
                'top': -8.95553593506657, 'left': 110.708847892443,
                'right': 157.105656164263, 'bottom': -45.761684927317
            }
        }
    }
    return product_layer