पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv0.0.2

turf_pip

एक छोटी पुस्तकालय जो निर्धारित करता है कि कोई बिंदु एक बहुभुज के अंदर स्थित है या नहीं

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
1.7 लाख
लाइक
1
Pub अंक
150

पैकेज इंस्टॉल करें

flutter pub add turf_pip

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

turf_pip एक हल्का डार्ट लाइब्रेरी है जिसका उपयोग किसी भौगोलिक बिंदु के एक बहुभुज के भीतर स्थित होने का निर्धारण करने के लिए किया जाता है। यह बिंदु-एंड-पॉलीगन एल्गोरिदम को लागू करता है, जिसका उपयोग स्पेशल विश्लेषण और मैपिंग एप्लिकेशन में आमतौर पर किया जाता है। यह पैकेज एंड्रॉइड, आईओएस, वेब, मैकओएस, विंडोज और लिनक्स सहित कई प्लेटफॉर्म को सपोर्ट करता है, जिससे यह क्रॉस-प्लेटफॉर्म भौगोलिक तर्क के लिए उपयुक्त होता है। यह स्थान-आधारित सेवाओं, मैप इंटरैक्शन या स्पेशल डेटा सत्यापन जैसे उपयोग केस के लिए आदर्श है। इस लाइब्रेरी को फ्लटर के पब पैकेज मैनेजर के माध्यम से आसानी से एम्बेड किया जा सकता है।

उपयोग

  • ज्योग्राफिक स्थिति प्रमाणीकरण
  • मानचित्र-आधारित फ़िल्टरिंग
  • स्पेशियल डेटा विश्लेषण
  • इंटरैक्टिव मानचित्र विशेषताएँ
  • स्थान-जागरूक एप्लिकेशन
  • जीआईएस प्रोसेसिंग

मुख्य विशेषताएँ

  • बिंदु-बहुभुज निर्धारण
  • क्रॉस-प्लेटफ़ॉर्म समर्थन
  • हल्का और तेज़
  • Flutter के साथ आसान एकीकरण
  • शुद्ध Dart कार्यान्वयन
  • कोई बाहरी निर्भरता नहीं

इनके लिए उपयुक्त

  • मानचित्र के साथ काम कर रहे Flutter विकासकर्मी
  • स्थानिक जांच की आवश्यकता वाले अनुप्रयोग
  • बैकएंड या फ्रंटएंड भूस्थानिक तर्क
  • स्थान विशेषताओं वाले मोबाइल और वेब ऐप्स
  • न्यूनतम फुटप्रिंट उपकरणों की तलाश करने वाले विकासकर्ता

विचार योग्य बातें

  • 2D बिंदु और बहुभुज ज्यामिति पर सीमित
  • जटिल ज्यामिति के समर्थन नहीं करता, जैसे बहुभुज
  • निर्देशांक रूपांतरण या प्रोजेक्शन का हैंडलिंग नहीं
  • मान लिया गया है कि इनपुट निर्देशांक WGS84 (अक्षांश/देशांतर) प्रारूप में हैं
  • उच्च आवृत्ति के वास्तविक समय के जांच के लिए अनअनुकूलित

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

turf_pip

A small library for detecting if a point lies inside a polygon.

A port of: point-in-polygon-hao NPM package.

Point in polygon library based on the paper "Optimal Reliable Point-in-Polygon Test and Differential Coding Boolean Operations on Polygons" by Hao.

Features

  • Works on polygons with holes
  • Works with degenerate/self-intersecting polyons
  • Returns PointInPolygonResult.isOnEdge if on the edge, PointInPolygonResult.isInside if inside and PointInPolygonResult.isOutside if outside
  • Not effected by floating point errors
Usage

Install via dart pub add turf_pip

import 'package:turf_pip/turf_pip.dart';

const polygon = Polygon(coordinates:[
  [
    Position.of([1, 1]),
    Position.of([1, 2]),
    Position.of([2, 2]),
    Position.of([2, 1]),
    Position.of([1, 1])
  ]
]);

pointInPolygon(Point(coordinates: Position.of([ 1.5, 1.5 ]), polygon)
// => PointInPolygonResult.isInside

pointInPolygon(Point(coordinates: Position.of([ 4.9, 1.2 ]), polygon)
// => PointInPolygonResult.isOutside

pointInPolygon(Point(coordinates: Position.of([1, 2]), polygon)
// => PointInPolygonResult.isOnEdge

Note: The input polygon format aligns with the GeoJson specification for polygons. This means that the first and last coordinate in a polygon must be repeated, if not this library will throw an error.

var polygonWithHole = Polygon(coordinates:([
  [
    Position.of([0, 0]),
    Position.of([1, 0]),
    Position.of([1, 1]),
    Position.of([0, 1]),
    Position.of([0, 0]),
  ],
  [
    Position.of([0.1, 0.1]),
    Position.of([0.1, 0.9]),
    Position.of([0.9, 0.9]),
    Position.of([0.9, 0.1]),
    Position.of([0.1, 0.1]),
  ]
]);

The library does not support multi-polygons.

Comparisons

Some rough comparisons to similar libraries. While point-in-polygon is slightly faster in most cases it does not support polygons with holes or degenerate polygons.

// For a point in a much larger geometry (700+ vertices)
point-in-poly-hao x 474,180 ops/sec ±0.55% (93 runs sampled)
point-in-polygon x 489,649 ops/sec ±0.75% (91 runs sampled)
robust-point-in-polygon x 376,268 ops/sec ±0.79% (89 runs sampled)
// For a point in bounding box check
point-in-poly-hao x 29,365,704 ops/sec ±1.30% (90 runs sampled)
point-in-polygon x 42,339,450 ops/sec ±0.78% (95 runs sampled)
robust-point-in-polygon x 20,675,569 ops/sec ±0.65% (95 runs sampled)
Algorithm

This library is based on the paper Optimal Reliable Point-in-Polygon Test and Differential Coding Boolean Operations on Polygons

Other notes
  • Works irrespective of winding order of polygon
  • Does not appear to be effected by floating point errors compared to point-in-polygon or robust-point-in-polygon

श्रेणियाँ

निर्भरताएँ

निर्भरता सूची 1 आइटम

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट