add immoweb ui
This commit is contained in:
parent
7e8c79d3d1
commit
151da16c27
266 changed files with 264879 additions and 0 deletions
3
immoweb/node_modules/@turf/helpers/CHANGELOG.md
generated
vendored
Normal file
3
immoweb/node_modules/@turf/helpers/CHANGELOG.md
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# 2.0.0
|
||||
|
||||
* Only accept `[x, y]` arrays, not as arguments
|
||||
20
immoweb/node_modules/@turf/helpers/LICENSE
generated
vendored
Normal file
20
immoweb/node_modules/@turf/helpers/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 TurfJS
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
255
immoweb/node_modules/@turf/helpers/README.md
generated
vendored
Normal file
255
immoweb/node_modules/@turf/helpers/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,255 @@
|
|||
# @turf/helpers
|
||||
|
||||
# feature
|
||||
|
||||
Wraps a GeoJSON [Geometry](http://geojson.org/geojson-spec.html#geometry) in a GeoJSON [Feature](http://geojson.org/geojson-spec.html#feature-objects).
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `geometry` **[Geometry](http://geojson.org/geojson-spec.html#geometry)** input geometry
|
||||
- `properties` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** properties
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var geometry = {
|
||||
"type": "Point",
|
||||
"coordinates": [
|
||||
67.5,
|
||||
32.84267363195431
|
||||
]
|
||||
}
|
||||
|
||||
var feature = turf.feature(geometry);
|
||||
|
||||
//=feature
|
||||
```
|
||||
|
||||
Returns **[FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects)** a FeatureCollection of input features
|
||||
|
||||
# point
|
||||
|
||||
Takes coordinates and properties (optional) and returns a new [Point](http://geojson.org/geojson-spec.html#point) feature.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `coordinates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** longitude, latitude position (each in decimal degrees)
|
||||
- `properties` **\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** an Object that is used as the [Feature](http://geojson.org/geojson-spec.html#feature-objects)'s
|
||||
properties
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var pt1 = turf.point([-75.343, 39.984]);
|
||||
|
||||
//=pt1
|
||||
```
|
||||
|
||||
Returns **[Feature](http://geojson.org/geojson-spec.html#feature-objects)<[Point](http://geojson.org/geojson-spec.html#point)>** a Point feature
|
||||
|
||||
# polygon
|
||||
|
||||
Takes an array of LinearRings and optionally an [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) with properties and returns a [Polygon](http://geojson.org/geojson-spec.html#polygon) feature.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `coordinates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>>>** an array of LinearRings
|
||||
- `properties` **\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** a properties object
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var polygon = turf.polygon([[
|
||||
[-2.275543, 53.464547],
|
||||
[-2.275543, 53.489271],
|
||||
[-2.215118, 53.489271],
|
||||
[-2.215118, 53.464547],
|
||||
[-2.275543, 53.464547]
|
||||
]], { name: 'poly1', population: 400});
|
||||
|
||||
//=polygon
|
||||
```
|
||||
|
||||
- Throws **[Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)** throw an error if a LinearRing of the polygon has too few positions
|
||||
or if a LinearRing of the Polygon does not have matching Positions at the
|
||||
beginning & end.
|
||||
|
||||
Returns **[Feature](http://geojson.org/geojson-spec.html#feature-objects)<[Polygon](http://geojson.org/geojson-spec.html#polygon)>** a Polygon feature
|
||||
|
||||
# lineString
|
||||
|
||||
Creates a [LineString](http://geojson.org/geojson-spec.html#linestring) based on a
|
||||
coordinate array. Properties can be added optionally.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `coordinates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>>** an array of Positions
|
||||
- `properties` **\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** an Object of key-value pairs to add as properties
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var linestring1 = turf.lineString([
|
||||
[-21.964416, 64.148203],
|
||||
[-21.956176, 64.141316],
|
||||
[-21.93901, 64.135924],
|
||||
[-21.927337, 64.136673]
|
||||
]);
|
||||
var linestring2 = turf.lineString([
|
||||
[-21.929054, 64.127985],
|
||||
[-21.912918, 64.134726],
|
||||
[-21.916007, 64.141016],
|
||||
[-21.930084, 64.14446]
|
||||
], {name: 'line 1', distance: 145});
|
||||
|
||||
//=linestring1
|
||||
|
||||
//=linestring2
|
||||
```
|
||||
|
||||
- Throws **[Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)** if no coordinates are passed
|
||||
|
||||
Returns **[Feature](http://geojson.org/geojson-spec.html#feature-objects)<[LineString](http://geojson.org/geojson-spec.html#linestring)>** a LineString feature
|
||||
|
||||
# featureCollection
|
||||
|
||||
Takes one or more [Features](http://geojson.org/geojson-spec.html#feature-objects) and creates a [FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects).
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `features` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Feature](http://geojson.org/geojson-spec.html#feature-objects)>** input features
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var features = [
|
||||
turf.point([-75.343, 39.984], {name: 'Location A'}),
|
||||
turf.point([-75.833, 39.284], {name: 'Location B'}),
|
||||
turf.point([-75.534, 39.123], {name: 'Location C'})
|
||||
];
|
||||
|
||||
var fc = turf.featureCollection(features);
|
||||
|
||||
//=fc
|
||||
```
|
||||
|
||||
Returns **[FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects)** a FeatureCollection of input features
|
||||
|
||||
# multiLineString
|
||||
|
||||
Creates a [Feature<MultiLineString>](Feature<MultiLineString>) based on a
|
||||
coordinate array. Properties can be added optionally.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `coordinates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>>>** an array of LineStrings
|
||||
- `properties` **\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** an Object of key-value pairs to add as properties
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var multiLine = turf.multiLineString([[[0,0],[10,10]]]);
|
||||
|
||||
//=multiLine
|
||||
```
|
||||
|
||||
- Throws **[Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)** if no coordinates are passed
|
||||
|
||||
Returns **[Feature](http://geojson.org/geojson-spec.html#feature-objects)<[MultiLineString](http://geojson.org/geojson-spec.html#multilinestring)>** a MultiLineString feature
|
||||
|
||||
# multiPoint
|
||||
|
||||
Creates a [Feature<MultiPoint>](Feature<MultiPoint>) based on a
|
||||
coordinate array. Properties can be added optionally.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `coordinates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>>** an array of Positions
|
||||
- `properties` **\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** an Object of key-value pairs to add as properties
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var multiPt = turf.multiPoint([[0,0],[10,10]]);
|
||||
|
||||
//=multiPt
|
||||
```
|
||||
|
||||
- Throws **[Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)** if no coordinates are passed
|
||||
|
||||
Returns **[Feature](http://geojson.org/geojson-spec.html#feature-objects)<[MultiPoint](http://geojson.org/geojson-spec.html#multipoint)>** a MultiPoint feature
|
||||
|
||||
# multiPolygon
|
||||
|
||||
Creates a [Feature<MultiPolygon>](Feature<MultiPolygon>) based on a
|
||||
coordinate array. Properties can be added optionally.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `coordinates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>>>>** an array of Polygons
|
||||
- `properties` **\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** an Object of key-value pairs to add as properties
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var multiPoly = turf.multiPolygon([[[[0,0],[0,10],[10,10],[10,0],[0,0]]]]);
|
||||
|
||||
//=multiPoly
|
||||
```
|
||||
|
||||
- Throws **[Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)** if no coordinates are passed
|
||||
|
||||
Returns **[Feature](http://geojson.org/geojson-spec.html#feature-objects)<[MultiPolygon](http://geojson.org/geojson-spec.html#multipolygon)>** a multipolygon feature
|
||||
|
||||
# geometryCollection
|
||||
|
||||
Creates a [Feature<GeometryCollection>](Feature<GeometryCollection>) based on a
|
||||
coordinate array. Properties can be added optionally.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `geometries` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<{Geometry}>** an array of GeoJSON Geometries
|
||||
- `properties` **\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** an Object of key-value pairs to add as properties
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var pt = {
|
||||
"type": "Point",
|
||||
"coordinates": [100, 0]
|
||||
};
|
||||
var line = {
|
||||
"type": "LineString",
|
||||
"coordinates": [ [101, 0], [102, 1] ]
|
||||
};
|
||||
var collection = turf.geometryCollection([pt, line]);
|
||||
|
||||
//=collection
|
||||
```
|
||||
|
||||
Returns **[Feature](http://geojson.org/geojson-spec.html#feature-objects)<[GeometryCollection](http://geojson.org/geojson-spec.html#geometrycollection)>** a GeoJSON GeometryCollection Feature
|
||||
|
||||
<!-- This file is automatically generated. Please don't edit it directly:
|
||||
if you find an error, edit the source file (likely index.js), and re-run
|
||||
./scripts/generate-readmes in the turf project. -->
|
||||
|
||||
---
|
||||
|
||||
This module is part of the [Turfjs project](http://turfjs.org/), an open source
|
||||
module collection dedicated to geographic algorithms. It is maintained in the
|
||||
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
|
||||
PRs and issues.
|
||||
|
||||
### Installation
|
||||
|
||||
Install this module individually:
|
||||
|
||||
```sh
|
||||
$ npm install @turf/helpers
|
||||
```
|
||||
|
||||
Or install the Turf module that includes it as a function:
|
||||
|
||||
```sh
|
||||
$ npm install @turf/turf
|
||||
```
|
||||
89
immoweb/node_modules/@turf/helpers/index.d.ts
generated
vendored
Normal file
89
immoweb/node_modules/@turf/helpers/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
/// <reference types="geojson" />
|
||||
|
||||
export type Points = GeoJSON.FeatureCollection<GeoJSON.Point>;
|
||||
export type Point = GeoJSON.Feature<GeoJSON.Point>;
|
||||
export type MultiPoints = GeoJSON.FeatureCollection<GeoJSON.MultiPoint>;
|
||||
export type MultiPoint = GeoJSON.Feature<GeoJSON.MultiPoint>;
|
||||
export type LineStrings = GeoJSON.FeatureCollection<GeoJSON.LineString>;
|
||||
export type LineString = GeoJSON.Feature<GeoJSON.LineString>;
|
||||
export type MultiLineStrings = GeoJSON.FeatureCollection<GeoJSON.MultiLineString>;
|
||||
export type MultiLineString = GeoJSON.Feature<GeoJSON.MultiLineString>;
|
||||
export type Polygons = GeoJSON.FeatureCollection<GeoJSON.Polygon>;
|
||||
export type Polygon = GeoJSON.Feature<GeoJSON.Polygon>;
|
||||
export type MultiPolygons = GeoJSON.FeatureCollection<GeoJSON.MultiPolygon>;
|
||||
export type MultiPolygon = GeoJSON.Feature<GeoJSON.MultiPolygon>;
|
||||
export type Features = GeoJSON.FeatureCollection<any>;
|
||||
export type Feature = GeoJSON.Feature<any>;
|
||||
export type Position = GeoJSON.Position;
|
||||
export type LineStringFeatures = LineString | LineStrings | MultiLineString | MultiLineStrings | GeoJSON.LineString | GeoJSON.MultiLineString
|
||||
export type PolygonFeatures = Polygon | Polygons | MultiPolygon | MultiPolygons | GeoJSON.Polygon | GeoJSON.MultiPolygon
|
||||
export type Units = "miles" | "nauticalmiles" | "degrees" | "radians" | "inches" | "yards" | "meters" | "metres" | "kilometers" | "kilometres";
|
||||
export type BBox = [number, number, number, number];
|
||||
|
||||
/**
|
||||
* http://turfjs.org/docs/#feature
|
||||
*/
|
||||
export function feature(geometry: GeoJSON.GeometryObject, properties?: any): Feature;
|
||||
|
||||
/**
|
||||
* http://turfjs.org/docs/#point
|
||||
*/
|
||||
export function point(coordinates: Position, properties?: any): Point;
|
||||
|
||||
/**
|
||||
* http://turfjs.org/docs/#polygon
|
||||
*/
|
||||
export function polygon(coordinates: Position[][], properties?: any): Polygon;
|
||||
|
||||
/**
|
||||
* http://turfjs.org/docs/#linestring
|
||||
*/
|
||||
export function lineString(coordinates: Position[], properties?: any): LineString;
|
||||
|
||||
/**
|
||||
* http://turfjs.org/docs/#featurecollection
|
||||
*/
|
||||
export const featureCollection: {
|
||||
(features: Array<Point>): Points;
|
||||
(features: Array<LineString>): LineStrings;
|
||||
(features: Array<Polygon>): Polygons;
|
||||
(features: Array<MultiPoint>): MultiPoints;
|
||||
(features: Array<MultiLineString>): MultiLineStrings;
|
||||
(features: Array<MultiPolygon>): MultiPolygons;
|
||||
(features: Array<Feature>): Features;
|
||||
};
|
||||
|
||||
/**
|
||||
* http://turfjs.org/docs/#multilinestring
|
||||
*/
|
||||
export function multiLineString(coordinates: Position[][], properties?: any): MultiLineString;
|
||||
|
||||
/**
|
||||
* http://turfjs.org/docs/#multipoint
|
||||
*/
|
||||
export function multiPoint(coordinates: Position[], properties?: any): MultiPoint;
|
||||
|
||||
/**
|
||||
* http://turfjs.org/docs/#multipolygon
|
||||
*/
|
||||
export function multiPolygon(coordinates: Position[][][], properties?: any): MultiPolygon;
|
||||
|
||||
/**
|
||||
* http://turfjs.org/docs/#geometrycollection
|
||||
*/
|
||||
export function geometryCollection(geometries: Array<GeoJSON.GeometryObject>, properties?: any): GeoJSON.GeometryCollection;
|
||||
|
||||
/**
|
||||
* http://turfjs.org/docs/
|
||||
*/
|
||||
export function radiansToDistance(radians: number, units?: Units): number
|
||||
|
||||
/**
|
||||
* http://turfjs.org/docs/
|
||||
*/
|
||||
export function distanceToRadians(distance: number, units?: Units): number
|
||||
|
||||
/**
|
||||
* http://turfjs.org/docs/
|
||||
*/
|
||||
export function distanceToDegrees(distance: number, units?: Units): number
|
||||
324
immoweb/node_modules/@turf/helpers/index.js
generated
vendored
Normal file
324
immoweb/node_modules/@turf/helpers/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,324 @@
|
|||
/**
|
||||
* Wraps a GeoJSON {@link Geometry} in a GeoJSON {@link Feature}.
|
||||
*
|
||||
* @name feature
|
||||
* @param {Geometry} geometry input geometry
|
||||
* @param {Object} properties properties
|
||||
* @returns {FeatureCollection} a FeatureCollection of input features
|
||||
* @example
|
||||
* var geometry = {
|
||||
* "type": "Point",
|
||||
* "coordinates": [
|
||||
* 67.5,
|
||||
* 32.84267363195431
|
||||
* ]
|
||||
* }
|
||||
*
|
||||
* var feature = turf.feature(geometry);
|
||||
*
|
||||
* //=feature
|
||||
*/
|
||||
function feature(geometry, properties) {
|
||||
if (!geometry) throw new Error('No geometry passed');
|
||||
|
||||
return {
|
||||
type: 'Feature',
|
||||
properties: properties || {},
|
||||
geometry: geometry
|
||||
};
|
||||
}
|
||||
module.exports.feature = feature;
|
||||
|
||||
/**
|
||||
* Takes coordinates and properties (optional) and returns a new {@link Point} feature.
|
||||
*
|
||||
* @name point
|
||||
* @param {Array<number>} coordinates longitude, latitude position (each in decimal degrees)
|
||||
* @param {Object=} properties an Object that is used as the {@link Feature}'s
|
||||
* properties
|
||||
* @returns {Feature<Point>} a Point feature
|
||||
* @example
|
||||
* var pt1 = turf.point([-75.343, 39.984]);
|
||||
*
|
||||
* //=pt1
|
||||
*/
|
||||
module.exports.point = function (coordinates, properties) {
|
||||
if (!coordinates) throw new Error('No coordinates passed');
|
||||
if (coordinates.length === undefined) throw new Error('Coordinates must be an array');
|
||||
if (coordinates.length < 2) throw new Error('Coordinates must be at least 2 numbers long');
|
||||
if (typeof coordinates[0] !== 'number' || typeof coordinates[1] !== 'number') throw new Error('Coordinates must numbers');
|
||||
|
||||
return feature({
|
||||
type: 'Point',
|
||||
coordinates: coordinates
|
||||
}, properties);
|
||||
};
|
||||
|
||||
/**
|
||||
* Takes an array of LinearRings and optionally an {@link Object} with properties and returns a {@link Polygon} feature.
|
||||
*
|
||||
* @name polygon
|
||||
* @param {Array<Array<Array<number>>>} coordinates an array of LinearRings
|
||||
* @param {Object=} properties a properties object
|
||||
* @returns {Feature<Polygon>} a Polygon feature
|
||||
* @throws {Error} throw an error if a LinearRing of the polygon has too few positions
|
||||
* or if a LinearRing of the Polygon does not have matching Positions at the
|
||||
* beginning & end.
|
||||
* @example
|
||||
* var polygon = turf.polygon([[
|
||||
* [-2.275543, 53.464547],
|
||||
* [-2.275543, 53.489271],
|
||||
* [-2.215118, 53.489271],
|
||||
* [-2.215118, 53.464547],
|
||||
* [-2.275543, 53.464547]
|
||||
* ]], { name: 'poly1', population: 400});
|
||||
*
|
||||
* //=polygon
|
||||
*/
|
||||
module.exports.polygon = function (coordinates, properties) {
|
||||
if (!coordinates) throw new Error('No coordinates passed');
|
||||
|
||||
for (var i = 0; i < coordinates.length; i++) {
|
||||
var ring = coordinates[i];
|
||||
if (ring.length < 4) {
|
||||
throw new Error('Each LinearRing of a Polygon must have 4 or more Positions.');
|
||||
}
|
||||
for (var j = 0; j < ring[ring.length - 1].length; j++) {
|
||||
if (ring[ring.length - 1][j] !== ring[0][j]) {
|
||||
throw new Error('First and last Position are not equivalent.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return feature({
|
||||
type: 'Polygon',
|
||||
coordinates: coordinates
|
||||
}, properties);
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a {@link LineString} based on a
|
||||
* coordinate array. Properties can be added optionally.
|
||||
*
|
||||
* @name lineString
|
||||
* @param {Array<Array<number>>} coordinates an array of Positions
|
||||
* @param {Object=} properties an Object of key-value pairs to add as properties
|
||||
* @returns {Feature<LineString>} a LineString feature
|
||||
* @throws {Error} if no coordinates are passed
|
||||
* @example
|
||||
* var linestring1 = turf.lineString([
|
||||
* [-21.964416, 64.148203],
|
||||
* [-21.956176, 64.141316],
|
||||
* [-21.93901, 64.135924],
|
||||
* [-21.927337, 64.136673]
|
||||
* ]);
|
||||
* var linestring2 = turf.lineString([
|
||||
* [-21.929054, 64.127985],
|
||||
* [-21.912918, 64.134726],
|
||||
* [-21.916007, 64.141016],
|
||||
* [-21.930084, 64.14446]
|
||||
* ], {name: 'line 1', distance: 145});
|
||||
*
|
||||
* //=linestring1
|
||||
*
|
||||
* //=linestring2
|
||||
*/
|
||||
module.exports.lineString = function (coordinates, properties) {
|
||||
if (!coordinates) throw new Error('No coordinates passed');
|
||||
|
||||
return feature({
|
||||
type: 'LineString',
|
||||
coordinates: coordinates
|
||||
}, properties);
|
||||
};
|
||||
|
||||
/**
|
||||
* Takes one or more {@link Feature|Features} and creates a {@link FeatureCollection}.
|
||||
*
|
||||
* @name featureCollection
|
||||
* @param {Feature[]} features input features
|
||||
* @returns {FeatureCollection} a FeatureCollection of input features
|
||||
* @example
|
||||
* var features = [
|
||||
* turf.point([-75.343, 39.984], {name: 'Location A'}),
|
||||
* turf.point([-75.833, 39.284], {name: 'Location B'}),
|
||||
* turf.point([-75.534, 39.123], {name: 'Location C'})
|
||||
* ];
|
||||
*
|
||||
* var fc = turf.featureCollection(features);
|
||||
*
|
||||
* //=fc
|
||||
*/
|
||||
module.exports.featureCollection = function (features) {
|
||||
if (!features) throw new Error('No features passed');
|
||||
|
||||
return {
|
||||
type: 'FeatureCollection',
|
||||
features: features
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a {@link Feature<MultiLineString>} based on a
|
||||
* coordinate array. Properties can be added optionally.
|
||||
*
|
||||
* @name multiLineString
|
||||
* @param {Array<Array<Array<number>>>} coordinates an array of LineStrings
|
||||
* @param {Object=} properties an Object of key-value pairs to add as properties
|
||||
* @returns {Feature<MultiLineString>} a MultiLineString feature
|
||||
* @throws {Error} if no coordinates are passed
|
||||
* @example
|
||||
* var multiLine = turf.multiLineString([[[0,0],[10,10]]]);
|
||||
*
|
||||
* //=multiLine
|
||||
*
|
||||
*/
|
||||
module.exports.multiLineString = function (coordinates, properties) {
|
||||
if (!coordinates) throw new Error('No coordinates passed');
|
||||
|
||||
return feature({
|
||||
type: 'MultiLineString',
|
||||
coordinates: coordinates
|
||||
}, properties);
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a {@link Feature<MultiPoint>} based on a
|
||||
* coordinate array. Properties can be added optionally.
|
||||
*
|
||||
* @name multiPoint
|
||||
* @param {Array<Array<number>>} coordinates an array of Positions
|
||||
* @param {Object=} properties an Object of key-value pairs to add as properties
|
||||
* @returns {Feature<MultiPoint>} a MultiPoint feature
|
||||
* @throws {Error} if no coordinates are passed
|
||||
* @example
|
||||
* var multiPt = turf.multiPoint([[0,0],[10,10]]);
|
||||
*
|
||||
* //=multiPt
|
||||
*
|
||||
*/
|
||||
module.exports.multiPoint = function (coordinates, properties) {
|
||||
if (!coordinates) throw new Error('No coordinates passed');
|
||||
|
||||
return feature({
|
||||
type: 'MultiPoint',
|
||||
coordinates: coordinates
|
||||
}, properties);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Creates a {@link Feature<MultiPolygon>} based on a
|
||||
* coordinate array. Properties can be added optionally.
|
||||
*
|
||||
* @name multiPolygon
|
||||
* @param {Array<Array<Array<Array<number>>>>} coordinates an array of Polygons
|
||||
* @param {Object=} properties an Object of key-value pairs to add as properties
|
||||
* @returns {Feature<MultiPolygon>} a multipolygon feature
|
||||
* @throws {Error} if no coordinates are passed
|
||||
* @example
|
||||
* var multiPoly = turf.multiPolygon([[[[0,0],[0,10],[10,10],[10,0],[0,0]]]]);
|
||||
*
|
||||
* //=multiPoly
|
||||
*
|
||||
*/
|
||||
module.exports.multiPolygon = function (coordinates, properties) {
|
||||
if (!coordinates) throw new Error('No coordinates passed');
|
||||
|
||||
return feature({
|
||||
type: 'MultiPolygon',
|
||||
coordinates: coordinates
|
||||
}, properties);
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a {@link Feature<GeometryCollection>} based on a
|
||||
* coordinate array. Properties can be added optionally.
|
||||
*
|
||||
* @name geometryCollection
|
||||
* @param {Array<{Geometry}>} geometries an array of GeoJSON Geometries
|
||||
* @param {Object=} properties an Object of key-value pairs to add as properties
|
||||
* @returns {Feature<GeometryCollection>} a GeoJSON GeometryCollection Feature
|
||||
* @example
|
||||
* var pt = {
|
||||
* "type": "Point",
|
||||
* "coordinates": [100, 0]
|
||||
* };
|
||||
* var line = {
|
||||
* "type": "LineString",
|
||||
* "coordinates": [ [101, 0], [102, 1] ]
|
||||
* };
|
||||
* var collection = turf.geometryCollection([pt, line]);
|
||||
*
|
||||
* //=collection
|
||||
*/
|
||||
module.exports.geometryCollection = function (geometries, properties) {
|
||||
if (!geometries) throw new Error('No geometries passed');
|
||||
|
||||
return feature({
|
||||
type: 'GeometryCollection',
|
||||
geometries: geometries
|
||||
}, properties);
|
||||
};
|
||||
|
||||
var factors = {
|
||||
miles: 3960,
|
||||
nauticalmiles: 3441.145,
|
||||
degrees: 57.2957795,
|
||||
radians: 1,
|
||||
inches: 250905600,
|
||||
yards: 6969600,
|
||||
meters: 6373000,
|
||||
metres: 6373000,
|
||||
kilometers: 6373,
|
||||
kilometres: 6373,
|
||||
feet: 20908792.65
|
||||
};
|
||||
|
||||
/*
|
||||
* Convert a distance measurement from radians to a more friendly unit.
|
||||
*
|
||||
* @name radiansToDistance
|
||||
* @param {number} distance in radians across the sphere
|
||||
* @param {string} [units=kilometers] can be degrees, radians, miles, or kilometers
|
||||
* inches, yards, metres, meters, kilometres, kilometers.
|
||||
* @returns {number} distance
|
||||
*/
|
||||
module.exports.radiansToDistance = function (radians, units) {
|
||||
var factor = factors[units || 'kilometers'];
|
||||
if (factor === undefined) throw new Error('Invalid unit');
|
||||
|
||||
return radians * factor;
|
||||
};
|
||||
|
||||
/*
|
||||
* Convert a distance measurement from a real-world unit into radians
|
||||
*
|
||||
* @name distanceToRadians
|
||||
* @param {number} distance in real units
|
||||
* @param {string} [units=kilometers] can be degrees, radians, miles, or kilometers
|
||||
* inches, yards, metres, meters, kilometres, kilometers.
|
||||
* @returns {number} radians
|
||||
*/
|
||||
module.exports.distanceToRadians = function (distance, units) {
|
||||
var factor = factors[units || 'kilometers'];
|
||||
if (factor === undefined) throw new Error('Invalid unit');
|
||||
|
||||
return distance / factor;
|
||||
};
|
||||
|
||||
/*
|
||||
* Convert a distance measurement from a real-world unit into degrees
|
||||
*
|
||||
* @name distanceToRadians
|
||||
* @param {number} distance in real units
|
||||
* @param {string} [units=kilometers] can be degrees, radians, miles, or kilometers
|
||||
* inches, yards, metres, meters, kilometres, kilometers.
|
||||
* @returns {number} degrees
|
||||
*/
|
||||
module.exports.distanceToDegrees = function (distance, units) {
|
||||
var factor = factors[units || 'kilometers'];
|
||||
if (factor === undefined) throw new Error('Invalid unit');
|
||||
|
||||
return (distance / factor) * 57.2958;
|
||||
};
|
||||
67
immoweb/node_modules/@turf/helpers/package.json
generated
vendored
Normal file
67
immoweb/node_modules/@turf/helpers/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
{
|
||||
"_from": "@turf/helpers@^3.13.0",
|
||||
"_id": "@turf/helpers@3.13.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-0GB4oUZM9WzbfqYk6h4TpxuIuAY=",
|
||||
"_location": "/@turf/helpers",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@turf/helpers@^3.13.0",
|
||||
"name": "@turf/helpers",
|
||||
"escapedName": "@turf%2fhelpers",
|
||||
"scope": "@turf",
|
||||
"rawSpec": "^3.13.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^3.13.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@turf/center",
|
||||
"/@turf/destination",
|
||||
"/@turf/distance",
|
||||
"/@turf/hex-grid"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-3.13.0.tgz",
|
||||
"_shasum": "d06078a1464cf56cdb7ea624ea1e13a71b88b806",
|
||||
"_spec": "@turf/helpers@^3.13.0",
|
||||
"_where": "/home/kadir/workspace/webimmo/node_modules/@turf/center",
|
||||
"author": {
|
||||
"name": "Turf Authors"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/Turfjs/turf/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "turf helpers module",
|
||||
"devDependencies": {
|
||||
"benchmark": "^2.1.3",
|
||||
"tape": "^3.5.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"homepage": "https://github.com/Turfjs/turf",
|
||||
"keywords": [
|
||||
"geo",
|
||||
"point",
|
||||
"turf",
|
||||
"geojson"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "@turf/helpers",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/Turfjs/turf.git"
|
||||
},
|
||||
"scripts": {
|
||||
"bench": "node bench.js",
|
||||
"test": "node test.js"
|
||||
},
|
||||
"types": "index.d.ts",
|
||||
"version": "3.13.0"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue