diff --git a/collect-earth/collect-earth-app/resources/collectPlanetHtml.fmt b/collect-earth/collect-earth-app/resources/collectPlanetHtml.fmt index 4daecea7fd..37ba7627be 100644 --- a/collect-earth/collect-earth-app/resources/collectPlanetHtml.fmt +++ b/collect-earth/collect-earth-app/resources/collectPlanetHtml.fmt @@ -67,7 +67,7 @@ data : { start: getFormattedDate( startDay ), end : getFormattedDate( lastDay ), - itemTypes : ["PSScene3Band","PSScene4Band","REOrthoTile"], // , "REOrthoTile" RapidEye not working + itemTypes : ["PSScene"], // , "REOrthoTile" RapidEye not working -- "PSScene3Band","PSScene4Band","REOrthoTile" have been deprecated geometry : JSON.stringify( geometry ) }, success : function( data ) { @@ -193,7 +193,7 @@ data : { start: getFormattedDate( startDay ), end : getFormattedDate( new Date() ), - itemTypes : ["PSScene3Band","PSScene4Band","REOrthoTile"], // , "REOrthoTile" RapidEye not working + itemTypes : ["PSScene"], // , "REOrthoTile" RapidEye not working -- "PSScene3Band","PSScene4Band","REOrthoTile" have been deprecated geometry : JSON.stringify( geometry ) }, success : function( data ) { diff --git a/collect-earth/collect-earth-app/resources/collectPlanetHtmlWithSlider.fmt b/collect-earth/collect-earth-app/resources/collectPlanetHtmlWithSlider.fmt index da26bf74fc..e9607e5032 100644 --- a/collect-earth/collect-earth-app/resources/collectPlanetHtmlWithSlider.fmt +++ b/collect-earth/collect-earth-app/resources/collectPlanetHtmlWithSlider.fmt @@ -87,7 +87,7 @@ { start: $.datepicker.formatDate('yy-mm-dd', fromDate ), end : $.datepicker.formatDate('yy-mm-dd', toDate ), - itemTypes : ["PSScene3Band","PSScene4Band","REOrthoTile"], // , "REOrthoTile" RapidEye not working + itemTypes : ["PSScene"], // , "REOrthoTile" RapidEye not working -- "PSScene3Band","PSScene4Band","REOrthoTile" have been deprecated geometry : JSON.stringify( geometry ) } ).done( function( data ) { diff --git a/collect-earth/collect-earth-app/src/main/java/org/openforis/collect/earth/app/server/PlacemarkPlanetImagery.java b/collect-earth/collect-earth-app/src/main/java/org/openforis/collect/earth/app/server/PlacemarkPlanetImagery.java index 498392ec92..f40fb558a2 100644 --- a/collect-earth/collect-earth-app/src/main/java/org/openforis/collect/earth/app/server/PlacemarkPlanetImagery.java +++ b/collect-earth/collect-earth-app/src/main/java/org/openforis/collect/earth/app/server/PlacemarkPlanetImagery.java @@ -70,7 +70,7 @@ private double[][][] getCoordinates(HttpServletRequest request) { private String[] getItemTypes(HttpServletRequest request) { String[] itemTypeArray = request.getParameterMap().get("itemTypes[]"); if (itemTypeArray == null || itemTypeArray.length == 0) { - itemTypeArray = new String[] { "PSScene3Band", "PSScene4Band" }; + itemTypeArray = new String[] {"PSScene"}; // Depreated --: "PSScene3Band", "PSScene4Band" } return itemTypeArray; } diff --git a/collect-earth/collect-earth-app/src/main/java/org/openforis/collect/earth/planet/PlanetImagery.java b/collect-earth/collect-earth-app/src/main/java/org/openforis/collect/earth/planet/PlanetImagery.java index 34f161190b..4777adffe0 100644 --- a/collect-earth/collect-earth-app/src/main/java/org/openforis/collect/earth/planet/PlanetImagery.java +++ b/collect-earth/collect-earth-app/src/main/java/org/openforis/collect/earth/planet/PlanetImagery.java @@ -171,6 +171,8 @@ private HttpURLConnection getAuthenticatedConnection(URL url, Object jsonObject) // very important to keep the semicolon at the end String basicAuth = "Basic " + new String(Base64.getEncoder().encode((apiKey + ":").getBytes())); conn.setRequestProperty("Authorization", basicAuth); + + //conn.setRequestProperty("Authorization", "api-key " + apiKey); conn.setRequestMethod(jsonObject != null ? "POST" : "GET"); conn.setRequestProperty("Content-Type", "application/json"); @@ -338,7 +340,7 @@ public String getLatestUrl(SimplePlacemarkObject placemarkObject) throws IOExcep polygon[0][i][1] = Double.parseDouble(simpleCoordinate.getLatitude()); polygon[0][i++][0] = Double.parseDouble(simpleCoordinate.getLongitude()); } - String[] itemTypes = { "PSScene3Band", "PSScene4Band" }; + String[] itemTypes = {"PSScene"}; // Depreated --: "PSScene3Band", "PSScene4Band" return getLayerUrl(new PlanetRequestParameters(start, new Date(), polygon, itemTypes)); } } diff --git a/collect-earth/collect-earth-app/src/main/java/org/openforis/collect/earth/planet/Test.java b/collect-earth/collect-earth-app/src/main/java/org/openforis/collect/earth/planet/Test.java index 13502650b2..6dcf2b7311 100644 --- a/collect-earth/collect-earth-app/src/main/java/org/openforis/collect/earth/planet/Test.java +++ b/collect-earth/collect-earth-app/src/main/java/org/openforis/collect/earth/planet/Test.java @@ -8,11 +8,12 @@ public class Test { public static void main(String[] args) { try { - PlanetImagery planet = new PlanetImagery( "YOUR API KEY FOR DAILY IMAGERY" ); + PlanetImagery planet = new PlanetImagery( "USE_YOUR_LEVEL_API_KEY" ); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); - Date start = formatter.parse("2013-01-01"); - Date end = formatter.parse("2013-12-01"); - String[] itemTypes = {"PSScene3Band", "PSScene4Band", "REOrthoTile"};/* + Date start = formatter.parse("2022-01-01"); + Date end = formatter.parse("2022-12-01"); + String[] itemTypes = {"PSScene"}; // Depreated --: "PSScene3Band", "PSScene4Band" + /* double[][][] coords = {{ { -1.8230438232421875,