class_docstr: Test that the builtin areas are all valid.
docstr: Test all areas have valid projections with rasterio.
docstr_tok: ["Test","all","areas","have","valid","projections","with","rasterio","."]
code: def test_areas_rasterio(self):
      """Test all areas have valid projections with rasterio."""
      try:
          from rasterio.crs import CRS
      except ImportError:
          return unittest.skip("Missing rasterio dependency")
      if not hasattr(CRS, "from_dict"):
          return unittest.skip("RasterIO 1.0+ required")
  
      import numpy as np
      import xarray as xr
      from pyresample import parse_area_file
      from pyresample.geometry import SwathDefinition
  
      from satpy.resample import get_area_file
  
      lons = np.array([[0, 0.1, 0.2], [0.05, 0.15, 0.25]])
      lats = np.array([[0, 0.1, 0.2], [0.05, 0.15, 0.25]])
      lons = xr.DataArray(lons)
      lats = xr.DataArray(lats)
      swath_def = SwathDefinition(lons, lats)
      all_areas = parse_area_file(get_area_file())
      for area_obj in all_areas:
          if hasattr(area_obj, "freeze"):
              try:
                  area_obj = area_obj.freeze(lonslats=swath_def)
              except RuntimeError:
                  # we didn't provide enough info to freeze, hard to guess
                  # in a generic test so just skip this area
                  continue
          _ = CRS.from_user_input(area_obj.crs)
  
imports: from __future__ import annotations
  import contextlib
  import os
  import sys
  import unittest
  from importlib.metadata import EntryPoint
  from pathlib import Path
  from typing import Callable, Iterator
  from unittest import mock
  import pytest
  import satpy
  from satpy import DatasetDict
  from satpy._config import cached_entry_point
  from satpy.composites.config_loader import load_compositor_configs_for_sensors
label_desc: Use image node_id 2 for calling the TestBuiltinAreas obj's underlying member method code with example usage: obj.test_areas_rasterio() and returns: unittest, unittest