Oriented Imagery Catalog not loading Amazon S3 images

1953
6
Jump to solution
07-01-2021 01:42 PM
IniobongBenson
New Contributor II

I had followed the Esri Imagery Workflow for OIC and published and view the Esri Campus images using OIC web app, and it worked well. 

I tried to use my images which I took using an IPhone, selected terrestrial frame camera as type, however my workflow involved using local images because I didn't have access to S3 at the time. The exposure points were created and everything worked fine and may have selected the add image as attachment when publishing to Enterprise therefore I was able to view the images on the OIC web app.

However, the problem seems to arise when I hosted the images on Amazon cloud. The bucket where the images are stored have been public, and the links work fine. However, when adding the OIC to the web map, and clicking one of the exposure points, it takes forever to load up the images.

IniobongBenson_1-1625171996979.png

 

I've attached my ImageList text file, in case someone wants to replicate the problem

 

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RandallRebello
Occasional Contributor II

Hi   IniobongBenson, 
The issue you are facing is because of a CORS policy that needs to be set on your bucket. 

Assuming you know how to access your AWS console follow these instructions below to set the CORS Policy. 

It is required to set Cross-origin resource sharing (CORS) policy in S3 for web applications that are loaded in one domain for interacting with resources in different domains. Please refer below screenshot and script for reference:  

 

RandallRebello_1-1625495541473.png

 

<?xml version="1.0" encoding="UTF-8"?>

<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">

<CORSRule>

    <AllowedOrigin>*</AllowedOrigin>

    <AllowedMethod>GET</AllowedMethod>

</CORSRule>

</CORSConfiguration>

View solution in original post

6 Replies
RandallRebello
Occasional Contributor II

Hi   IniobongBenson, 
The issue you are facing is because of a CORS policy that needs to be set on your bucket. 

Assuming you know how to access your AWS console follow these instructions below to set the CORS Policy. 

It is required to set Cross-origin resource sharing (CORS) policy in S3 for web applications that are loaded in one domain for interacting with resources in different domains. Please refer below screenshot and script for reference:  

 

RandallRebello_1-1625495541473.png

 

<?xml version="1.0" encoding="UTF-8"?>

<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">

<CORSRule>

    <AllowedOrigin>*</AllowedOrigin>

    <AllowedMethod>GET</AllowedMethod>

</CORSRule>

</CORSConfiguration>

IniobongBenson
New Contributor II

Thanks @RandallRebello I was able to solve this with your suggestion. However, AWS now required CORS policy be provided in JSON format which I was able to look up and provide

NigelEdmead
New Contributor II

@IniobongBenson I had the same problem but in Azure - @RandallRebello I followed your instructions to set up a CORS rule for the container - thanks for the advice I am able to see the images.

adevadas
New Contributor II

Amazon S3 requires this CORS policy in JSON. Please post the CORS policy in JSON.

I used an XML to JSON converter that gave the JSON below but that gives an error in Amazon S3: 'Expected params.CORSConfiguration.CORSRules to be an Array'

Here is the JSON I tried:

{
  "CORSConfiguration": {
    "xmlns": "http://s3.amazonaws.com/doc/2006-03-01/",
  "CORSRule": {
    "AllowedOrigin": "*",
    "AllowedMethod": "GET"
  }
 }
}

 

0 Kudos
RandallRebello
Occasional Contributor II

Hi @adevadas , 

Here is the script in json fromat. 

[

    {

        "AllowedHeaders": [

            "*"

        ],

        "AllowedMethods": [

            "GET"

        ],

        "AllowedOrigins": [

            "*"

        ],

        "ExposeHeaders": [],

        "MaxAgeSeconds": 3000

    }

]

 

Randall

adevadas
New Contributor II

Thank you sir! Works great. 

0 Kudos