A question came in to support this week on how to select the best image for each day of collection. When we fly and collect aerial imagery, we will typically end up with many shots of a property, each just a second or 2 apart. Add in the fact that we have multiple images in each oblique orientation of north, south, east and west and you can see how we have on the order of 50 views of each property every time we fly over. All of these images can be very helpful in doing detailed analysis of a property, but sometimes you want to present just the best image on each day of flight in your application.
Here is an easy solution that takes advantage of the date filters on the ExtractImages endpoint. there are three steps in the process.
- Query the catalog to get all of the metadata for all collections at your coordinate of interest
- Parse the results to create a list of dates that have imagery
- Make a follow up call to ExtractImages for EACH of the days found in step two and ask for the single best image on that day
Using this coordinate (36.175216, -86.73649), lets look at the actual API calls for steps 1 and 3
Step 1. Find all Image metadata a the point
We’re going to focus on just the Nadir (vertical) imagery. Here is the API call to query the Vexcel catalog at this coordinate. in the response you’ll see we have 57 Nadir images for this property!
Step 2. Parse the Json from step one to find the dates with at least 1 image.
We want to build a list of days that have at least one image. The best way to do this is to sort the 57 images by capture date, then iterate through and build a list of unique dates. In this case we will end up with a list of 5 unique dates from September 9, 2012 to March 4, 2020
Step 3. Request the best image on each date found in step 2
For each of these calls, note the initDate and EndDate parameters. Also, note the mode=one which will return the best image in the date range. We can make a call to ExtractImages like this for each of the 5 dates we found in step 2. Here are a couple of them with their resulting image.