Skip to main content
Solved

How would I enter something like this in the S3Connector: aws s3 cp --no-sign-request s3://ookla-open-data/shapefiles/performance/type=fixed/year=2022/quarter=1/2022-01-01_performance_fixed_tiles.zip C:\\Users\\me\\GIS\\Data\\Misc\\Ookla\\2022Q1fixed


bobw
Contributor
Forum|alt.badge.img+5
  • Contributor

I'd like to run this quarterly using parameters for the date specific strings.

Thanks!

Best answer by debbiatsafe

Hi @bobw​ 

Configure the S3Connector like this if you want to download a file from the ookla-open-data bucket.

s3Connector_ookla-open-dataSince you want to use parameters for the date components in the path, use a year and quarter user parameter and create the path as an attribute value. Use a conditional to map the month value based on quarter (eg. 1=01, 2=04, 3=07, etc) if the zip files are named consistently. The path attribute would look similar to this:

shapefiles/performance/type=fixed/year=$(Year)/quarter=$(Quarter)/$(Year)-@Value(month)-01_performance_fixed_tiles.zip

 

An alternative would be to use two consecutive S3Connectors if the file names are inconsistent. The first to list any files contained within a folder year/quarter and then use another to actually download the file based on the path from the first S3Connector.

View original
Did this help you find an answer to your question?

2 replies

debbiatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • Best Answer
  • June 2, 2022

Hi @bobw​ 

Configure the S3Connector like this if you want to download a file from the ookla-open-data bucket.

s3Connector_ookla-open-dataSince you want to use parameters for the date components in the path, use a year and quarter user parameter and create the path as an attribute value. Use a conditional to map the month value based on quarter (eg. 1=01, 2=04, 3=07, etc) if the zip files are named consistently. The path attribute would look similar to this:

shapefiles/performance/type=fixed/year=$(Year)/quarter=$(Quarter)/$(Year)-@Value(month)-01_performance_fixed_tiles.zip

 

An alternative would be to use two consecutive S3Connectors if the file names are inconsistent. The first to list any files contained within a folder year/quarter and then use another to actually download the file based on the path from the first S3Connector.


bobw
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • June 2, 2022
debbiatsafe wrote:

Hi @bobw​ 

Configure the S3Connector like this if you want to download a file from the ookla-open-data bucket.

s3Connector_ookla-open-dataSince you want to use parameters for the date components in the path, use a year and quarter user parameter and create the path as an attribute value. Use a conditional to map the month value based on quarter (eg. 1=01, 2=04, 3=07, etc) if the zip files are named consistently. The path attribute would look similar to this:

shapefiles/performance/type=fixed/year=$(Year)/quarter=$(Quarter)/$(Year)-@Value(month)-01_performance_fixed_tiles.zip

 

An alternative would be to use two consecutive S3Connectors if the file names are inconsistent. The first to list any files contained within a folder year/quarter and then use another to actually download the file based on the path from the first S3Connector.

Works like a charm.  I like how the S3Connector drills into the Path for the bucket.  Very cool.  Thank you.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings