dgeoutils 2.4.15 → 2.4.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { DLine } from './DLine';
2
2
  import { DPolygon } from './DPolygon';
3
- import { Point } from 'geojson';
3
+ import { Point, Feature } from 'geojson';
4
4
  export declare const EARTH_RADIUS_IN_METERS = 6378137;
5
5
  export declare type DCoord = [number, number] | [number, number, number];
6
6
  export interface LatLng {
@@ -34,6 +34,7 @@ export declare class DPoint {
34
34
  getCoordsFromTile(zoom?: number): DPoint;
35
35
  toCoords(format?: string): DCoord;
36
36
  toGeoJSON(format?: string): Point;
37
+ toGeoJSONFeature(format?: string): Feature<Point>;
37
38
  findLine(p: DPoint): DLine;
38
39
  findInnerAngle(p1: DPoint, p3: DPoint): number;
39
40
  toString(): string;
@@ -173,6 +173,14 @@ var DPoint = (function () {
173
173
  coordinates: this.toCoords(format)
174
174
  };
175
175
  };
176
+ DPoint.prototype.toGeoJSONFeature = function (format) {
177
+ if (format === void 0) { format = utils_1.DGeo.parseFormat; }
178
+ return {
179
+ type: 'Feature',
180
+ properties: __assign({}, this.properties),
181
+ geometry: this.toGeoJSON(format)
182
+ };
183
+ };
176
184
  DPoint.prototype.findLine = function (p) {
177
185
  (0, utils_1.checkFunction)('findLine')
178
186
  .checkArgument('this')
@@ -134,6 +134,13 @@ export class DPoint {
134
134
  coordinates: this.toCoords(format)
135
135
  };
136
136
  }
137
+ toGeoJSONFeature(format = DGeo.parseFormat) {
138
+ return {
139
+ type: 'Feature',
140
+ properties: Object.assign({}, this.properties),
141
+ geometry: this.toGeoJSON(format)
142
+ };
143
+ }
137
144
  findLine(p) {
138
145
  checkFunction('findLine')
139
146
  .checkArgument('this')
@@ -170,6 +170,14 @@ var DPoint = (function () {
170
170
  coordinates: this.toCoords(format)
171
171
  };
172
172
  };
173
+ DPoint.prototype.toGeoJSONFeature = function (format) {
174
+ if (format === void 0) { format = DGeo.parseFormat; }
175
+ return {
176
+ type: 'Feature',
177
+ properties: __assign({}, this.properties),
178
+ geometry: this.toGeoJSON(format)
179
+ };
180
+ };
173
181
  DPoint.prototype.findLine = function (p) {
174
182
  checkFunction('findLine')
175
183
  .checkArgument('this')