CSV

static from_file.CSV(path=None, parameter=None, x=None, y=None, data_crs=None, plot_crs=None, shape=None, classify_specs=None, val_transform=None, coastline=False, read_kwargs=None, extent=None, **kwargs)

Convenience function to initialize a new Maps-object from a CSV file.

If no explicit shape is provided, EOmaps will try several attempts to plot the data (fastest first).

  • fist, shading as a raster is used: m.set_shape.shade_raster

  • if it fails, shading with points is used: m.set_shape.shade_raster

  • if it fails, ordinary ellipse-plot is created: m.set_shape.ellipses

This function is (in principal) a shortcut for:

>>> m = Maps(crs=...)
>>> m.set_data(**m.read_file.CSV(...))
>>> m.set_classify_specs(...)
>>> m.plot_map(**kwargs)
Parameters:
  • path (str) – The path to the csv-file.

  • parameter (str) – The column-name to use as parameter.

  • x (str) – The column-name to use as “x” coordinate.

  • y (str) – The column-name to use as “y” coordinate.

  • data_crs (crs-identifier) – The crs of the data. (see “Maps.set_data” for details)

  • plot_crs (any, optional) – The plot-crs. A crs-identifier usable with cartopy. The default is None, in which case the crs of the GeoTIFF is used if possible, else epsg=4326.

  • shape (str, dict or None, optional) –

    • if str: The name of the shape to use, e.g. one of: [‘geod_circles’, ‘ellipses’, ‘rectangles’, ‘voronoi_diagram’, ‘delaunay_triangulation’, ‘shade_points’, ‘shade_raster’]

    • if dict: a dictionary with parameters passed to the selected shape. The dict MUST contain a key “shape” that holds the name of the shape!

      >>> dict(shape="rectangles", radius=1, radius_crs=.5)
      

  • classify_specs (dict, optional) – A dict of keyword-arguments passed to m.set_classify_specs(). The default is None.

  • val_transform (None or callable) –

    A function that is used to transform the data-values. (e.g. to apply scaling etc.)

    >>> def val_transform(a):
    >>>     return a / 10
    

  • coastline (bool) – Indicator if a coastline should be added or not. The default is False

  • read_kwargs (dict) – Additional kwargs passed to pandas.read_file() (e.g. to set index_col etc.) The default is None

  • extent (tuple or string) –

    Set the extent of the map prior to plotting (can provide great speedups if only a subset of the dataset is shown!)

    • If a tuple is provided, it is used to set the plot-extent before plotting via m.set_extent(extent)

      • (x0, x1, y0, y1) : provide the extent in lat/lon (epsg 4326)

      • ((x0, x1, y0, y1), crs) : provide the extent in the given crs

    • If a string is provided, it is used to attempt to set the plot-extent before plotting via m.set_extent_to_location(extent)

    The default is None

  • kwargs – Keyword-arguments passed to m.plot_map()

Returns:

m – The created Maps object.

Return type:

eomaps.Maps