open-index/open-npm huggingface dataset:
npm package: @mapbox/stream-features-from-file
Description: Stream GeoJSON features from a file
Author: Mapbox
Latest version: 0.2.0

# stream-features-from-file

[![Build Status](https://travis-ci.org/mapbox/stream-features-from-file.svg?branch=master)](https://travis-ci.org/mapbox/stream-features-from-file)

Streams GeoJSON features from a file.

Supports the following source formats:
- GeoJSON (`FeatureCollection` only!)
- CSV
- Shapefile

Non-GeoJSON formats are read by [Mapnik](http://mapnik.org/documentation/node-mapnik/3.5/).

## Usage

```js
const featureStream = streamFeaturesFromFile(filePath);
```

`streamFeaturesFromFile` accepts a `filePath` argument and returns a readable object-mode stream of GeoJSON features derived from the provided file.
npm package: @mapbox/stylelint-processor-arbitrary-tags
Description: A stylelint processor that allows you to lint CSS within arbitrary tags
Author: Mapbox
Latest version: 0.4.0

# stylelint-processor-arbitrary-tags

[![Build Status](https://travis-ci.com/mapbox/stylelint-processor-arbitrary-tags.svg?branch=main)](https://travis-ci.com/mapbox/stylelint-processor-arbitrary-tags)

A [stylelint processor](http://stylelint.io/user-guide/configuration/#processors) that allows you to lint CSS within arbitrary tags.

The module uses a regular expression to identify code within the specified tags, then passes the code on to stylelint.

By default, it looks for code within `<style>` tags (see default options below). But you can change the regular expression to find code within other tags, like `{% highlight css %}...{% endhighlight %}` for Jekyll templates, or `/* start css */.../* end css */` within a JS file, or who knows what else.

## Install

```
npm install @mapbox/stylelint-processor-arbitrary-tags
```

## Options

### startTag

Type: `string` that's RegExp-ready

Default:
```
'[^`\'"]<style[\\s\\S]*?>'
```

### endTag

Type: `string` that's RegExp-ready

Default:
```
'</\\s*?style>'
```

### body

Type: `string` that's RegExp-ready

Default:
```
'[\\s\\S]*?'
```

### fileFilterRegex

Type: `array<RegExp|string>` that's an array of regular expressions or strings that describe files that you want to be processed with this module.
Matches will be processed; files that do not match will not be.

Given the following value, only `.html` files will be processed:

```js
fileFilterRegex: [/\.html$/]
```

You can also use regular expression strings instead of regular expression literals. This is necessary if you are using yaml-based configuration and can't use regular expression literals. Yaml variant of example above:

```yaml
  - fileFilterRegex:
    - '\.html$'
```

This is useful when you want to create different settings for HTML and markdown, for instance.

When empty (`[]`), every file will pass through the filter and be processed by this module.

Default:

```js
[]
```

## Caveats

**Do not use this processor with the `no-empty-source` rule**. If you do, you will have warnings whenever a file does not contain any matches for your regular expression.
npm package: @mapbox/stylelint-processor-markdown
Description: A stylelint processor for markdown
Author: Mapbox
Latest version: 0.5.0

# stylelint-processor-markdown

[![Build Status](https://travis-ci.com/mapbox/stylelint-processor-markdown.svg?branch=main)](https://travis-ci.com/mapbox/stylelint-processor-markdown)

A [stylelint processor](http://stylelint.io/user-guide/configuration/#processors) for using stylelint on [GFM fenced code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks/) in Markdown.

Uses [remark](https://github.com/wooorm/remark) to parse the Markdown.

## Install

```
npm install @mapbox/stylelint-processor-markdown
```

## Options

### syntax

Type: `String`, Default: `'css'`

Specify the language for code blocks that will be sent through stylelint.

By default, this module looks for CSS blocks. If you would like to lint another syntax supported by stylelint, change this option to match the code blocks language (e.g. to `'scss'` for <code>```scss</code> blocks) and make sure you [tell stylelint about your non-standard syntax](http://stylelint.io/user-guide/css-processors/) when you run it.

If you have one Markdown file with code blocks of multiple syntaxes, you'll need to lint it multiple times, once for each syntax.

## Caveats

**Do not use this processor with the `no-empty-source` rule**. If you do, you will have warnings whenever a markdown file does not contain any stylesheet blocks.
npm package: @mapbox/svg-react-transformer-loader
Description: Webpack loader to transform SVG files into React components
Author: Mapbox
Latest version: 2.1.0

# @mapbox/svg-react-transformer-loader

A Webpack loader to transform SVG files into React component modules.

Runs SVG files through the [`toComponentModule`] function of [svg-react-transformer].
Please read the [svg-react-transformer] documentation for more details and code examples.

## Installation

```
npm install @mapbox/svg-react-transformer-loader
```

## Usage

Follow the instructions for using [Webpack loaders](https://webpack.js.org/concepts/loaders/).

**You can pass all of the options from svg-react-transformer's [`toComponentModule`] function** (e.g. SVGO plugins, a component template).

By default, the output of this loader is precompiled with Babel.
You can bypass this step (and use your own compilation) by passing the additional option `precompile: false`.

[`tocomponentmodule`]: ../svg-react-transformer/README.md#tocomponentmodule

[svg-react-transformer]: ../svg-react-transformer
npm package: @mapbox/svg-react-transformer-writer
Description: Transform SVGs into React component module files
Author: Mapbox
Latest version: 2.1.0

# @mapbox/svg-react-transformer-writer

Transform SVG files into React component module files.

Provides a Node API and a CLI.
Runs SVG files through [the `toComponentModule` function of svg-react-transformer](../svg-react-transformer/README.md#tocomponentmodule), then writes the React component modules to new files.

## Installation

```
npm install @mapbox/svg-react-transformer-writer
```

## Node API

### svgReactTransformerWriter

`svgReactTransformerWriter(files, outDir, [options])`

Returns a Promise that resolves when all output files have been written.

#### files

Type: `string | Array<string>`.
**Required**.

Globs that point to your SVG files.
Files without an `.svg` extension are automatically ignored.

#### outDir

Type: `string`.
**Required**.

Path to an output directory where React component module files will be written.

#### options

Type: `Object`.

**You can pass all of [the options from `toComponentModule`](../svg-react-transformer/README.md#tocomponentmodule)** (e.g. SVGO plugins, a component template).
**The `name` option is automatically provided**, derived from the basename of each input SVG file.

The following are additional options:

##### filenameTemplate

Type: `(svgBasename: string) => string`.
Default: `x => x`.

Determines the filenames of output React component modules.
Receives the input SVG file basename as an argument; should return the JS basename you want.
The default value is an identity function, so `foo-bar_baz.svg` becomes `foo-bar_baz.js`.

## CLI

The CLI allows you to do everything the Node API does by providing the option to load a configuration module that exports an `options` object.

Run `--help` for details.
npm package: @mapbox/tile-cover
Description: generate the minimum number of tiles to cover a geojson geometry
Author: morganherlocker
Latest version: 3.0.2

tile-cover
==========

[![Build Status](https://travis-ci.org/mapbox/tile-cover.svg?branch=master)](https://travis-ci.org/mapbox/tile-cover)

Generate the minimum number of tiles to cover a [GeoJSON Geometry](http://geojson.org/geojson-spec.html#geometry-objects).

### Install

```bash
npm install @mapbox/tile-cover
```

### Usage

```js
var cover = require('@mapbox/tile-cover');
var poly = JSON.parse(fs.readFileSync('./poly.geojson'));
var limits = {
  	min_zoom: 4,
  	max_zoom: 9
};

cover.geojson(poly.geom, limits);
cover.tiles(poly.geom, limits);
cover.indexes(poly.geom, limits);
```

# API

## geojson(geom, limits)

Given a [geometry](http://geojson.org/geojson-spec.html#geometry-objects), create cells and return them in a format easily readable by any software that reads GeoJSON.

* `geom` (`Object`): GeoJSON geometry
* `limits` (`Object`): an object with min_zoom and max_zoom properties specifying the minimum and maximum level to be tiled.

**Returns** `Object`, FeatureCollection of cells formatted as GeoJSON Features
## tiles(geom, limits)

Given a [geometry](http://geojson.org/geojson-spec.html#geometry-objects), create cells and return them in their raw form, as an array of cell identifiers.

* `geom` (`Object`): GeoJSON geometry
* `limits` (`Object`): an object with min_zoom and max_zoom properties specifying the minimum and maximum level to be tiled.

**Returns** `Array.<Array.<number>>`, An array of tiles given as [x, y, z] arrays
## indexes(geom, limits)

Given a [geometry](http://geojson.org/geojson-spec.html#geometry-objects), create cells and return them as quadkey indexes.

* `geom` (`Object`): GeoJSON geometry
* `limits` (`Object`): an object with min_zoom and max_zoom properties specifying the minimum and maximum level to be tiled.

**Returns** `Array.<String>`, An array of tiles given as quadkeys.

### Tests

```bash
npm test
```

### Benchmarks

```bash
node bench.js
```

### Examples

##### Polygons:

![img](https://dl.dropbox.com/s/48cj16fvt8nyh3o/Screenshot%202014-08-06%2013.34.12.png)

##### Lines:

![img](https://dl.dropbox.com/s/u32bq56adqwhpyy/Screenshot%202014-08-06%2013.30.31.png)

##### Points:

![img](https://dl.dropbox.com/s/7kkmmm8owg1ezb0/Screenshot%202014-08-06%2014.02.01.png)
npm package: @mapbox/tilebelt
Description: simple tile utilities
Author: morganherlocker
Latest version: 2.0.3

# tilebelt

[![Run tests](https://github.com/mapbox/tilebelt/actions/workflows/test.yml/badge.svg)](https://github.com/mapbox/tilebelt/actions/workflows/test.yml)

simple [tile](http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames) utilities

## install

```bash
npm install @mapbox/tilebelt
```

## usage

```js
import * as tilebelt from '@mapbox/tilebelt';

const tile = [10, 15, 8] // x,y,z

tilebelt.tileToGeoJSON(tile);
// {
//   "type": "Polygon",
//   "coordinates": [
//     [
//       [ -165.9375, 82.8533822917608 ],
//       [ -165.9375, 82.67628497834903 ],
//       [ -164.53125, 82.67628497834903 ],
//       [ -164.53125, 82.8533822917608 ],
//       [ -165.9375, 82.8533822917608 ]
//     ]
//   ]
// }

tilebelt.getParent(tile);
// [ 5, 7, 7 ]
```

## features

function | description
---|---
`tileToGeoJSON(tile)` | get a geojson representation of a tile
`tileToBBOX(tile)` | get the bbox of a tile
`bboxToTile(bbox)` | get the smallest tile to cover a bbox
`getChildren(tile)` | get the 4 tiles one zoom level higher
`getParent(tile)` | get the tile one zoom level lower
`getSiblings(tile)` | get the 4 sibling tiles for a tile
`hasSiblings(tiles, tile)` | check to see if an array of tiles contains a tiles siblings
`hasTile(tiles, tile)` | check to see if an array of tiles contains a particular tile
`tilesEqual(tile1, tile2)` | check to see if two tiles are the same
`tileToQuadkey(tile)` | get the quadkey for a tile
`quadkeyToTile(quadkey)` | get the tile for a quadkey
`pointToTile(lon, lat, zoom)` | get the tile for a point at a specified zoom level
`pointToTileFraction(lon, lat, zoom)` | get the precise fractional tile location for a point at a zoom level

## developing

```sh
npm ci          # install deps
npm test        # tests
npm run bench   # run benchmarks
npm run format  # format using prettier
```