Package Exports
- wms-save-image
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (wms-save-image) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Features
Download a single image from a WMS map server.
Companion to map-image-preview. Based on a sample WMS url, will fill in bounds and image dimensions from a JSON file and download the image.
Usage
WMS image downloader v1.0.4
Usage: node wms-save-image <options> [jsonfile]
Options:
-M --meta bounds and image dimensions JSON
-U --url WMS URL template
-O --out Target image fileExample
node wms-save-image.js \
-U "https://openwms.statkart.no/skwms1/wms.topo4.graatone?request=GetMap&SERVICE=WMS&VERSION=1.1.1&BBOX=0,0,1,1&SRS=EPSG:32633&WIDTH=400&HEIGHT=300&LAYERS=topo4graatone_WMS&STYLES=&FORMAT=image/png" \
-M example/thumbnail.json \
-O output.png![]()
Meta
JSON file format
{
"bbox": {
"left": 524161.0500020641,
"bottom": 7590643.169290178,
"right": 805691.242609148,
"top": 7853460.758413694
},
"image": { "width": 408, "height": 380 }
}Batch mode operation
Recursive download
find . -type d -exec sh -c "cd \"{}\" && pwd && [ -f thumbnail.json ] && wms-save-image" -U "https://openwms.statkart.no/skwms1/wms.topo4.graatone?request=GetMap&SERVICE=WMS&VERSION=1.1.1&BBOX=0,0,1,1&SRS=EPSG:32633&WIDTH=400&HEIGHT=300&LAYERS=topo4graatone_WMS&STYLES=&FORMAT=image/png" \
-M thumbnail.json \;Composite with other image
find . -type d -exec sh -c "cd \"{}\" && pwd && [ -f polygon.32633.geojson ] && convert thumbnail_back.png polygon.32633.png -compose Multiply -composite thumbnail.png" \;