npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wms-downloader-mngr

v1.0.9

Published

Download manager for wms-downloader.

Downloads

1

Readme

wms-downloader-mngr

Installation

01 NodeJS and NPM

Windows: Use the installer from https://nodejs.org/

Ubuntu / Debian:

sudo apt install nodejs npm

02 GraphicsMagick

Windows: Use the installer from http://www.graphicsmagick.org/

Ubuntu / Debian:

sudo apt install graphicsmagick

03 7-Zip

Windows: Use the installer from http://www.7-zip.org/

Subsequent register the path of the "7z.exe" ("C:\Program Files\7-Zip" or "C:\Program Files (x86)\7-Zip") into the "PATH" environment variable.

Ubuntu / Debian:

sudo apt-get install p7zip-full

04 wms-downloader-mngr

Use terminal:

npm install wms-downloader-mngr

Get started

Example

Download

const mngr = require('wms-download-mngr');

/*
 * Init options for wms-downloader-mngr
 */
const initOptions = {
  "mngr" : {
    "workspace" : __dirname + "/example1_workspace",
    "logs": __dirname + "/example.log",
    "maxOfSimultaneousTasks" : 1,
    "deletionTimeoutOfCompletedTasks" : 600000,
    "taskCacheExpiration" : 10000
  },
  "request" : {
    "userAgent" : "wms-downloader",
    "timeout" : 30000
  }
}

/*
 * Init the wms-downloader-mngr
 */
mngr.init(initOptions);

/*
 * Task 1 for wms-downloader-mngr
 */
const task1 = {
  "task" : {
    "id" : "id_of_task1",
    "title" : "Stadtbezirke 1:15000 96DPI",
    "format" : "image/png",
    "area" : {
      "bbox" : {
        "xmin" : 455000,
        "ymin" : 5750000,
        "xmax" : 479000,
        "ymax" : 5774000
      }
    }
  },
  "tiles" : {
    "maxSizePx" : 2500,
    "gutterPx" : 250,
    "resolutions" : [ {
      "id" : "15000",
      "scale" : 15000,
      "dpi" : 96
    } ]
  },
  "wms" : [ {
    "id" : "wms_stadtbezirke",
    "getmap" : {
      "url" : "http://www.bielefeld01.de/geodaten/geo_dienste/wms.php?url=gebietsgliederung_wms_stadtbezirke_641&",
      "kvp" : {
        "SERVICE" : "WMS",
        "REQUEST" : "GetMap",
        "VERSION" : "1.3.0",
        "LAYERS" : "stadtbezirke_wms",
        "STYLES" : "",
        "CRS" : "EPSG:25832",
        "FORMAT" : "image/png",
        "TRANSPARENT" : "TRUE"
      }
    }
  } ]
};

/*
 * Task 2 for wms-downloader-mngr
 */
const task2 = {
  "task" : {
    "id" : "id_of_task2",
    "title" : "Bebauungsplanübersicht 1:25000 96DPI",
    "format" : "image/png",
    "area" : {
      "bbox" : {
        "xmin" : 455000,
        "ymin" : 5750000,
        "xmax" : 479000,
        "ymax" : 5774000
      }
    }
  },
  "tiles" : {
    "maxSizePx" : 2500,
    "gutterPx" : 250,
    "resolutions" : [ {
      "id" : "25000",
      "scale" : 25000,
      "dpi" : 96
    } ]
  },
  "wms" : [ {
    "id" : "wms_bplan_uebersicht",
    "getmap" : {
      "url" : "http://www.bielefeld01.de/geodaten/geo_dienste/wms.php?url=bplan_wms_uebersicht_641&",
      "kvp" : {
        "SERVICE" : "WMS",
        "REQUEST" : "GetMap",
        "VERSION" : "1.3.0",
        "LAYERS" : "bebauungsplanuebersicht_wms",
        "STYLES" : "",
        "CRS" : "EPSG:25832",
        "FORMAT" : "image/png",
        "TRANSPARENT" : "TRUE"
      }
    }
  } ]
};

