1.5.1.1.6.1.2. polar2grid.grids.manager module¶
Utilities and accessor functions to grids and projections used in polar2grid.
- class polar2grid.grids.manager.GridManager(*grid_configs)[source]¶
Bases:
object
Object that holds grid information about the grids added to it.
- add_grid_config(grid_config_filename)[source]¶
Load a grid configuration file.
If a
grid_name
was already added its information is overwritten.
- add_proj4_grid_info(grid_name, proj4_str, width, height, cell_width, cell_height, origin_x, origin_y)[source]¶
- get_grid_definition(grid_name: str) GridDefinition [source]¶
Return a standard GridDefinition object for the specified grid.
- Returns:
GridDefinition object, updates to this object do not affect information internal to the Cartographer.
- get_grid_info(grid_name)[source]¶
Return a grid information dictionary about the
grid_name
specified.The information returned will always be a copy of the information stored internally in this object. So a change to the dictionary returned does NOT affect the internal information.
- Raises:
ValueError – if
grid_name
does not exist
- polar2grid.grids.manager._parse_meter_degree_param(param) tuple[float, bool] [source]¶
Parse a configuration parameter that could be meters or degrees.
Degrees are denoted with a suffix of ‘deg’. Meters are denoted with a suffix of either ‘m’ or no suffix at all.
- Returns:
(float param, True if degrees/False if meters)
- polar2grid.grids.manager._parse_optional_config_param(str_part, convert_func, unspecified_info=None)[source]¶
- polar2grid.grids.manager.parse_and_convert_proj4_config_line(grid_name, parts)[source]¶
Return a dictionary of information for a specific PROJ.4 grid from a grid configuration line.
parts
should be every comma-separated part of the line including thegrid_name
.
- polar2grid.grids.manager.read_grids_config(config_filepath, convert_coords=True)[source]¶
Read the “grids.conf” file and create dictionaries mapping the grid name to the necessary information.
There are two dictionaries created, one for gpd file grids and one for proj4 grids.
Format for proj4 grids: grid_name,proj4,proj4_str,pixel_size_x,pixel_size_y,origin_x,origin_y,width,height
where ‘proj4’ is the actual text ‘proj4’ to define the grid as a proj4 grid.