Modifications
This commit is contained in:
parent
bc41fb2367
commit
42a32637bb
|
@ -56,8 +56,5 @@ def download_file(filename):
|
|||
except FileNotFoundError:
|
||||
abort(404)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run()
|
||||
|
|
|
@ -11,7 +11,7 @@ tags: ["QGIS", "SRTM", "DEM", "Raster", "download"]
|
|||
{{< figure src="/pics/blog/batch-import-postgis-rasters/singapore-final.webp" width="300">}}
|
||||
Download the Digital Elevation Model featured in [this](/blog/batch-import-postgis-rasters/) blog.
|
||||
|
||||
{{< download-data src="http://api.baseddata.io/download/singapore-srtm-dem.tif" name="singapore-srtm-dem.tif" >}}
|
||||
{{< download-data src="https://api.baseddata.io/download/singapore-srtm-dem.tif" name="singapore-srtm-dem.tif" >}}
|
||||
|
||||
#### Citations
|
||||
NASA Shuttle Radar Topography Mission (SRTM)(2013). Shuttle Radar Topography Mission (SRTM) Global. Distributed by OpenTopography. https://doi.org/10.5069/G9445JDF. Accessed: 2024-08-06
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
async function downloadFile(url, name) {
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
const blob = await response.blob();
|
||||
const link = document.createElement('a');
|
||||
link.href = URL.createObjectURL(blob);
|
||||
|
@ -13,6 +16,7 @@
|
|||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
URL.revokeObjectURL(link.href); // Clean up the object URL
|
||||
} catch (error) {
|
||||
console.error('Error downloading the file:', error);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue