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 file
Example
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
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" \;