Skip to main content
Solved

Download files that have names that will keep changing

  • Dec 21, 2022 3:34 AM UTC
  • 1 reply
  • 44 views

gisgeek
Contributor
Forum|alt.badge.img+9

I would like to download all shakemap files. I can download one based on event ID but how do I download all of them. I have specified a folder for them to download to but I have tried a few combinations to get all of the files to download however no success. So the 2022p955929 could change and there are many zip files to http://shakinglayer.geonet.org.nz/api/v1/events/2022p955929/latest.zip

 

I have tried this and the $ sign but they don't work

http://shakinglayer.geonet.org.nz/api/v1/events/*/latest.zip

Best answer by nielsgerrits

When you visit https://shakinglayer.geonet.org.nz/api/v1/events/ it will return a json with the event id's:

["2022p936056", "2022p931987", "2022p923741", "2022p922237", "2022p913620", "2022p906843", "2022p905983", "2022p904574", "2022p903728", "2022p903670", "2022p903371", "2022p902801", "2022p901755", "2022p901313", "2022p901243", "2022p901223", "2022p901222", "2022p901216", "2022p900633", "2022p898911", "2022p897670", "2022p894243", "2022p879484", "2022p879273", "2022p879228", "2022p878661"]

So what you can do is use a HTTPCaller to get this response, fragment the response to features and use a second HTTPCaller to do the request for each event.

View original
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

nielsgerrits
VIP
Forum|alt.badge.img+67
  • Best Answer
  • Dec 21, 2022 4:16 AM UTC

When you visit https://shakinglayer.geonet.org.nz/api/v1/events/ it will return a json with the event id's:

["2022p936056", "2022p931987", "2022p923741", "2022p922237", "2022p913620", "2022p906843", "2022p905983", "2022p904574", "2022p903728", "2022p903670", "2022p903371", "2022p902801", "2022p901755", "2022p901313", "2022p901243", "2022p901223", "2022p901222", "2022p901216", "2022p900633", "2022p898911", "2022p897670", "2022p894243", "2022p879484", "2022p879273", "2022p879228", "2022p878661"]

So what you can do is use a HTTPCaller to get this response, fragment the response to features and use a second HTTPCaller to do the request for each event.