सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
geojson पैकेज फ्लटर एप्लिकेशन में GeoJSON डेटा के साथ काम करने के लिए उपयोगी उपकरण प्रदान करता है। इसमें रियल-टाइम प्रोसेसिंग के लिए एक रिएक्टिव पार्सर शामिल है, स्पेशल सर्च ऑपरेशंस का समर्थन करता है, और स्थान-आधारित ट्रिगर के लिए जियोफेंसिंग क्षमता प्रदान करता है। मानचित्रण और भौगोलिक अंतरिक्ष विशेषताओं को एकीकृत करने वाले विकासकर्ताओं के लिए डिज़ाइन किया गया है, यह विभिन्न प्लेटफॉर्मों पर GeoJSON सामग्री के पार्सिंग और संशोधन को सरल बनाता है। नेविगेशन टूल, स्थान ट्रैकिंग या इंटरैक्टिव मैप्स जैसे डायनामिक मैप डेटा हैंडलिंग की आवश्यकता वाले एप्लिकेशन के लिए यह पैकेज आदर्श है।
उपयोग
इंटरैक्टिव मानचित्र एप्लिकेशन
स्थान-आधारित नोटिफिकेशन
भौगोलिक डेटा दृश्यकरण
रियल-टाइम मार्ग योजना
मैप परत प्रबंधन
मुख्य विशेषताएँ
प्रतिक्रियाशील जियोजेएसओएन पार्सिंग
निर्मित स्थानिक खोज
जियोफेंसिंग समर्थन
क्रॉस-प्लेटफॉर्म संगतता
प्रवाह-आधारित डेटा संचालन
इनके लिए उपयुक्त
मोबाइल और डेस्कटॉप मैपिंग ऐप्स
स्थान-जागरूक सेवाएं
जीआईएस एकीकरण
रियल-टाइम डेटा डैशबोर्ड
ज्योस्पेशियल प्रोजेक्ट्स के लिए Flutter का उपयोग करने वाली डेवलपर टीमें
विचार योग्य बातें
GeoJSON प्रारूप की समझ आवश्यक है
पूर्ण मानचित्र रेंडरिंग के लिए अतिरिक्त निर्भरता की आवश्यकता हो सकती है
प्रदर्शन डेटा के आकार पर निर्भर करता है
मूलभूत भू-अंतरिक्षीय तर्क तक सीमित
एक पूर्ण जीआईएस समाधान नहीं है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
Geojson
Utilities to work with geojson data in Dart. Features:
Parser with a reactive api: streams are available to retrieve the geojson features as soon as they are parsed
Search: search for properties
Geofencing: geofence points in a polygon or from a distance
Note: the data is parsed in an isolate to avoid slowing down the main thread
nameProperty: the property used for the geoserie name, automaticaly set if null
verbose: print the parsed data if true
These functions are suitable for small data. Example:
final features = awaitfeaturesFromGeoJson(data);
Web support
featuresFromGeoJsonMainThread: as the web do not support isolates use this function to parse in the main thread. Parameters:
data: a string with the geojson data, required
nameProperty: the property used for the geoserie name, automaticaly set if null
verbose: print the parsed data if true
Reactive api
Parse and listen
Typed streams are available to retrieve the features as soon as they are parsed. This is useful when the data is big.
processedFeatures: the parsed features: all the geometries
processedPoints: the parsed points
processedMultipoints: the parsed multipoints
processedLines: the parsed lines
processedMultilines: the parsed multilines
processedPolygons: the parsed polygons
processedMultipolygons: the parsed multipolygons
endSignal: parsing is finished indicator
Example: add assets on a Flutter map:
import'package:flutter/services.dart'show rootBundle;
import'package:geojson/geojson.dart';
import'package:flutter_map/flutter_map.dart';
/// Data for the Flutter map polylines layerfinal lines = <Polyline>[];
Future<void> parseAndDrawAssetsOnMap() async {
final geo = GeoJson();
geo.processedLines.listen((GeoJsonLine line) {
/// when a line is parsed add it to the map right awaysetState(() => lines.add(Polyline(
strokeWidth: 2.0, color: Colors.blue, points: line.geoSerie.toLatLng())));
});
geo.endSignal.listen((_) => geo.dispose());
final data = await rootBundle
.loadString('assets/railroads_of_north_america.geojson');
await geo.parse(data, verbose: true);
}
Data properties
After the data is parsed the GeoJson instance has properties to access the data:
A search method is also available, taking string data in parameter instead of a file path. The streams are available to retrieve the data as soon as it is found
Geofencing
Geofence points within a distance of a given point:
final geo = GeoJson();
/// `point` is the [GeoJsonPoint] to search from/// `points` is the list of [GeoJsonPoint] to search in/// `distance` is the distance to search in metersawait geo.geofenceDistance(
point: point, points: points, distance: distance);
List<GeoPoint> foundPoints = geo.points;
Geofence points in a polygon:
final geo = GeoJson();
/// `polygon` is the [GeoJsonPolygon] to check/// `points` is the list of [GeoJsonPoint] to search inawait geo.geofencePolygon(polygon: polygon, points: points);
List<GeoPoint> foundPoints = geo.points;
Note: the processedPoints stream is available to retrieve geofenced points as soon as they are found
Maps
To draw geojson data on a map check the Map controller package
Supported geojson features
All the data structures use GeoPoint and GeoSerie from the GeoPoint package to store the geometry data. Data structures used: