33 lines
1.2 KiB
TypeScript
33 lines
1.2 KiB
TypeScript
export interface GeoJSONGeometry {
|
|
type: string;
|
|
coordinates: any;
|
|
}
|
|
export interface BoundaryFeature {
|
|
type: 'Feature';
|
|
properties: Record<string, any>;
|
|
geometry: GeoJSONGeometry;
|
|
}
|
|
export interface BoundaryResult {
|
|
type: 'FeatureCollection';
|
|
features: BoundaryFeature[];
|
|
}
|
|
/** Set or override the GeoPackage file path */
|
|
export declare function setGpkgPath(p: string): void;
|
|
/** Parse GeoPackage Binary blob → GeoJSON geometry */
|
|
export declare function parseGpkgGeometry(blob: Buffer): GeoJSONGeometry;
|
|
export interface GadmCache {
|
|
get(key: string): Promise<any>;
|
|
set(key: string, value: any): Promise<void>;
|
|
}
|
|
export declare function getBoundaryFromGpkg(gadmId: string, contentLevel?: number, externalCache?: GadmCache, resolution?: number): Promise<BoundaryResult | null>;
|
|
export declare function containsPoint(geom: GeoJSONGeometry, pt: [number, number]): boolean;
|
|
export interface GadmPointResult {
|
|
level: number;
|
|
gadmName: string | null;
|
|
gid: string | null;
|
|
}
|
|
/**
|
|
* Perform a spatial query to find the exact GADM hierarchy containing a point.
|
|
*/
|
|
export declare function getHierarchyByPoint(lat: number, lon: number): GadmPointResult[] | null;
|