Selecting the best image with the Vexcel API

Best Image of the Day

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.

  1. Query the catalog to get all of the metadata for all collections at your coordinate of interest
  2. Parse the results to create a list of dates that have imagery
  3. 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

Here is a sample app showing the three steps together. You need to plug in your Vexcel account credentials, then specify any lat/long coordinate and hit go! The app is all client-side JavaScript so just view source to see the API calls being made.

http://gicapps.azurewebsites.net/static/BestOfTheDay.htm

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!

https://api.gic.org/metadata/FindImagesInPoint?layer=graysky,graysky-g,bluesky-ultra,bluesky-ultra-g&format=json&EPSG=4326&orientation=NADIR&wkt=POINT(-86.73649+36.175216)&AuthToken=YOURTOKENHERE

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.

September 2012

https://api.gic.org/images/ExtractImages/bluesky-ultra-g?mode=one&logo=yes&width=800&height=800&zoom=0&EPSG=4326&xcoordinate=-86.73649&ycoordinate=36.175216&initDate=2012-09-24T01:00:00&endDate=2012-09-24T23:00:00&orientation=nadir&nadirRotatedNorth=yes&AuthToken=YourTokenHere

November 2019

https://api.gic.org/images/ExtractImages/bluesky-ultra?mode=one&logo=yes&width=800&height=800&zoom=0&EPSG=4326&xcoordinate=-86.73649&ycoordinate=36.175216&initDate=2019-11-02T01:00:00&endDate=2019-11-02T23:00:00&orientation=nadir&nadirRotatedNorth=yes&AuthToken=YourTokenHere

March 2020

https://api.gic.org/images/ExtractImages/graysky-g?mode=one&logo=yes&width=800&height=800&zoom=0&EPSG=4326&xcoordinate=-86.73649&ycoordinate=36.175216&initDate=2020-03-04T01:00:00&endDate=2020-03-04T23:00:00&orientation=nadir&nadirRotatedNorth=yes&AuthToken=YourTokenHere

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s