/** * Sets the geolocation dataset names. * * @param lat the name of the dataset providing the latitude values, must not be null * @param lon the name of the dataset providing the longitude values, must not be null */ public void setGeolocationDatasetNames(String lat, String lon) { Guardian.assertNotNullOrEmpty("lat", lat); Guardian.assertNotNullOrEmpty("lon", lon); setGeolocationDatasetNames(new String[]{lat, lon}); }
description.setGeolocationDatasetNames(records[1], records[2]); } else { description.setExternalGeolocationPattern(records[1]);
/** * Tests the correct functionality of the geolocation accessors. */ @Test public void testGeolocationAccess() { // none shall be set initially assertNull(prod.getGeolocationDatasetNames()); // set a tie point geolocation and check String expLat = "latitude"; String expLon = "longitude"; String[] geoLoc; prod.setGeolocationDatasetNames(expLat, expLon); geoLoc = prod.getGeolocationDatasetNames(); assertNotNull(geoLoc); assertEquals(2, geoLoc.length); assertEquals(expLat, geoLoc[0]); assertEquals(expLon, geoLoc[1]); }
/** * Checks the correct functionality of the geocoding accessors */ @Test public void testGeocodingAccessors() { // intially everything is null and false String[] latlon; latlon = prod.getGeolocationDatasetNames(); assertNull(latlon); assertEquals(false, prod.hasExternalGeolocation()); assertNull(prod.getExternalGeolocationPattern()); // set lat/lon tiepoint geocoding String expLat = "latitude"; String expLon = "lomgitude"; prod.setGeolocationDatasetNames(expLat, expLon); assertEquals(false, prod.hasExternalGeolocation()); latlon = prod.getGeolocationDatasetNames(); assertNotNull(latlon); assertEquals(2, latlon.length); assertEquals(expLat, latlon[0]); assertEquals(expLon, latlon[1]); // set external geocoding String expExter = "external"; prod.setExternalGeolocationPattern(expExter); assertEquals(true, prod.hasExternalGeolocation()); assertEquals(expExter, prod.getExternalGeolocationPattern()); prod.setExternalGeolocationPattern(null); assertEquals(false, prod.hasExternalGeolocation()); assertEquals(null, prod.getExternalGeolocationPattern()); }