/*
 * Task 3 for wms-downloader-mngr
 */
const task3 = {
  "task" : {
    "id" : "id_of_task3",
    "title" : "Bebauungsplanübersicht 1:2500 72DPI",
    "format" : "image/png",
    "area" : {
      "bbox" : {
        "xmin" : 455000,
        "ymin" : 5750000,
        "xmax" : 479000,
        "ymax" : 5774000
      }
    }
  },
  "tiles" : {
    "maxSizePx" : 25000,
    "gutterPx" : 250,
    "resolutions" : [ {
      "id" : "25000",
      "scale" : 25000,
      "dpi" : 96
    } ]
  },
  "wms" : [ {
    "id" : "wms_bplan_uebersicht",
    "getmap" : {
      "url" : "http://www.bielefeld01.de/geodaten/geo_dienste/wms.php?url=bplan_wms_uebersicht_641&",
      "kvp" : {
        "SERVICE" : "WMS",
        "REQUEST" : "GetMap",
        "VERSION" : "1.3.0",
        "LAYERS" : "bebauungsplanuebersicht_wms",
        "STYLES" : "",
        "CRS" : "EPSG:25832",
        "FORMAT" : "image/png",
        "TRANSPARENT" : "TRUE"
      }
    }
  } ]
};

/*
 * Add task 1 to wms-downloader-mngr
 */
mngr.addTask(task1, function(err) {
  if (err) {
    console.log('Can\'t add task 1: ' + err.message);
  } else {
    console.log('Added task 1.');
  }
});

/*
 * Add task 2 to wms-downloader-mngr
 */
mngr.addTask(task2, function(err) {
  if (err) {
    console.log('Can\'t add task 2: ' + err.message);
  } else {
    console.log('Added task 2.');
  }
});

/*
 * Add task 3 to wms-downloader-mngr
 */
mngr.addTask(task3, function(err) {
  if (err) {
    console.log('Can\'t add task 3: ' + err.message);
  } else {
    console.log('Added task 3.');
  }
});

/*
 * Remove task 3 after 19 seconds
 */
setTimeout(function() {
  mngr.removeTask(task3.task.id, function(err) {
    if (err) {
      console.log(err);
    } else {
      console.log(task3.task.id + ' was removed.');
    }
  });
}, 19000);

Download with proxy

const mngr = require('wms-download-mngr');

/*
 * Init options for wms-downloader-mngr
 */
const initOptions = {
  "mngr" : {
    "workspace" : __dirname + "/example1_workspace",
    "logs": __dirname + "/example.log",
    "maxOfSimultaneousTasks" : 1,
    "deletionTimeoutOfCompletedTasks" : 600000,
    "taskCacheExpiration" : 10000
  },
  "request" : {
    "userAgent" : "wms-downloader",
    "timeout" : 30000,
    "proxy" : {
      "http" : {
        "host" : "10.208.20.71",
        "port" : 4239,
        "user" : "NameOfUser",
        "password" : "PasswordOfUser",
        "exclude" : [ "http://12.101.20.18/", "http://12.208.28.48/" ]
      }
    }
  }
}

/*
 * Init the wms-downloader-mngr
 */
mngr.init(initOptions);

/*
 * Task 1 for wms-downloader-mngr
 */
const task1 = {
  "task" : {
    "id" : "id_of_task1",
    "title" : "Stadtbezirke 1:15000 96DPI",
    "format" : "image/png",
    "area" : {
      "bbox" : {
        "xmin" : 455000,
        "ymin" : 5750000,
        "xmax" : 479000,
        "ymax" : 5774000
      }
    }
  },
  "tiles" : {
    "maxSizePx" : 2500,
    "gutterPx" : 250,
    "resolutions" : [ {
      "id" : "15000",
      "scale" : 15000,
      "dpi" : 96
    } ]
  },
  "wms" : [ {
    "id" : "wms_stadtbezirke",
    "getmap" : {
      "url" : "http://www.bielefeld01.de/geodaten/geo_dienste/wms.php?url=gebietsgliederung_wms_stadtbezirke_641&",
      "kvp" : {
        "SERVICE" : "WMS",
        "REQUEST" : "GetMap",
        "VERSION" : "1.3.0",
        "LAYERS" : "stadtbezirke_wms",
        "STYLES" : "",
        "CRS" : "EPSG:25832",
        "FORMAT" : "image/png",
        "TRANSPARENT" : "TRUE"
      }
    }
  } ]
};

