From: Frédéric Perrin Date: Sat, 30 Nov 2019 20:50:21 +0000 (+0000) Subject: Merge branch 'srtm-multi-sources' into fp-integration X-Git-Tag: v19.2.fp1~1 X-Git-Url: https://gitweb.fperrin.net/?a=commitdiff_plain;h=6b5c5c627a6cd528bd19bd76db95135c09deb535;hp=-c;p=GpsPrune.git Merge branch 'srtm-multi-sources' into fp-integration --- 6b5c5c627a6cd528bd19bd76db95135c09deb535 diff --combined src/tim/prune/FunctionLibrary.java index 0245b11,ea78e9a..4be286e --- a/src/tim/prune/FunctionLibrary.java +++ b/src/tim/prune/FunctionLibrary.java @@@ -28,7 -28,6 +28,7 @@@ import tim.prune.function.PhotoPopupFun import tim.prune.function.PlayAudioFunction; import tim.prune.function.RearrangePhotosFunction; import tim.prune.function.RearrangeWaypointsFunction; +import tim.prune.function.RemoveAltitudes; import tim.prune.function.RemoveAudioFunction; import tim.prune.function.RemovePhotoFunction; import tim.prune.function.RotatePhoto; @@@ -57,12 -56,12 +57,12 @@@ import tim.prune.function.settings.Save import tim.prune.function.settings.SetAltitudeTolerance; import tim.prune.function.settings.SetColours; import tim.prune.function.settings.SetDisplaySettings; + import tim.prune.function.settings.SetEarthdataAuthentication; import tim.prune.function.settings.SetLanguage; import tim.prune.function.settings.SetMapBgFunction; import tim.prune.function.settings.SetPathsFunction; import tim.prune.function.sew.SewTrackSegmentsFunction; import tim.prune.function.sew.SplitSegmentsFunction; - import tim.prune.function.srtm.DownloadSrtmFunction; import tim.prune.function.srtm.LookupSrtmFunction; import tim.prune.function.weather.GetWeatherForecastFunction; import tim.prune.load.AudioLoader; @@@ -104,14 -103,12 +104,13 @@@ public abstract class FunctionLibrar public static GenericFunction FUNCTION_DELETE_BY_DATE = null; public static SingleNumericParameterFunction FUNCTION_INTERPOLATE = null; public static GenericFunction FUNCTION_LOOKUP_SRTM = null; - public static GenericFunction FUNCTION_DOWNLOAD_SRTM = null; public static GenericFunction FUNCTION_NEARBY_WIKIPEDIA = null; public static GenericFunction FUNCTION_SEARCH_WIKIPEDIA = null; public static GenericFunction FUNCTION_SEARCH_OSMPOIS = null; public static GenericFunction FUNCTION_DOWNLOAD_OSM = null; public static GenericFunction FUNCTION_ADD_TIME_OFFSET = null; public static GenericFunction FUNCTION_ADD_ALTITUDE_OFFSET = null; + public static GenericFunction FUNCTION_REMOVE_ALTITUDES = null; public static GenericFunction FUNCTION_CONVERT_NAMES_TO_TIMES = null; public static GenericFunction FUNCTION_DELETE_FIELD_VALUES = null; public static GenericFunction FUNCTION_PASTE_COORDINATES = null; @@@ -148,6 -145,7 +147,7 @@@ public static GenericFunction FUNCTION_SET_COLOURS = null; public static GenericFunction FUNCTION_SET_LANGUAGE = null; public static SingleNumericParameterFunction FUNCTION_SET_ALTITUDE_TOLERANCE = null; + public static GenericFunction FUNCTION_SET_EARTHDATA_AUTH = null; public static GenericFunction FUNCTION_SET_TIMEZONE = null; public static GenericFunction FUNCTION_HELP = null; public static GenericFunction FUNCTION_SHOW_KEYS = null; @@@ -185,14 -183,12 +185,13 @@@ FUNCTION_DELETE_BY_DATE = new DeleteByDateFunction(inApp); FUNCTION_INTERPOLATE = new InterpolateFunction(inApp); FUNCTION_LOOKUP_SRTM = new LookupSrtmFunction(inApp); - FUNCTION_DOWNLOAD_SRTM = new DownloadSrtmFunction(inApp); FUNCTION_NEARBY_WIKIPEDIA = new GetWikipediaFunction(inApp); FUNCTION_SEARCH_WIKIPEDIA = new SearchWikipediaNames(inApp); FUNCTION_SEARCH_OSMPOIS = new SearchOsmPoisFunction(inApp); FUNCTION_DOWNLOAD_OSM = new DownloadOsmFunction(inApp); FUNCTION_ADD_TIME_OFFSET = new AddTimeOffset(inApp); FUNCTION_ADD_ALTITUDE_OFFSET = new AddAltitudeOffset(inApp); + FUNCTION_REMOVE_ALTITUDES = new RemoveAltitudes(inApp); FUNCTION_CONVERT_NAMES_TO_TIMES = new ConvertNamesToTimes(inApp); FUNCTION_DELETE_FIELD_VALUES = new DeleteFieldValues(inApp); FUNCTION_PASTE_COORDINATES = new PasteCoordinates(inApp); @@@ -230,6 -226,7 +229,7 @@@ FUNCTION_SET_LANGUAGE = new SetLanguage(inApp); FUNCTION_SET_ALTITUDE_TOLERANCE = new SetAltitudeTolerance(inApp); FUNCTION_SET_TIMEZONE = new SelectTimezoneFunction(inApp); + FUNCTION_SET_EARTHDATA_AUTH = new SetEarthdataAuthentication(inApp); FUNCTION_HELP = new HelpScreen(inApp); FUNCTION_SHOW_KEYS = new ShowKeysScreen(inApp); FUNCTION_ABOUT = new AboutScreen(inApp); diff --combined src/tim/prune/gui/MenuManager.java index 404a4fa,b24c718..bd0d378 --- a/src/tim/prune/gui/MenuManager.java +++ b/src/tim/prune/gui/MenuManager.java @@@ -34,6 -34,9 +34,9 @@@ import tim.prune.function.SearchOpenCac import tim.prune.function.browser.UrlGenerator; import tim.prune.function.browser.WebMapFunction; import tim.prune.function.search.SearchMapillaryFunction; + import tim.prune.function.srtm.DownloadSrtmFunction; + import tim.prune.function.srtm.SrtmGl1Source; + import tim.prune.function.srtm.Srtm3Source; /** * Class to manage the menu bar and tool bar, @@@ -77,7 -80,6 +80,7 @@@ public class MenuManager implements Dat private JMenuItem _reverseItem = null; private JMenuItem _addTimeOffsetItem = null; private JMenuItem _addAltitudeOffsetItem = null; + private JMenuItem _removeAltitudesItem = null; private JMenuItem _mergeSegmentsItem = null; private JMenuItem _rearrangeWaypointsItem = null; private JMenuItem _splitSegmentsItem = null; @@@ -94,7 -96,7 +97,7 @@@ private JMenuItem _getGpsiesItem = null; private JMenuItem _uploadGpsiesItem = null; private JMenuItem _lookupSrtmItem = null; - private JMenuItem _downloadSrtmItem = null; + private JMenu _downloadSrtmMenu = null; private JMenuItem _nearbyWikipediaItem = null; private JMenuItem _nearbyOsmPoiItem = null; private JMenuItem _showPeakfinderItem = null; @@@ -258,8 -260,15 +261,15 @@@ // SRTM _lookupSrtmItem = makeMenuItem(FunctionLibrary.FUNCTION_LOOKUP_SRTM, false); onlineMenu.add(_lookupSrtmItem); - _downloadSrtmItem = makeMenuItem(FunctionLibrary.FUNCTION_DOWNLOAD_SRTM, false); - onlineMenu.add(_downloadSrtmItem); + // Download SRTM sub-menu + _downloadSrtmMenu = new JMenu(I18nManager.getText("function.downloadsrtm")); + _downloadSrtmMenu.setEnabled(false); + JMenuItem downloadStrmGl1Item = makeMenuItem(new DownloadSrtmFunction(_app, new SrtmGl1Source())); + _downloadSrtmMenu.add(downloadStrmGl1Item); + JMenuItem downloadStrm3Item = makeMenuItem(new DownloadSrtmFunction(_app, new Srtm3Source())); + _downloadSrtmMenu.add(downloadStrm3Item); + onlineMenu.add(_downloadSrtmMenu); + // Get gpsies tracks _getGpsiesItem = makeMenuItem(FunctionLibrary.FUNCTION_GET_GPSIES, false); onlineMenu.add(_getGpsiesItem); @@@ -426,8 -435,6 +436,8 @@@ rangeMenu.add(_addTimeOffsetItem); _addAltitudeOffsetItem = makeMenuItem(FunctionLibrary.FUNCTION_ADD_ALTITUDE_OFFSET, false); rangeMenu.add(_addAltitudeOffsetItem); + _removeAltitudesItem = makeMenuItem(FunctionLibrary.FUNCTION_REMOVE_ALTITUDES, false); + rangeMenu.add(_removeAltitudesItem); _mergeSegmentsItem = new JMenuItem(I18nManager.getText("menu.range.mergetracksegments")); _mergeSegmentsItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@@ -654,6 -661,8 +664,8 @@@ settingsMenu.add(makeMenuItem(new ChooseSingleParameter(_app, FunctionLibrary.FUNCTION_SET_ALTITUDE_TOLERANCE))); // Set timezone settingsMenu.add(makeMenuItem(FunctionLibrary.FUNCTION_SET_TIMEZONE)); + // Set Earthdata authentication + settingsMenu.add(makeMenuItem(FunctionLibrary.FUNCTION_SET_EARTHDATA_AUTH)); settingsMenu.addSeparator(); // Save configuration settingsMenu.add(makeMenuItem(FunctionLibrary.FUNCTION_SAVECONFIG)); @@@ -892,7 -901,7 +904,7 @@@ _getWeatherItem.setEnabled(hasData); _findWaypointItem.setEnabled(hasData && _track.hasWaypoints()); // have we got a cache? - _downloadSrtmItem.setEnabled(hasData && Config.getConfigString(Config.KEY_DISK_CACHE) != null); + _downloadSrtmMenu.setEnabled(hasData && Config.getConfigString(Config.KEY_DISK_CACHE) != null); // have we got any timestamps? _deleteByDateItem.setEnabled(hasData && _track.hasData(Field.TIMESTAMP)); @@@ -959,7 -968,6 +971,7 @@@ _reverseItem.setEnabled(hasRange); _addTimeOffsetItem.setEnabled(hasRange); _addAltitudeOffsetItem.setEnabled(hasRange); + _removeAltitudesItem.setEnabled(hasRange); _convertNamesToTimesItem.setEnabled(hasRange && _track.hasWaypoints()); _deleteFieldValuesItem.setEnabled(hasRange); _fullRangeDetailsItem.setEnabled(hasRange); diff --combined src/tim/prune/lang/prune-texts_en.properties index 63bb73f,736c145..82219b2 --- a/src/tim/prune/lang/prune-texts_en.properties +++ b/src/tim/prune/lang/prune-texts_en.properties @@@ -94,7 -94,6 +94,7 @@@ function.interpolate=Interpolate point function.deletebydate=Delete points by date function.addtimeoffset=Add time offset function.addaltitudeoffset=Add altitude offset +function.removealtitudes=Remove altitudes function.findwaypoint=Find waypoint function.rearrangewaypoints=Rearrange waypoints function.convertnamestotimes=Convert waypoint names to times @@@ -115,6 -114,9 +115,9 @@@ function.getgpsies=Get Gpsies track function.uploadgpsies=Upload track to Gpsies function.lookupsrtm=Get altitudes from SRTM function.downloadsrtm=Download SRTM tiles + function.downloadsrtm.SRTMGL1_v003=Download SRTM 1 arc-second tiles + function.downloadsrtm.SRTMGL1_v003.needsetup=An Earthdata account is necessary to download SRTM 1 arc-second tiles + function.downloadsrtm.SRTM3_v21=Download SRTM 3 arc-second tiles function.getwikipedia=Get nearby Wikipedia articles function.searchwikipedianames=Search Wikipedia by name function.searchosmpois=Get nearby OSM points @@@ -151,6 -153,7 +154,7 @@@ function.managetilecache=Manage tile ca function.getweatherforecast=Get weather forecast function.setaltitudetolerance=Set altitude tolerance function.selecttimezone=Set timezone + function.setearthdataauthentication=Set Earthdata authentication # Dialogs dialog.exit.confirm.title=Exit GpsPrune @@@ -576,6 -579,11 +580,11 @@@ dialog.displaysettings.size.small=Smal dialog.displaysettings.size.medium=Medium dialog.displaysettings.size.large=Large dialog.downloadosm.desc=Confirm to download the raw OSM data for the specified area: + dialog.earthdataauth.intro=

Configure username and password to access your NASA Earthdata login account.

Create an account at https://urs.earthdata.nasa.gov/users/new.

+ dialog.earthdataauth.user=Username + dialog.earthdataauth.password=Password + dialog.earthdataauth.authaccepted=Username and password accepted + dialog.earthdataauth.authrejected=Username and password rejected dialog.searchwikipedianames.search=Search for: dialog.weather.location=Location dialog.weather.update=Forecast updated @@@ -633,7 -641,6 +642,7 @@@ confirm.mergetracksegments=Track segmen confirm.reverserange=Range reversed confirm.addtimeoffset=Time offset added confirm.addaltitudeoffset=Altitude offset added +confirm.removealtitudes=Altitudes removed confirm.rearrangewaypoints=Waypoints rearranged confirm.rearrangephotos=Photos rearranged confirm.splitsegments=%d segment splits were made @@@ -854,7 -861,6 +863,7 @@@ undo.splitsegments=split track segment undo.sewsegments=sew track segments undo.addtimeoffset=add time offset undo.addaltitudeoffset=add altitude offset +undo.removealtitudes=remove altitudes undo.rearrangewaypoints=rearrange waypoints undo.cutandmove=move section undo.connect=connect