code: def get_gdf(
      layer,
      perimeter,
      perimeter_tolerance=0,
      tags=None,
      osmid=None,
      custom_filter=None,
      union=False,
      elevation=None,
      vert_exag=1,
      azdeg=90,
      altdeg=80,
      pad=1,
      min_height=30,
      max_height=None,
      n_curves=100,
      **kwargs,
  ):
      # Supress shapely deprecation warning
      warnings.simplefilter("ignore", ShapelyDeprecationWarning)
  
      # Apply tolerance to the perimeter
      perimeter_with_tolerance = (
          ox.project_gdf(perimeter)
          .buffer(perimeter_tolerance)
          .to_crs(4326)
      )
      perimeter_with_tolerance = unary_union(
          perimeter_with_tolerance.geometry
      ).buffer(0)
  
      # Fetch from perimeter's bounding box, to avoid missing some geometries
      bbox = box(*perimeter_with_tolerance.bounds)
  
      if layer == "hillshade":
          gdf = get_hillshade(
              mask_elevation(get_elevation(elevation), perimeter),
              pad=pad,
              azdeg=azdeg,
              altdeg=altdeg,
              vert_exag=vert_exag,
              min_height=min_height,
              max_height=max_height,
          )
      elif layer == "level_curves":
          gdf = get_level_curves(
              mask_elevation(get_elevation(elevation), perimeter),
              pad=pad,
              n_curves=n_curves,
              min_height=min_height,
              max_height=max_height,
          )
      elif layer in ["streets", "railway", "waterway"]:
          graph = ox.graph_from_polygon(
              bbox,
              custom_filter=custom_filter,
              truncate_by_edge=True,
          )
          gdf = ox.graph_to_gdfs(graph, nodes=False)
      elif layer == "coastline":
          # Fetch geometries from OSM
          gdf = ox.geometries_from_polygon(
              bbox, tags={tags: True} if type(tags) == str else tags
          )
      else:
          if osmid is None:
              # Fetch geometries from OSM
              gdf = ox.geometries_from_polygon(
                  bbox, tags={tags: True} if type(tags) == str else tags
              )
          else:
              gdf = ox.geocode_to_gdf(osmid, by_osmid=True)
  
      # Intersect with perimeter
      gdf.geometry = gdf.geometry.intersection(perimeter_with_tolerance)
      # gdf = gdf[~gdf.geometry.is_empty]
      gdf.drop(gdf[gdf.geometry.is_empty].index, inplace=True)
  
      return gdf
  
file_path: prettymaps/prettymaps/fetch.py
imports: import re
  import warnings
  import numpy
  import osmnx
  from copy import deepcopy
  from shapely.geometry import box, Point, Polygon, MultiPolygon, LineString, MultiLineString
  from geopandas import GeoDataFrame
  from shapely.affinity import rotate
  from shapely.ops import unary_union
  from shapely.errors import ShapelyDeprecationWarning
label_desc: Use image node_id 4 for calling a global function with example usage: get_gdf(layer, perimeter, perimeter_tolerance, tags, osmid, custom_filter, union, elevation, vert_exag, azdeg, altdeg, pad, min_height, max_height, n_curves) and returns: gdf