#include "gpx.h"
#include "util.h"
+gboolean convert_iaru_loc_to_lat_lon(const gchar* txt_lon, gdouble* lat, gdouble* lon);
/**
* Pop up a modal dialog box with simple error information in it.
case IARU_LOC:
case UK_OSGB:
case UK_NGR:
+ case UK_NGR6:
// These formats should not be formatted in the same way
// - they need to be converted first, therefore if we reach
// this bit of code use the first available format - drop through.
{
case UK_OSGB:
case UK_NGR:
+ case UK_NGR6:
valid = os_grid_check_lat_lon(lat, lon);
if(fallback_deg_format != NULL) *fallback_deg_format = DDPDDDDD;
break;
snprintf(eing, 12, "%u", easting);
snprintf(ning, 12, "%u", northing);
- snprintf(eing, 5, "%s", eing+1);
- snprintf(ning, 5, "%s", ning+1);
+ snprintf(eing, (_degformat == UK_NGR ? 5 : 4), "%s", eing+1);
+ snprintf(ning, (_degformat == UK_NGR ? 5 : 4), "%s", ning+1);
sprintf(bng, "%c%c%s%s",
(char)(tmp + 65),
gboolean valid = FALSE;
// UK_NGR starts with two letters, and then all numbers - it may contain spaces - no lon will be entered
- if( _degformat == UK_NGR)
+ if( _degformat == UK_NGR || _degformat == UK_NGR6 )
{
valid = convert_os_ngr_to_latlon(txt_lat, lat, lon);
}
break;
case UK_NGR:
+ case UK_NGR6:
if(convert_lat_lon_to_bng(d_lat, d_lon, lat))
{