:py:mod:`opendrift.readers.reader_shape` ======================================== .. py:module:: opendrift.readers.reader_shape Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: opendrift.readers.reader_shape.Reader Attributes ~~~~~~~~~~ .. autoapisummary:: opendrift.readers.reader_shape.logger .. py:data:: logger .. py:class:: Reader(shapes, proj4_str='+proj=lonlat +ellps=WGS84', invert=False) Bases: :py:obj:`opendrift.readers.basereader.BaseReader`, :py:obj:`opendrift.readers.basereader.ContinuousReader` The shape reader can be used to load generic shapes as the 'landmask' variable. Args: :param shapes: shapely geometries. :type shapes: iterable. :param proj4_str: Proj.4 string of shape file projection coordinates (default: '+proj=lonlat +ellps=WGS84'). :type proj4_str: string. Common constructor for all readers .. py:attribute:: name :value: 'shape' .. py:attribute:: variables :value: ['land_binary_mask'] .. py:attribute:: proj4 .. py:attribute:: crs .. py:attribute:: polys .. py:attribute:: land .. py:attribute:: always_valid :value: True .. py:method:: from_shpfiles(shpfiles, proj4_str='+proj=lonlat +ellps=WGS84', invert=False) :staticmethod: Construct a shape-reader from shape-files (.shp) Args: :param shapes: shape-file or files (.shp) :type shapes: string or list of file names as strings. :param proj4_str: Proj.4 string of shape file projection coordinates (default: '+proj=lonlat +ellps=WGS84'). :type proj4_str: string. .. py:method:: __on_land__(x, y) .. py:method:: get_variables(requestedVariables, time=None, x=None, y=None, z=None) Get binary mask of whether elements are on land or not. Args: x (deg[]): longitude (decimal degrees) y (deg[]): latitude (decimal degrees) ... x, y is given in reader local projection. Returns: Binary mask of point x, y on land.