@bravemobile/korea-administrative-area-geo-json-util
TypeScript icon, indicating that this package has built-in type declarations

1.6.0 • Public • Published

설치

npm install @bravemobile/korea-administrative-area-geo-json-util

인스턴스 생성

const koreaAdministrativeAreaGeoJsonUtil = new KoreaAdministrativeAreaGeoJsonUtil(
    admSdGeoJson,
    admSggGeoJson,
    admAllGeoJson
);

Parameters

  • admSdGeoJson (FeatureCollection<Polygon | MultiPolygon, AdministrativeAreaProperties >) 시도 GeoJSON 데이터
  • admSggGeoJson (FeatureCollection<Polygon | MultiPolygon, AdministrativeAreaProperties >) 시군구 GeoJSON 데이터
  • admAllGeoJson (FeatureCollection<Polygon | MultiPolygon, AdministrativeAreaProperties >) 전국 GeoJSON 데이터
  • options ({ cacheSize?: number; } ) 옵션
    • cacheSize: GeoJSON 병합 결과 캐시 최대 크기

mergeAreas

특정 지역구만 병합된 GeoJSON 조회

geoJsonUtil.mergeAreas(['1', '2', '3']);

Parameters

  • administrativeAreaCodes (string[]) 병합할 행정구역 코드 배열

Returns

병합된 GeoJSON

Promise<FeatureCollection<Polygon | MultiPolygon> | null>

groupConnectedAreas

인접한 행정구역들을 그룹화합니다.

geoJsonUtil.groupConnectedAreas(['1', '2', '3']);

Parameters

  • administrativeAreaCodes (string[]) 병합할 행정구역 코드 배열

Returns

인접한 행정구역별로 묶인 그룹의 배열

import {
    MultiPolygon,
    Point,
    Polygon,
} from 'geojson';

Promise<{
    areaCodes: string[]; // 그룹에 포함된 행정구역 코드 배열
    mergedFeature: Feature<Polygon | MultiPolygon> | null; // 그룹의 행정구역 GeoJSON 병합 결과
    centerFeature: Feature<Point>; // 그룹의 행정구역 GeoJSON 병합 결과의 중심 위치
}[]>

clearCache

캐시 초기화

koreaAdministrativeAreaGeoJsonUtil.clearCache();

getKorea

전국 GeoJSON 조회

geoJsonUtil.getKorea();

Readme

Keywords

Package Sidebar

Install

npm i @bravemobile/korea-administrative-area-geo-json-util

Weekly Downloads

923

Version

1.6.0

License

MIT

Unpacked Size

41.6 kB

Total Files

27

Last publish

Collaborators

  • utae
  • soomgo_mobile