| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305 |
- import { GeoJsonProperties, Feature, FeatureCollection, GeometryCollection, Geometry, GeometryObject, BBox, LineString, MultiLineString, Polygon, MultiPolygon, Point } from 'geojson';
- import { AllGeoJSON, Id, Lines } from '@turf/helpers';
- /**
- * http://turfjs.org/docs/#coordreduce
- */
- declare function coordReduce<Reducer>(
- geojson: AllGeoJSON,
- callback: (
- previousValue: Reducer,
- currentCoord: number[],
- coordIndex: number,
- featureIndex: number,
- multiFeatureIndex: number,
- geometryIndex: number
- ) => Reducer,
- initialValue?: Reducer
- ): Reducer;
- /**
- * http://turfjs.org/docs/#coordeach
- */
- declare function coordEach(
- geojson: AllGeoJSON,
- callback: (
- currentCoord: number[],
- coordIndex: number,
- featureIndex: number,
- multiFeatureIndex: number,
- geometryIndex: number
- ) => void,
- excludeWrapCoord?: boolean
- ): void;
- /**
- * http://turfjs.org/docs/#propeach
- */
- declare function propEach<Props extends GeoJsonProperties>(
- geojson: Feature<any> | FeatureCollection<any> | Feature<GeometryCollection>,
- callback: (currentProperties: Props, featureIndex: number) => void
- ): void;
- /**
- * http://turfjs.org/docs/#propreduce
- */
- declare function propReduce<
- Reducer,
- P extends GeoJsonProperties = GeoJsonProperties,
- >(
- geojson: Feature<any, P> | FeatureCollection<any, P> | Geometry,
- callback: (
- previousValue: Reducer,
- currentProperties: P,
- featureIndex: number
- ) => Reducer,
- initialValue?: Reducer
- ): Reducer;
- /**
- * http://turfjs.org/docs/#featurereduce
- */
- declare function featureReduce<
- Reducer,
- G extends GeometryObject,
- P extends GeoJsonProperties = GeoJsonProperties,
- >(
- geojson:
- | Feature<G, P>
- | FeatureCollection<G, P>
- | Feature<GeometryCollection, P>,
- callback: (
- previousValue: Reducer,
- currentFeature: Feature<G, P>,
- featureIndex: number
- ) => Reducer,
- initialValue?: Reducer
- ): Reducer;
- /**
- * http://turfjs.org/docs/#featureeach
- */
- declare function featureEach<
- G extends GeometryObject,
- P extends GeoJsonProperties = GeoJsonProperties,
- >(
- geojson:
- | Feature<G, P>
- | FeatureCollection<G, P>
- | Feature<GeometryCollection, P>,
- callback: (currentFeature: Feature<G, P>, featureIndex: number) => void
- ): void;
- /**
- * http://turfjs.org/docs/#coordall
- */
- declare function coordAll(geojson: AllGeoJSON): number[][];
- /**
- * http://turfjs.org/docs/#geomreduce
- */
- declare function geomReduce<
- Reducer,
- G extends GeometryObject,
- P extends GeoJsonProperties = GeoJsonProperties,
- >(
- geojson:
- | Feature<G, P>
- | FeatureCollection<G, P>
- | G
- | GeometryCollection
- | Feature<GeometryCollection, P>,
- callback: (
- previousValue: Reducer,
- currentGeometry: G,
- featureIndex: number,
- featureProperties: P,
- featureBBox: BBox,
- featureId: Id
- ) => Reducer,
- initialValue?: Reducer
- ): Reducer;
- /**
- * http://turfjs.org/docs/#geomeach
- */
- declare function geomEach<
- G extends GeometryObject | null,
- P extends GeoJsonProperties = GeoJsonProperties,
- >(
- geojson:
- | Feature<G, P>
- | FeatureCollection<G, P>
- | G
- | GeometryCollection
- | Feature<GeometryCollection, P>,
- callback: (
- currentGeometry: G,
- featureIndex: number,
- featureProperties: P,
- featureBBox: BBox,
- featureId: Id
- ) => void
- ): void;
- /**
- * http://turfjs.org/docs/#flattenreduce
- */
- declare function flattenReduce<
- Reducer,
- G extends GeometryObject,
- P extends GeoJsonProperties = GeoJsonProperties,
- >(
- geojson:
- | Feature<G, P>
- | FeatureCollection<G, P>
- | G
- | GeometryCollection
- | Feature<GeometryCollection, P>,
- callback: (
- previousValue: Reducer,
- currentFeature: Feature<G, P>,
- featureIndex: number,
- multiFeatureIndex: number
- ) => Reducer,
- initialValue?: Reducer
- ): Reducer;
- /**
- * http://turfjs.org/docs/#flatteneach
- */
- declare function flattenEach<
- G extends GeometryObject = GeometryObject,
- P extends GeoJsonProperties = GeoJsonProperties,
- >(
- geojson:
- | Feature<G, P>
- | FeatureCollection<G, P>
- | G
- | GeometryCollection
- | Feature<GeometryCollection, P>,
- callback: (
- currentFeature: Feature<G, P>,
- featureIndex: number,
- multiFeatureIndex: number
- ) => void
- ): void;
- /**
- * http://turfjs.org/docs/#segmentreduce
- */
- declare function segmentReduce<
- Reducer,
- P extends GeoJsonProperties = GeoJsonProperties,
- >(
- geojson:
- | FeatureCollection<Lines, P>
- | Feature<Lines, P>
- | Lines
- | Feature<GeometryCollection, P>
- | GeometryCollection,
- callback: (
- previousValue?: Reducer,
- currentSegment?: Feature<LineString, P>,
- featureIndex?: number,
- multiFeatureIndex?: number,
- segmentIndex?: number,
- geometryIndex?: number
- ) => Reducer,
- initialValue?: Reducer
- ): Reducer;
- /**
- * http://turfjs.org/docs/#segmenteach
- */
- declare function segmentEach<P extends GeoJsonProperties = GeoJsonProperties>(
- geojson: AllGeoJSON,
- callback: (
- currentSegment?: Feature<LineString, P>,
- featureIndex?: number,
- multiFeatureIndex?: number,
- segmentIndex?: number,
- geometryIndex?: number
- ) => void
- ): void;
- /**
- * http://turfjs.org/docs/#linereduce
- */
- declare function lineReduce<
- Reducer,
- P extends GeoJsonProperties = GeoJsonProperties,
- >(
- geojson:
- | FeatureCollection<Lines, P>
- | Feature<Lines, P>
- | Lines
- | Feature<GeometryCollection, P>
- | GeometryCollection,
- callback: (
- previousValue?: Reducer,
- currentLine?: Feature<LineString, P>,
- featureIndex?: number,
- multiFeatureIndex?: number,
- geometryIndex?: number
- ) => Reducer,
- initialValue?: Reducer
- ): Reducer;
- /**
- * http://turfjs.org/docs/#lineeach
- */
- declare function lineEach<P extends GeoJsonProperties = GeoJsonProperties>(
- geojson:
- | FeatureCollection<Lines, P>
- | Feature<Lines, P>
- | Lines
- | Feature<GeometryCollection, P>
- | GeometryCollection,
- callback: (
- currentLine: Feature<LineString, P>,
- featureIndex?: number,
- multiFeatureIndex?: number,
- geometryIndex?: number
- ) => void
- ): void;
- /**
- * http://turfjs.org/docs/#findsegment
- */
- declare function findSegment<
- G extends LineString | MultiLineString | Polygon | MultiPolygon,
- P extends GeoJsonProperties = GeoJsonProperties,
- >(
- geojson: Feature<G, P> | FeatureCollection<G, P> | G,
- options?: {
- featureIndex?: number;
- multiFeatureIndex?: number;
- geometryIndex?: number;
- segmentIndex?: number;
- properties?: P;
- bbox?: BBox;
- id?: Id;
- }
- ): Feature<LineString, P>;
- /**
- * http://turfjs.org/docs/#findpoint
- */
- declare function findPoint<
- G extends GeometryObject,
- P extends GeoJsonProperties = GeoJsonProperties,
- >(
- geojson: Feature<G, P> | FeatureCollection<G, P> | G,
- options?: {
- featureIndex?: number;
- multiFeatureIndex?: number;
- geometryIndex?: number;
- coordIndex?: number;
- properties?: P;
- bbox?: BBox;
- id?: Id;
- }
- ): Feature<Point, P>;
- export { coordAll, coordEach, coordReduce, featureEach, featureReduce, findPoint, findSegment, flattenEach, flattenReduce, geomEach, geomReduce, lineEach, lineReduce, propEach, propReduce, segmentEach, segmentReduce };
|