/*
 * Task 2 for wms-downloader-mngr
 */
const task2 = {
  "task": {
    "id": "id_of_task2",
    "title": "Bebauungsplanübersicht 1:25000 96DPI",
    "format": "image/png",
    "area": {
      "bbox": {
        "xmin": 455000,
        "ymin": 5750000,
        "xmax": 479000,
        "ymax": 5774000
      }
    }
  },
  "tiles": {
    "maxSizePx": 2500,
    "gutterPx": 250,
    "resolutions": [{
      "id": "25000",
      "scale": 25000,
      "dpi": 96
    }]
  },
  "wms": [{
    "id": "wms_bielefeld_karte",
    "getmap": {
      "url": "http://www.bielefeld01.de/md/WMS/bielefeld_karte_farbe/02?",
      "kvp": {
        "SERVICE": "WMS",
        "REQUEST": "GetMap",
        "VERSION": "1.3.0",
        "LAYERS": "map",
        "STYLES": "",
        "CRS": "EPSG:25832",
        "FORMAT": "image/png",
        "TRANSPARENT": "TRUE"
      }
    }
  }]
};

/*
 * Task 3 for wms-downloader-mngr
 */
const task3 = {
  "task": {
    "id": "id_of_task3",
    "title": "Bebauungsplanübersicht 1:2500 72DPI",
    "format": "image/png",
    "area": {
      "bbox": {
        "xmin": 455000,
        "ymin": 5750000,
        "xmax": 479000,
        "ymax": 5774000
      }
    }
  },
  "tiles": {
    "maxSizePx": 25000,
    "gutterPx": 250,
    "resolutions": [{
      "id": "25000",
      "scale": 25000,
      "dpi": 96
    }]
  },
  "wms": [{
    "id": "wms_bielefeld_karte_grau",
    "getmap": {
      "url": "https://www.bielefeld01.de/md/WMS/bielefeld_karte_grau/02?",
      "kvp": {
        "SERVICE": "WMS",
        "REQUEST": "GetMap",
        "VERSION": "1.3.0",
        "LAYERS": "map",
        "STYLES": "",
        "CRS": "EPSG:25832",
        "FORMAT": "image/png",
        "TRANSPARENT": "TRUE"
      }
    }
  }]
};

/*
 * Add task 1 to wms-downloader-mngr
 */
mngr.addTask(task1, function(err) {
  if (err) {
    console.log('Can\'t add task 1: ' + err.message);
  } else {
    console.log('Added task 1.');
  }
});

/*
 * Add task 2 to wms-downloader-mngr
 */
mngr.addTask(task2, function(err) {
  if (err) {
    console.log('Can\'t add task 2: ' + err.message);
  } else {
    console.log('Added task 2.');
  }
});

/*
 * Add task 3 to wms-downloader-mngr
 */
mngr.addTask(task3, function(err) {
  if (err) {
    console.log('Can\'t add task 3: ' + err.message);
  } else {
    console.log('Added task 3.');
  }
});

/*
 * Remove task 3 after 19 seconds
 */
setTimeout(function() {
  mngr.removeTask(task3.task.id, function(err) {
    if (err) {
      console.log(err);
    } else {
      console.log(task3.task.id + ' was removed.');
    }
  });
}, 19000);

Supported formats

  • image/png
  • image/jpeg
  • image/gif
  • image/tiff

License

MIT