패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.0.14

turf

GeoJSON과 함께 작동하는 turf.js와 유사한 지리공간 분석 라이브러리로, 순수 Dart로 작성되었습니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
17.6만
좋아요
51
Pub 점수
150

패키지 설치

flutter pub add turf

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Turf는 turf.js를 영감으로 받아 Dart용 지오스페이셜 분석 라이브러리로, GeoJSON 데이터와 함께 작동하도록 설계되었습니다. 거리 계산, 버퍼링, 교차 등 공간 연산을 수행할 수 있는 도구 세트를 제공하며, 모든 기능은 순수 Dart로 구현됩니다. 네이티브 플랫폼 코드에 의존하지 않고 실시간 지리 계산이 필요한 애플리케이션에 적합합니다. Android, iOS, Web, macOS, Windows, Linux 등 여러 플랫폼을 지원하여 크로스플랫폼 개발에 매우 유연합니다. 가벼운 성능과 Flutter와의 호환성 덕분에 지도 및 위치 기반 기능에 적합합니다.

사용 사례

  • 지리공간 데이터 처리
  • 지도 기반 분석
  • 위치 인식 애플리케이션
  • 실시간 공간 계산
  • GeoJSON 조작

주요 기능

  • 순수 Dart 구현
  • GeoJSON 지원
  • 크로스 플랫폼 호환성
  • Turf.js와 유사한 API
  • 광범위한 공간 연산

적합한 대상

  • Flutter 개발자
  • GIS 애플리케이션
  • 모바일 및 웹 매핑
  • 위치 데이터를 다루는 데이터 과학자
  • 오프라인 지리공간 로직이 필요한 애플리케이션

고려 사항

  • GeoJSON 입력 형식이 필요합니다
  • 기본 지리공간 기능에 한정
  • 내장된 지도 렌더링 없음
  • 성능은 데이터 크기에 따라 달라집니다
  • 매우 큰 데이터 세트에 최적화되지 않음

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.


TurfDart Logo

A TurfJs-like geospatial analysis library written in pure Dart.


pub package dart unit tests dart publish License: MIT

–> Join our Dart / Flutter GIS Community on Discord <–

TurfDart is a Dart library for spatial analysis. It includes traditional spatial operations, helper functions for creating GeoJSON data, and data classification and statistics tools. You can use TurfDart in your Flutter applications on the web, mobile and desktop or in pure Dart applications running on the server.

As the foundation, we are using Geotypes, a lightweight dart library that provides a strong GeoJSON object model and fully RFC 7946 compliant serializers.

Most of the functionality is a translation from turf.js, the progress can be found here.

Get started

  • Get the Dart tools
  • Install the library with dart pub add turf
  • Import the library in your code and use it. For example:
import 'package:turf/helpers.dart';
import 'package:turf/src/line_segment.dart';

Feature<Polygon> poly = Feature<Polygon>(
  geometry: Polygon(coordinates: [
    [
      Position(0, 0),
      Position(2, 2),
      Position(0, 1),
      Position(0, 0),
    ],
    [
      Position(0, 0),
      Position(1, 1),
      Position(0, 1),
      Position(0, 0),
    ],
  ]),
);

void main() {
  var total = segmentReduce<int>(
    poly,
    (previousValue, currentSegment, initialValue, featureIndex,
        multiFeatureIndex, geometryIndex, segmentIndex) {
      if (previousValue != null) {
        previousValue++;
      }
      return previousValue;
    },
    0,
    combineNestedGeometries: false,
  );
  print(total);
  // total ==  6
}

GeoJSON Object Model

polymorphism

Notable Design Decisions
  • Nested GeometryCollections (as described in RFC 7946 section 3.1.8) are not supported which takes a slightly firmer stance than the "should avoid" language in the specification

Tests and Benchmarks

Tests are run with dart test and benchmarks can be run with dart run benchmark

Any new benchmarks must be named *_benchmark.dart and reside in the ./benchmark folder.

카테고리

의존성

의존성 목록 6 개

소스 저장소

이 패키지를 사용하는 프로젝트