Skip to content

Commit

Permalink
Use "PSScene" as "PSScene3Band","PSScene4Band" deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
herrtunante committed Oct 9, 2024
1 parent f7d1eda commit 6ffae21
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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 ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6ffae21

Please sign in to comment.