<commit_before># mapstitch

Stitches map tiles together.

## Installation

```bash
npm install mapstitch
```

## Custom Validation

When initializing `mapstitch`, provide a custom `validate` function. The stitch
object that's returned will be bound as `this`, so you can extend as well as
skip the built-in validation:

```javascript
var stitch = require("mapstitch")({
  validate: function(err, res, callback) {
    return this.validate(err, res, function(err) {
      if (err) {
        return callback(err);
      }

      // arbitrarily fail 10% of the time
      if (Math.random() * 10 <= 1) {
        return callback(new Error("Randomized error value"));<commit_msg>better docs to help #6 but not fix it<commit_after># mapstitch

Stitches map tiles together.

## Installation

```bash
npm install mapstitch
```

## Running

```bash
npm start
```

Then visit `http://localhost:8080/mapimg?w=1500&h=1500&extent=37.955:-122.737:37.449:-122.011&p=toner` to see a stitched map.

 * The `w` and `h` parameters are the width and height of the desired image in pixels. 
 * the `extent` parameter is the extent of the mapped area in degrees. They should be in this order: max latitude : min longitude : min latitude : max longitude. (another way to phrase this: upper left y, upper left x, lower right y, lower right x)

## Custom Validation

When initializing `mapstitch`, provide a custom `validate` function. The stitch
object that's returned will be bound as `this`, so you can extend as well as
skip the built-in validation:

```javascript
var stitch = require("mapstitch")({
  validate: function(err, res, callback) {
    return this.validate(err, res, function(err) {
      if (err) {
        return callback(err);
      }

      // arbitrarily fail 10% of the time
      if (Math.random() * 10 <= 1) {
        return callback(new Error("Randomized error value"));
{'fraction_non_alphanumeric': 0.11081370449678801, 'fraction_numerical': 0.024089935760171308, 'mean_word_length': 3.731645569620253, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '157826', 'n_tokens_mistral': 601, 'n_tokens_neox': 534, 'n_words': 224}