open-index/open-npm huggingface dataset:
npm package: @placemarkio/check-geojson
Description: A spiritual successor to [geojsonhint](https://github.com/mapbox/geojsonhint), which is no longer maintained.
Author: Tom MacWright
Latest version: 0.1.14

# check-geojson

A spiritual successor to [geojsonhint](https://github.com/mapbox/geojsonhint), which is no longer maintained.

check-geojson is a parser and validator for GeoJSON strings. It is tailored to the use cases of validating user-generated GeoJSON content, or troubleshooting GeoJSON that you've received.

_Note: the API is not yet stable._

## [📕 API Documentation](http://check-geojson.docs.placemark.io/)

### Main differences from geojsonhint

- Actively maintained
- Written in TypeScript and includes types
- Uses [momoa](https://github.com/humanwhocodes/momoa) to parse JSON instead of a homemade
  parser. This is probably the biggest one. jsonlint-lines was a hack, which I created
  because I could not find a single parser that actually parsed JSON and gave line numbers
  for values. momoa is much better than that hack, and using it makes line-level errors
  much cleaner.

Unlike geojsonhint, this checker _only_ produces errors, not warnings. So things
that geojsonhint would warn about, like:

- excessive coordinate precision
- right-hand rule compliance

This does not check for. Additionally, the `crs` member is ignored by this tool: as of
the latest GeoJSON specification, this is [not used](https://datatracker.ietf.org/doc/html/rfc7946#appendix-B.1).

We're using the same test fixtures as geojsonhint as a starter.

### Install

```shell
pnpm add @placemarkio/check-geojson
yarn add @placemarkio/check-geojson
```

### Usage

```ts
import { check } from "@placemarkio/check-geojson"

let geojsonObject;
try {
  geojsonObject = check('… geojson string …')
} catch (e) {
  /// e.issues
}
```

If your GeoJSON is already an object, you will need to convert it to a string first. geojson-check will re-parse it. You should consider the performance penalty of this.

```ts
const issues = getIssues(JSON.stringify(geojsonObject));
if (issues.length > 0) {
  // ...
}
```

---

[![Maintainability](https://api.codeclimate.com/v1/badges/0a1d1c0755b9e67406f1/maintainability)](https://codeclimate.com/repos/60a64f6aa449b13bc40002bd/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/0a1d1c0755b9e67406f1/test_coverage)](https://codeclimate.com/repos/60a64f6aa449b13bc40002bd/test_coverage)
npm package: @placemarkio/fast-source
Description: An experimental fast source for Mapbox GL. This trades off smoothness for latency and allows for faster incremental updates to data.
Author: Tom MacWright
Latest version: 1.0.0

# fast-source

An experimental fast source for Mapbox GL. This trades off smoothness
for latency and allows for faster incremental updates to data.

### Changes:

The default geojson layer uses geojson-vt, which does a top-down tiling strategy:
it generates the 0/0/0 tile then slices it down. This instead uses RBush and
generates all tiles by themselves.

The default geojson layer uses webworkers for tiling, which incurs stringification
and message passing lag. This generates tiles on the main thread, which creates
the potential for blocking jank on the page, but improves latency.

The default geojson layer includes an unnecessary round-trip from a JSON layer
representation to protocol buffers and back to another JSON layer representation.
This saves the trip back from protocol buffers to JSON, though it still, currently,
generates Pbf because of Mapbox GL limitations.

### Limitations:

This does not work with a default build of Mapbox GL. To lessen the sprawling
requirements for an external source, this relies on the `WorkerTile` and `StyleIndex`
classes, which are not exposed by Mapbox GL. This relies on a build of Mapbox GL
that adds those classes to the main export.

### Improvements:

This participates in the same queryRenderedFeatures flow as the rest of GL,
which requires the protobuf generation, which is a minor contributor to the
performance envelope. It would be nice for it not to.

### Notes:

- Reintroducing the webworker may be viable now that other parts of this are
  optimized. Hooking into the Mapbox GL webworker system is very difficult
  for third-party plugins, so it may have to be a different implementation.