geojson_vi는 RFC 7946에 엄격히 부합하는 방식으로 GeoJSON 데이터를 효율적으로 처리하기 위해 설계된 오픈소스 Dart 및 Flutter 라이브러리입니다. 개발자들이 포인트, 라인, 다각형, 피처 컬렉션과 같은 GeoJSON 구조를 파싱하고 검증하며 조작할 수 있도록 하며, 여러 플랫폼에서 Flutter 애플리케이션 내에서 사용할 수 있습니다. Android, iOS, Web, macOS, Windows, Linux 앱에 원활하게 통합 가능하여 위치 기반 서비스와 지도 기능에 이상적입니다. 성능과 정확성에 중점을 두어 현대적인 Flutter 프로젝트에서 지리 데이터를 다루는 것을 간편하게 만듭니다.
사용 사례
지도 기반 애플리케이션
지공간 데이터 시각화
위치 인식 기능
GIS 워크플로우를 위한 데이터 검증
지도 API와의 통합
주요 기능
RFC 7946 준수
크로스 플랫폼 지원
효율적인 파싱 및 직렬화
모든 GeoJSON 유형 지원
경량이며 통합이 쉬움
적합한 대상
지도를 사용하는 Flutter 개발자
모바일 앱에서의 GIS 데이터 처리
정확한 GeoJSON 처리가 필요한 응용 프로그램
플랫폼에 관계없이 지리 데이터 도구가 필요한 프로젝트
오픈소스 GeoJSON 솔루션을 찾는 개발자
고려 사항
GeoJSON 구조에 대한 이해가 필요합니다
GeoJSON 전용 작업에 제한됨
내장 지도 렌더링 없음
표시를 위해 외부 매핑 라이브러리에 의존합니다
대규모 공간 분석에 최적화되지 않음
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
geojson_vi: An Open-Source Dart and Flutter Library for Efficiently Handling GeoJSON Data in Compliance with RFC 7946
geojson_vi is an open-source library for Dart and Flutter developers, specifically designed to provide comprehensive support for the GeoJSON geospatial data interchange format as per the RFC 7946 standard. The software is a flexible, reliable tool that allows developers to parse, read, create, update, search, and delete geospatial data effectively.
Feature Highlights of geojson_vi
Powerful Tools for Efficient GeoJSON Data Handling. Some of the primary ones include:
Parsing and Reading GeoJSON Data: geojson_vi allows developers to quickly parse and read GeoJSON data, ensuring full compliance with RFC 7946 standard.
Creating, Updating, Searching, and Deleting GeoJSON Data: With geojson_vi, developers can easily manipulate GeoJSON data, from creating new data entries to updating, searching, and deleting existing data.
Support for All GeoJSON Objects: geojson_vi offers comprehensive support for a wide range of Geometry types (GeoJSONPoint, GeoJSONMultiPoint, GeoJSONLineString, GeoJSONMultiLineString, GeoJSONPolygon, GeoJSONMultiPolygon, GeoJSONGeometryCollection), Feature, and FeatureCollection, making it a versatile tool for effectively managing diverse geospatial data.
GeoJSON UML Model
Class structure of the geojson_vi library
Detailed Class Diagram of GeoJSON Geometry in the geojson_vi library
Usage
Create GeoJSON object
final map = {
'type': 'Point',
'coordinates': [105.77389, 21.0720414]
};
final jsonString =
'{"type": "Point", "coordinates": [105.78070163726807, 21.067921688241626]}';
final polygonCoordinates = [
[
[104.765625, 20.468189],
[106.545410, 20.468189],
[106.545410, 21.596150],
[104.765625, 21.596150],
[104.765625, 20.468189]
]
];
// Creating a GeoJSON object from data without knowing its typefinal pointFromMap = GeoJSON.fromMap(map);
// Creating a GeoJSONPoint object from a JSON string when the type is knownfinal pointFromJSON = GeoJSONPoint.fromJSON(jsonString);
// Creating a GeoJSONGeometry object from data without knowing its typefinal geometryFromMap = GeoJSONGeometry.fromMap(map);
// Creating a GeoJSONPoint object from a JSON string when the type is knownfinal geometryFromJSON = GeoJSONPoint.fromJSON(jsonString);
// Creating a GeoJSONPoint object from coordinates datafinal pointFromCoordinates = GeoJSONPoint([105.77389, 21.0720414]);
// Creating a GeoJSONFeature objectfinal feature = GeoJSONFeature(
GeoJSONPoint([105.780701, 21.067921]),
properties: {
'title': 'Hanoi University of Mining and Geology',
'url': 'http://humg.edu.vn',
},
);
// Creating a GeoJSONFeatureCollection objectfinal featureCollection = GeoJSONFeatureCollection([]);
featureCollection.features.add(feature);
// Creating more GeoJSONFeaturefinal polygon = GeoJSONPolygon(polygonCoordinates);
final polygonFeature = GeoJSONFeature(polygon);
featureCollection.features.add(polygonFeature);
Demo
import'package:geojson_vi/geojson_vi.dart';
voidmain() {
final featureCollection = GeoJSONFeatureCollection([]);
final point = GeoJSONPoint([105.7743099, 21.0717561]);
final feature = GeoJSONFeature(point, properties: {
'marker-color': '#7e7e7e',
'marker-size': 'medium',
'marker-symbol': 'college',
'title': 'Hanoi University of Mining and Geology',
'department': 'Geoinformation Technology',
'address':
'No.18 Vien Street - Duc Thang Ward - Bac Tu Liem District - Ha Noi, Vietnam',
'url': 'http://humg.edu.vn'
});
featureCollection.features.add(feature);
final pos1 = [105.7771289, 21.0715458];
final pos2 = [105.7745218, 21.0715658];
final pos3 = [105.7729125, 21.0715358];
final lineString = GeoJSONLineString([pos1, pos2, pos3]);
featureCollection.features.add(GeoJSONFeature(lineString, properties: {
'stroke': '#7e7e7e',
'stroke-width': 2,
'stroke-opacity': 1,
'title': 'Vien St.'
}));
final p01 = [105.7739666, 21.0726795]; // The first positionfinal p02 = [105.7739719, 21.0721991];
final p03 = [105.7743394, 21.0721966];
final p04 = [105.7743310, 21.0725269];
final p05 = [105.7742564, 21.0726120];
final p06 = [105.7741865, 21.0726095];
final p07 = [105.7741785, 21.0726746];
final p08 = [105.7739666, 21.0726795]; // The last positionfinal linerRing = [p01, p02, p03, p04, p05, p06, p07, p08];
featureCollection.features.add(
GeoJSONFeature(
GeoJSONPolygon([linerRing]),
properties: {
'stroke': '#555555',
'stroke-width': 2,
'stroke-opacity': 1,
'fill': '#ab7942',
'fill-opacity': 0.5,
'title': "HUMG's Office"
},
),
);
print(featureCollection.toJSON());
}