CSV

new_layer_from_file.CSV(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, **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

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

Returns

m – The created Maps object.

Return type

eomaps.Maps