mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
refactor: define Position type for GeoJSON objects (#11259)
This commit is contained in:
parent
56f1898c4e
commit
673f06549c
@ -1,60 +1,66 @@
|
||||
/**
|
||||
* Position object.
|
||||
* https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.1
|
||||
*/
|
||||
export type Position = number[]
|
||||
|
||||
/**
|
||||
* Point geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.2
|
||||
* https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.2
|
||||
*/
|
||||
export type Point = {
|
||||
type: "Point"
|
||||
coordinates: number[]
|
||||
coordinates: Position
|
||||
}
|
||||
|
||||
/**
|
||||
* LineString geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.4
|
||||
* https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.4
|
||||
*/
|
||||
export type LineString = {
|
||||
type: "LineString"
|
||||
coordinates: number[][]
|
||||
coordinates: Position[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Polygon geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.6
|
||||
* https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6
|
||||
*/
|
||||
export type Polygon = {
|
||||
type: "Polygon"
|
||||
coordinates: number[][][]
|
||||
coordinates: Position[][]
|
||||
}
|
||||
|
||||
/**
|
||||
* MultiPoint geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.3
|
||||
* https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.3
|
||||
*/
|
||||
export type MultiPoint = {
|
||||
type: "MultiPoint"
|
||||
coordinates: number[][]
|
||||
coordinates: Position[]
|
||||
}
|
||||
|
||||
/**
|
||||
* MultiLineString geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.5
|
||||
* https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.5
|
||||
*/
|
||||
export type MultiLineString = {
|
||||
type: "MultiLineString"
|
||||
coordinates: number[][][]
|
||||
coordinates: Position[][]
|
||||
}
|
||||
|
||||
/**
|
||||
* MultiPolygon geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.7
|
||||
* https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.7
|
||||
*/
|
||||
export type MultiPolygon = {
|
||||
type: "MultiPolygon"
|
||||
coordinates: number[][][][]
|
||||
coordinates: Position[][][]
|
||||
}
|
||||
|
||||
/**
|
||||
* Geometry Collection
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.8
|
||||
* https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.8
|
||||
*/
|
||||
export type GeometryCollection = {
|
||||
type: "GeometryCollection"
|
||||
@ -83,7 +89,7 @@ export type Geography = Geometry
|
||||
|
||||
/**
|
||||
* A feature object which contains a geometry and associated properties.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.2
|
||||
* https://datatracker.ietf.org/doc/html/rfc7946#section-3.2
|
||||
*/
|
||||
export type Feature = {
|
||||
type: "Feature"
|
||||
@ -95,7 +101,7 @@ export type Feature = {
|
||||
|
||||
/**
|
||||
* A collection of feature objects.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.3
|
||||
* https://datatracker.ietf.org/doc/html/rfc7946#section-3.3
|
||||
*/
|
||||
export type FeatureCollection = {
|
||||
type: "FeatureCollection"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user