Calling Planet Explorer to autologin with API Key?

Hi Guys,

We are a Planet customer, and we are using Geocortex as our internal mapping system.

We were wanting to call Planet explorer from our Geocortex application to zoom to our current extent.

I have written a workflow that gets the current envelope (within our Geocortex application) and generates a vertex ring that I inject into a querystring call in the MULTIPOLYGON parameter.  e.g.

https://www.planet.com/explorer/#/mosaic/latest_monthly/center/152.490,-27.450/zoom/9/geometry/MULTIPOLYGON(((152.8214+-25.7025,152.8212+-25.7034,152.822+-25.7035,152.8222+-25.7027,152.8214+-25.7025)))/interval/1%20day/items/PSScene4Band%3A20190104_232732_0e2f,PSScene4Band%3A20190104_232731_0e2f

It seems to work well, however I was wondering if I could take it one step further and inject the API_Key into this call as well so that the end users don't have to enter in credentials at the beginning of a session.

Is this possible, and if so can you provide an example based on the querystring I sent?

Many thanks,

Tim Beattie

(HQPlantations)

1

Comments

6 comments
  • Official comment

    Hi Tim,

    Planet Explorer is not meant to be an application that you build upon so there might be a better way of achieving what you are trying to do.

    Planet does provide a full-featured API that lets you search for data and a tiling API for rendering the search results in a compatible web mapping library (I assume Geocortex is capable of displaying tiles in XYZ format). Both of these use simple API key authentication; however, you won't find the flexibility to just rely on API keys with Planet Explorer.

    If you could explain in a bit more detail what you are trying to do, we might be able to point you to the best solution!

    Regards,

  • Thanks Ben,

    A bit more on this topic, we are currently consuming your WMTS (the "Latest Monthly" layer) and we are using the API key for that in our Geocortex site which works well, however our end users wish to see daily imagery (to check tree plantation harvest fronts) which change on a daily basis and doesn't seem to be offered in a service.

    Even if it was offered, it would mean daily site updates to add the additional layers, which is not what we would want to end up doing.  We would prefer to use your Planet Explorer application, due to all the available UI functionality, and we were just wanting a way of quickly running the Planet Explorer based on the current extent of our Geocortex site.  Our end users were previously having to create a shape file and reproject it in a geographic coordinate system and then upload to Planet Explorer to get to a location which was a tedious process.

    The ability to call Planet Explorer with the location information in the querystring was what we thought was the best solution, but we would be happy for any better suggestion as to how this could be achieved.

    What we have in place is currently working well, however the first call in the session of course asks for credentials.  We can run with this, but the ability to add the API key in this initial call would have prevented the initial authentication step.

    Thanks again for your help,

    Tim

    0
  • Hi Tim,

    After re-reading, the idea is provide a link to Planet Explorer that would direct the user to the specific area of interest (as in your link above) and have them automatically logged in. Is that a correct understanding?

    The second thing I wanted to check on was whether the users are from your company or if they are external users (such as your customers). If so, it is not advisable for you to share your API key (or any other credentials) with users outside of your organisation.

    Best, Ben

     

    0
  • Hi Ben,

    Thanks for getting back to us.

    Yes, spot on, we are just wanting to link to planet explorer so it opens at a specific location without the need to log in.

    Your second question is yes also, it is only internal staff within HQPlantations that will be using this link to Planet Explorer functionality. 

    Thanks again,

    Tim

    0
  • Hi Tim,

    Thanks for the clarification! Unfortunately, there's not really a way to do what you are looking for since Planet Explorer requires that authentication step using your username and password.

    If it is for internal users, perhaps we could provide more accounts for them to be able to log in individually?

    Best, Ben

    0
  • Thanks Ben,

    No problem we will run with what we have got in place at the moment.

    I just thought I would check.

    Thanks again,

    Tim

    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post