2gis/general

Name: general

Owner: 2GIS

Description: Fast marker generalization algorithm

Created: 2017-03-29 09:42:16.0

Updated: 2017-12-05 07:12:52.0

Pushed: 2018-03-13 09:12:56.0

Homepage:

Size: 2473

Language: TypeScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

General Build Status

Fast marker generalization algorithm

Demo

??????????
????? ??????? ??????

?? ???? ????????? ????????????? ???????? ?????????? ??????? ?????? ????????. ???????? ?? ????? ?????? ?????????? ?????-?? ?????????? ???????? ?? ????? ?????? ???, ????? ?????????? ???????????? ?? ????? ?? ??????????? ???? ? ??????.

generalbeforeandafter\ ?????? ??????????? ???????? ?? ????? ?? ? ????? ?????????????

?????????, ??? ?????? ???????? ???????????? ? ??????? ???????? ??????????. ??????? ?????? ??????? ?????? ????? ?????? ?????? ???????????? ?? ?????.

????? ?????????? ?????? ?????? ???????? ?? ????? ????????????, ????????:

?????? ?????? ????? ??????????? ????????? ????, ??? ??? ????? ?????????????? ??????????.

?????? ????????:


feZone: 5,
rgin: 10,
gradation: 180

?????????? ?????? ?? ???????? ???????? ? ?????-?? ?????????? ??????. ?????? ???? ?? ???????. ???? ?????? ?? ?????? ?????? ?? ???? ???????????? ?? ?????, ?? ????????? ??? ??????? ??? ? ?????? ????? ???????????? (??????) ??????. ???? ? ??? ?? ?? ???? ????????? ?? ?????, ?? ?? ???????? ? ????????? (??????) ?????? ? ?.?.

?????? ?????? ??? ????????? ????????????? ?????????????? ????????????? ???????? ????????? ??????? ???????? ?????? ??????? ???? ???? ?? ????????????????? ??????????.

safeZone

????? ???????? ?? ????? ?????? ??????????? ?? ??????????? ? ???????, ??? ????????? ????????? ?? ?????. ??? ???? ???????? ??????? ??????? ?????? ??????? ?????? ??? ??????? ???? ????????? safeZone.

safezone

?????? A ??? ????? ?? ????? ? ????? ??????? ?????? ?????? ???????, ??:

????? ??????? ????? ???????????? ????????? ?????????? ????? ???????? ?? ?????, ??? ????? ??? ?? ???????????, ? ?????????????? ??????????.

margin

????? ?????? ???????? ?? ?????, ?? ???????? ??? ?????? ??????? ?? ????????? ? ???, ??????? ?????????????? ??? ????????. ??????? ???? ??????? ????? ???????? ?????? ??????? ???? ???????? margin.

??? ???????? ????? ????????????, ????? ?????????? ???? ?? ????? ?????? ?????? ??????? ?? ????? ??????:

margin\ ????? ???????? margin ????? 0, ?????? ? 40

degradation

??????, ???????? ? ??????? ???????? ?????????? degradation ??????? ?? ????? ???????????? ??????, ????????????? ????????? ?? ???? ?????? ????, ??? ??????????? ?? ?????????? ?????. ???? ?????? ???? ?????????, ?? ?????? ?????????.

????? ??????? ????? ???????? ???? ???????, ?? ????????? ?????? ?????????:

degradation\ ????? ???????? degradation ????? 0, ?????? - 40

?????????

? ??????? npm:

install @2gis/general

????? ?????????? ????? script ???????????? ????? ?????????? ?????????? General:

ipt src="node_modules/general/dist/general.js"></script>

???? ?????????? ??? es6 ??????:

rt { General } from 'general';
?????????????

??? ?????? ????? ??????? ????????? ??????:

t general = new General();

???????? ????? ??? ?????????????:

ral.generalize(bounds, groups, atlas, markers);

???

????? ?????????? Promise, ??????? ?????????? ????? ?????????? ?????????????. ???????? ??????????? ?????????? ? ???????.

?????? ?? ????? PriorityGroup ???????? ????????? ?????????:

????? ??????????? ???????? ?? Sprite, ?????? ?? ??????? ??????? ??:

?????? Marker ??????? ??:

????? generalize ?? ?????????? ????? ?????? ????????, ?? ???????? ??????.

? ???????? ?????????????, ???????? ?????????? ???????? ???????? iconIndex ?????????????? ?????-?? ?????? ? ??????. ???? ???? ???????? ???? ?????? -1, ??????, ??? ?????? ?? ?????? ??????? ?? ????? ? ??? ???? ??????.

?????, ????????????? ?????????? ???????? ?????????????? ???????? prevGroupIndex, ????? ??? ????????? ?????????????, ???????????? ?????? ????? ???????. ??? ???????? ???????? ????????, ????? ??? ?????????? ????? ????????, ?????? ??????? ?????????????? ? ????? ???????? ??-??????.

????? ???????, ???? ?????????? ?????????? ????????????? ????????? ?? ????, ????????, ??? ????????? ???????? ?????, ?? ????? ??????? ?????? generalize ????? ????????? ???????? prevGroupIndex ? undefined ? ??????? ???????.

?????
  1. npm version patch ? ???????? ?????? ? package.json
  2. git push --follow-tags ? ???????? ????????? ?? github
  3. rm -rf dist && npm run build ? ??????? ??????
  4. npm publish ? ????????? ? npm

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.