UNPKG

ol

Version:

OpenLayers mapping library

217 lines • 7.11 kB
/** * Create an approximation of a circle on the surface of a sphere. * @param {import("../coordinate.js").Coordinate} center Center (`[lon, lat]` in degrees). * @param {number} radius The great-circle distance from the center to * the polygon vertices. * @param {number=} opt_n Optional number of vertices for the resulting * polygon. Default is `32`. * @param {number=} opt_sphereRadius Optional radius for the sphere (defaults to * the Earth's mean radius using the WGS84 ellipsoid). * @return {Polygon} The "circular" polygon. * @api */ export function circular(center: number[], radius: number, opt_n?: number, opt_sphereRadius?: number): Polygon; /** * Create a polygon from an extent. The layout used is `XY`. * @param {import("../extent.js").Extent} extent The extent. * @return {Polygon} The polygon. * @api */ export function fromExtent(extent: number[]): Polygon; /** * Create a regular polygon from a circle. * @param {import("./Circle.js").default} circle Circle geometry. * @param {number=} opt_sides Number of sides of the polygon. Default is 32. * @param {number=} opt_angle Start angle for the first vertex of the polygon in * radians. Default is 0. * @return {Polygon} Polygon geometry. * @api */ export function fromCircle(circle: import("./Circle.js").default, opt_sides?: number, opt_angle?: number): Polygon; /** * Modify the coordinates of a polygon to make it a regular polygon. * @param {Polygon} polygon Polygon geometry. * @param {import("../coordinate.js").Coordinate} center Center of the regular polygon. * @param {number} radius Radius of the regular polygon. * @param {number=} opt_angle Start angle for the first vertex of the polygon in * radians. Default is 0. */ export function makeRegular(polygon: Polygon, center: number[], radius: number, opt_angle?: number): void; export default Polygon; /** * @classdesc * Polygon geometry. * * @api */ declare class Polygon extends SimpleGeometry { /** * @param {!Array<Array<import("../coordinate.js").Coordinate>>|!Array<number>} coordinates * Array of linear rings that define the polygon. The first linear ring of the * array defines the outer-boundary or surface of the polygon. Each subsequent * linear ring defines a hole in the surface of the polygon. A linear ring is * an array of vertices' coordinates where the first coordinate and the last are * equivalent. (For internal use, flat coordinates in combination with * `opt_layout` and `opt_ends` are also accepted.) * @param {GeometryLayout=} opt_layout Layout. * @param {Array<number>=} opt_ends Ends (for internal use with flat coordinates). */ constructor(coordinates: number[] | number[][][], opt_layout?: { XY: string; XYZ: string; XYM: string; XYZM: string; }, opt_ends?: number[]); /** * @type {Array<number>} * @private */ private ends_; /** * @private * @type {number} */ private flatInteriorPointRevision_; /** * @private * @type {import("../coordinate.js").Coordinate} */ private flatInteriorPoint_; /** * @private * @type {number} */ private maxDelta_; /** * @private * @type {number} */ private maxDeltaRevision_; /** * @private * @type {number} */ private orientedRevision_; /** * @private * @type {Array<number>} */ private orientedFlatCoordinates_; /** * Append the passed linear ring to this polygon. * @param {LinearRing} linearRing Linear ring. * @api */ appendLinearRing(linearRing: LinearRing): void; /** * Make a complete copy of the geometry. * @return {!Polygon} Clone. * @override * @api */ clone(): Polygon; /** * @inheritDoc */ closestPointXY(x: any, y: any, closestPoint: any, minSquaredDistance: any): any; /** * @inheritDoc */ containsXY(x: any, y: any): boolean; /** * Return the area of the polygon on projected plane. * @return {number} Area (on projected plane). * @api */ getArea(): number; /** * Get the coordinate array for this geometry. This array has the structure * of a GeoJSON coordinate array for polygons. * * @param {boolean=} opt_right Orient coordinates according to the right-hand * rule (counter-clockwise for exterior and clockwise for interior rings). * If `false`, coordinates will be oriented according to the left-hand rule * (clockwise for exterior and counter-clockwise for interior rings). * By default, coordinate orientation will depend on how the geometry was * constructed. * @return {Array<Array<import("../coordinate.js").Coordinate>>} Coordinates. * @override * @api */ getCoordinates(opt_right?: boolean): number[][][]; /** * @return {Array<number>} Ends. */ getEnds(): number[]; /** * @return {Array<number>} Interior point. */ getFlatInteriorPoint(): number[]; /** * Return an interior point of the polygon. * @return {Point} Interior point as XYM coordinate, where M is the * length of the horizontal intersection that the point belongs to. * @api */ getInteriorPoint(): Point; /** * Return the number of rings of the polygon, this includes the exterior * ring and any interior rings. * * @return {number} Number of rings. * @api */ getLinearRingCount(): number; /** * Return the Nth linear ring of the polygon geometry. Return `null` if the * given index is out of range. * The exterior linear ring is available at index `0` and the interior rings * at index `1` and beyond. * * @param {number} index Index. * @return {LinearRing} Linear ring. * @api */ getLinearRing(index: number): LinearRing; /** * Return the linear rings of the polygon. * @return {Array<LinearRing>} Linear rings. * @api */ getLinearRings(): LinearRing[]; /** * @return {Array<number>} Oriented flat coordinates. */ getOrientedFlatCoordinates(): number[]; /** * @inheritDoc */ getSimplifiedGeometryInternal(squaredTolerance: any): any; /** * @inheritDoc * @api */ getType(): string; /** * @inheritDoc * @api */ intersectsExtent(extent: any): boolean; /** * Set the coordinates of the polygon. * @param {!Array<Array<import("../coordinate.js").Coordinate>>} coordinates Coordinates. * @param {GeometryLayout=} opt_layout Layout. * @override * @api */ setCoordinates(coordinates: number[][][], opt_layout?: { XY: string; XYZ: string; XYM: string; XYZM: string; }): void; } import SimpleGeometry from "./SimpleGeometry.js"; import LinearRing from "./LinearRing.js"; import Point from "./Point.js"; //# sourceMappingURL=Polygon.d.ts.map