# inspirepolygonsdownloader

> Downloads and munges Land registry INSPIRE polygons so thay can be easily mapped and/or traversed.

Latest version **1.0.7** (published 2015-09-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install inspirepolygonsdownloader
pnpm add inspirepolygonsdownloader
yarn add inspirepolygonsdownloader
bun add inspirepolygonsdownloader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2015-09-17 |
| First published | 2015-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | robert.waggott |
| Maintainers | robert-waggott |
| Keywords | inspire, land-regstry, land use, mapping, maps, polygons, geojson, cadastral |

## Links

- npm: https://www.npmjs.com/package/inspirepolygonsdownloader
- Repository: https://github.com/robert-waggott/INSPIREPolygonsDownloader
- Issues: https://github.com/robert-waggott/INSPIREPolygonsDownloader/issues
- npm.io page: https://npm.io/package/inspirepolygonsdownloader

## Dependencies (7)

- [yauzl](https://npm.io/package/yauzl.md) ^2.3.1
- [colors](https://npm.io/package/colors.md) ^1.1.2
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [moment](https://npm.io/package/moment.md) ^2.10.6
- [geodesy](https://npm.io/package/geodesy.md) ^1.0.2
- [xml2json](https://npm.io/package/xml2json.md) ^0.8.2
- [node-promise](https://npm.io/package/node-promise.md) ^0.5.12

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.7 (latest) — 2015-09-17
- 1.0.6 — 2015-09-17
- 1.0.5 — 2015-09-16
- 1.0.4 — 2015-09-16
- 1.0.2 — 2015-08-24
- 1.0.1 — 2015-08-24
- 1.0.0 — 2015-08-24

## README

# INSPIRE Polygons Downloader

> Downloads and munges [Land registry INSPIRE polygons](https://www.gov.uk/inspire-index-polygons-spatial-data) so thay can be easily mapped and/or traversed. 

### Usage:

```
var downloader = require('inspirepolygonsdownloader')();
var options = {
    areas: ["Blaby", "Uttlesford"],
    fromDate: "2015-04-03",
    geoJson: true
};

downloader.download(options).then(function(data) {
    console.log(data);
});
```

### Options:

#### areas

* Type: `array of strings`
* Required: `Yes`

The list of areas to download, should match the format of `http://data.inspire.landregistry.gov.uk/{area}.zip`. 

#### fromDate

* Type: `Date`
* Required: `No`
* Default: `null`

To filter out the list of polygons according to the polygon's from date. 

#### geoJson

* Type: `Date`
* Required: `No`
* Default: `False`

Whether or not to return the output in [geo json format](http://geojson.org/geojson-spec.html#examples) or as a plain array of polygon data (see below for more detail). 

### Returns:

`download()` returns a deferred. The deferred callback has one parameter, `data`, depending on the `geoJson` option this data is either [geojson](http://geojson.org/geojson-spec.html#examples) of polygons with the following additional properties:

* id - The Inspire Id. 
* cadastralReference
* validFrom

If `geoJson` is false `data` is an array of objects, each object has the following members:

* id - The Inspire Id. 
* geometry - An array of eastings and northings
* latLongs - An array of latitude/longitudes
* cadastralReference
* validFrom

### Further information:

* [Background about INSPIRE](http://data.gov.uk/location/inspire)
* [INSPIRE data - Conditions of use](https://www.gov.uk/inspire-index-polygons-spatial-data) (can be found at the bottom of the page)
* [OGL - Open Government Licence](http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/)
* [Movable Type - Convert between Latitude/Longitude & OS National Grid References](http://www.movable-type.co.uk/scripts/latlong-gridref.html) - the key algorithm used to convert the GML to latatidue and longitude coordinates so it can be mapped. 

### Mapper:

[github.com/robert-waggott/INSPIREPolygonsMapper](https://github.com/robert-waggott/INSPIREPolygonsMapper) is intended as a working example of how to use this package.

---
_Source: https://npm.io/package/inspirepolygonsdownloader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
