パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細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 件

ソースリポジトリ

このパッケージを使用しているプロジェクト