Describe the bug
It is currently possible to specify latitude and longitude grid interval values that are larger than the maximum range of latitudes and longitudes being mapped, i.e. the half-open intervals [0, 180) and [0, 360), respectively..
To Reproduce
Steps to reproduce the behavior:
Create a Simple Cylindrical map with a specific latitude and longitude range with the full range of latitude and longitudes.
Create a grid image for that map with latitude and longitude intervals greater than 180 and 360, respectively.
MaRC handles the bogus values somewhat gracefully in that no grid will be created, but it still allows the user to specify such values without any diagnostic message.
Expected behavior
MaRC and the MaRC library should not allow the invalid lat/lon grid intervals to be set to begin with. Such inputs should be validated beyond the existing negative value checks.
MaRC should also document that the latitude grid is always [-90 + lat_interval, 90) and (0, 360 - lon_interval], i.e. incrementing the latitude grid from -90, and decrementing the longitude from 360, even though the corresponding grid lines may not be in the map latitude/longitude range.
Desktop (please complete the following information):
OS: Linux
Compiler: g++ 7.3
Additional context
The problem was first noticed through inspection in the MaRC::SimpleCylindrical::plot_grid() method, but the same problem exists for all MaRC map projection implementations. It might be useful to perform some minimal grid lat/lon interval validation in in MaRC::MapFactory::make_grid() to centralize such validation in one place common to all map projections.
Describe the bug It is currently possible to specify latitude and longitude grid interval values that are larger than the maximum range of latitudes and longitudes being mapped, i.e. the half-open intervals
[0, 180)
and[0, 360)
, respectively..To Reproduce Steps to reproduce the behavior:
180
and360
, respectively.Expected behavior MaRC and the MaRC library should not allow the invalid lat/lon grid intervals to be set to begin with. Such inputs should be validated beyond the existing negative value checks.
MaRC should also document that the latitude grid is always
[-90 + lat_interval, 90)
and(0, 360 - lon_interval]
, i.e. incrementing the latitude grid from-90
, and decrementing the longitude from360
, even though the corresponding grid lines may not be in the map latitude/longitude range.Desktop (please complete the following information):
Additional context The problem was first noticed through inspection in the
MaRC::SimpleCylindrical::plot_grid()
method, but the same problem exists for all MaRC map projection implementations. It might be useful to perform some minimal grid lat/lon interval validation in inMaRC::MapFactory::make_grid()
to centralize such validation in one place common to all map projections.