Beispiel #1
0
def test_transformer_proj__area_of_interest():
    transformer = Transformer.from_proj(4326,
                                        2964,
                                        area_of_interest=AreaOfInterest(
                                            -136.46, 49.0, -60.72, 83.17))
    assert transformer.description == "Inverse of NAD27 to WGS 84 (13) + Alaska Albers"
Beispiel #2
0
    pyproj.datadir.append_data_dir(os.environ["WEBPROJ_LIB"])

# Set up the app
app = Flask(__name__)
app.url_map.converters["number"] = IntFloatConverter
CORS(app)

api = Api(app, version=version, title="WEBPROJ")

_DATA = Path(__file__).parent / Path("data.json")

with open(_DATA, "r", encoding="UTF-8") as data:
    CRS_LIST = json.load(data)

AOI = {
    "DK": AreaOfInterest(3.0, 54.5, 15.5, 58.0),
    "GL": AreaOfInterest(-75.0, 56.0, 8.5, 87.5),
}


def _make_4d(coord):
    if len(coord) == 2:
        return (coord[0], coord[1], None, None)

    if len(coord) == 3:
        return (coord[0], coord[1], coord[2], None)

    if len(coord) == 4:
        return (coord[0], coord[1], coord[2], coord[3])

    return ()