From 686e446cd2eaba3ce9fb5fbdc85ae9479d8b226d Mon Sep 17 00:00:00 2001 From: Kirill Bychkov Date: Sun, 26 Jul 2020 22:22:26 +0300 Subject: [PATCH] release 1.0.1+2 --- CHANGELOG.md | 5 +++++ README.md | 2 +- lib/src/gpx_reader.dart | 1 + lib/src/gpx_writer.dart | 2 ++ lib/src/kml_writer.dart | 2 ++ lib/src/model/bounds.dart | 2 ++ lib/src/model/copyright.dart | 4 ++++ lib/src/model/email.dart | 3 +++ lib/src/model/gpx.dart | 3 +++ lib/src/model/gpx_tag.dart | 1 + lib/src/model/kml_tag.dart | 1 + lib/src/model/link.dart | 3 +++ lib/src/model/metadata.dart | 4 ++++ lib/src/model/person.dart | 2 ++ lib/src/model/rte.dart | 3 +++ lib/src/model/trk.dart | 2 ++ lib/src/model/trkseg.dart | 5 +++++ lib/src/model/wpt.dart | 2 ++ pubspec.yaml | 2 +- 19 files changed, 47 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ae4978..2af1bd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [1.0.1+2] + +* update Xml package to 4.3.0 +* add comments + ## [1.0.1+1] * fix formatting diff --git a/README.md b/README.md index 90ab1b6..cec125c 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ In your dart/flutter project add the dependency: ``` dependencies: ... - gpx: ^1.0.1+1 + gpx: ^1.0.1+2 ``` ### Reading XML diff --git a/lib/src/gpx_reader.dart b/lib/src/gpx_reader.dart index 1990102..0d49e3a 100644 --- a/lib/src/gpx_reader.dart +++ b/lib/src/gpx_reader.dart @@ -19,6 +19,7 @@ class GpxReader { // // } + /// Parse xml string and create Gpx object Gpx fromString(String xml) { final iterator = parseEvents(xml).iterator; diff --git a/lib/src/gpx_writer.dart b/lib/src/gpx_writer.dart index dea4eb0..1ffe927 100644 --- a/lib/src/gpx_writer.dart +++ b/lib/src/gpx_writer.dart @@ -9,9 +9,11 @@ import 'model/trk.dart'; import 'model/wpt.dart'; class GpxWriter { + /// Convert Gpx into GPX XML (v1.1) as String String asString(Gpx gpx, {bool pretty = false}) => _build(gpx).toXmlString(pretty: pretty); + /// Convert Gpx into GPX XML (v1.1) as XmlNode XmlNode asXml(Gpx gpx) => _build(gpx); XmlNode _build(Gpx gpx) { diff --git a/lib/src/kml_writer.dart b/lib/src/kml_writer.dart index 617f7f8..398c083 100644 --- a/lib/src/kml_writer.dart +++ b/lib/src/kml_writer.dart @@ -10,9 +10,11 @@ import 'model/trk.dart'; import 'model/wpt.dart'; class KmlWriter { + /// Convert Gpx into KML as String String asString(Gpx gpx, {bool pretty = false}) => _build(gpx).toXmlString(pretty: pretty); + /// Convert Gpx into KML as XmlNode XmlNode asXml(Gpx gpx) => _build(gpx); XmlNode _build(Gpx gpx) { diff --git a/lib/src/model/bounds.dart b/lib/src/model/bounds.dart index 2fd5132..9219b97 100644 --- a/lib/src/model/bounds.dart +++ b/lib/src/model/bounds.dart @@ -1,11 +1,13 @@ import 'package:quiver/core.dart'; +/// Two lat/lon pairs defining the extent of an element. class Bounds { double minlat; double minlon; double maxlat; double maxlon; + /// Construct a new [Bounds] with rect [minlat, minlon, maxlat, maxlon]. Bounds( {this.minlat = 0.0, this.minlon = 0.0, diff --git a/lib/src/model/copyright.dart b/lib/src/model/copyright.dart index aab5a92..c80f980 100644 --- a/lib/src/model/copyright.dart +++ b/lib/src/model/copyright.dart @@ -1,10 +1,14 @@ import 'package:quiver/core.dart'; +/// Information about the copyright holder and any license governing use of this +/// file. By linking to an appropriate license, you may place your data into the +/// public domain or grant additional usage rights. class Copyright { String author = ''; int year; String license; + /// Construct a new [Copyright] with author, year and license. Copyright({this.author = '', this.year, this.license}); @override diff --git a/lib/src/model/email.dart b/lib/src/model/email.dart index 434a425..818cf6a 100644 --- a/lib/src/model/email.dart +++ b/lib/src/model/email.dart @@ -1,9 +1,12 @@ import 'package:quiver/core.dart'; +/// An email address. Broken into two parts (id and domain) to help prevent +/// email harvesting. class Email { String id; String domain; + /// Construct a new [Email] with id and domain. Email({this.id = '', this.domain = ''}); @override diff --git a/lib/src/model/gpx.dart b/lib/src/model/gpx.dart index 8b3c41c..c13861c 100644 --- a/lib/src/model/gpx.dart +++ b/lib/src/model/gpx.dart @@ -6,6 +6,9 @@ import 'rte.dart'; import 'trk.dart'; import 'wpt.dart'; +/// GPX documents contain a metadata header, followed by waypoints, routes, and +/// tracks. You can add your own elements to the extensions section of the GPX +/// document. class Gpx { String version = '1.1'; String creator = ''; diff --git a/lib/src/model/gpx_tag.dart b/lib/src/model/gpx_tag.dart index 13eca36..7c092b4 100644 --- a/lib/src/model/gpx_tag.dart +++ b/lib/src/model/gpx_tag.dart @@ -1,3 +1,4 @@ +/// GPX tags names. class GpxTagV11 { static const gpx = 'gpx'; static const version = 'version'; diff --git a/lib/src/model/kml_tag.dart b/lib/src/model/kml_tag.dart index ebf3eea..b6efe96 100644 --- a/lib/src/model/kml_tag.dart +++ b/lib/src/model/kml_tag.dart @@ -1,3 +1,4 @@ +/// KML tags names. class KmlTagV22 { static const kml = 'kml'; diff --git a/lib/src/model/link.dart b/lib/src/model/link.dart index 085d0b2..692d8aa 100644 --- a/lib/src/model/link.dart +++ b/lib/src/model/link.dart @@ -1,10 +1,13 @@ import 'package:quiver/core.dart'; +/// A link to an external resource (Web page, digital photo, video clip, etc) +/// with additional information. class Link { String href; String text; String type; + /// Construct a new [Link] object. Link({this.href = '', this.text, this.type}); @override diff --git a/lib/src/model/metadata.dart b/lib/src/model/metadata.dart index 28427dd..f662cfe 100644 --- a/lib/src/model/metadata.dart +++ b/lib/src/model/metadata.dart @@ -6,6 +6,9 @@ import 'copyright.dart'; import 'link.dart'; import 'person.dart'; +/// Information about the GPX file, author, and copyright restrictions goes in +/// the metadata section. Providing rich, meaningful information about your GPX +/// files allows others to search for and use your GPS data. class Metadata { String name; String desc; @@ -18,6 +21,7 @@ class Metadata { Map extensions = {}; + /// Construct a new [Metadata] object. Metadata( {this.name, this.desc, diff --git a/lib/src/model/person.dart b/lib/src/model/person.dart index 6f9ea84..07444a2 100644 --- a/lib/src/model/person.dart +++ b/lib/src/model/person.dart @@ -3,11 +3,13 @@ import 'package:quiver/core.dart'; import 'email.dart'; import 'link.dart'; +/// A person or organization. class Person { String name; Email email; Link link; + /// Construct a new [Person] object. Person({this.name, this.email, this.link}); @override diff --git a/lib/src/model/rte.dart b/lib/src/model/rte.dart index b27f56b..91197d3 100644 --- a/lib/src/model/rte.dart +++ b/lib/src/model/rte.dart @@ -4,6 +4,8 @@ import 'package:quiver/core.dart'; import 'link.dart'; import 'wpt.dart'; +/// Rte represents route - an ordered list of waypoints representing a series of +/// turn points leading to a destination. class Rte { String name; String cmt; @@ -17,6 +19,7 @@ class Rte { List rtepts; + /// Construct a new [Rte] object. Rte( {this.name, this.cmt, diff --git a/lib/src/model/trk.dart b/lib/src/model/trk.dart index ae79323..56bb56b 100644 --- a/lib/src/model/trk.dart +++ b/lib/src/model/trk.dart @@ -4,6 +4,7 @@ import 'package:quiver/core.dart'; import 'link.dart'; import 'trkseg.dart'; +/// Trk represents a track - an ordered list of points describing a path. class Trk { String name; String cmt; @@ -17,6 +18,7 @@ class Trk { List trksegs; + /// Construct a new [Trk] object. Trk( {this.name, this.cmt, diff --git a/lib/src/model/trkseg.dart b/lib/src/model/trkseg.dart index a19f021..1691d87 100644 --- a/lib/src/model/trkseg.dart +++ b/lib/src/model/trkseg.dart @@ -3,10 +3,15 @@ import 'package:quiver/core.dart'; import 'wpt.dart'; +/// A Track Segment holds a list of Track Points which are logically connected +/// in order. To represent a single GPS track where GPS reception was lost, or +/// the GPS receiver was turned off, start a new Track Segment for each +/// continuous span of track data. class Trkseg { List trkpts; Map extensions; + /// Construct a new [Trkseg] object. Trkseg({List trkpts, Map extensions}) : trkpts = trkpts ?? [], extensions = extensions ?? {}; diff --git a/lib/src/model/wpt.dart b/lib/src/model/wpt.dart index 8eba168..6c93633 100644 --- a/lib/src/model/wpt.dart +++ b/lib/src/model/wpt.dart @@ -5,6 +5,7 @@ import 'link.dart'; enum FixType { fix_2d, fix_3d, dgps, none, pps } +/// Wpt represents a waypoint, point of interest, or named feature on a map. class Wpt { double lat; double lon; @@ -29,6 +30,7 @@ class Wpt { Map extensions; + /// Construct a new [Wpt] object. Wpt( {this.lat = 0.0, this.lon = 0.0, diff --git a/pubspec.yaml b/pubspec.yaml index 6e8ae31..70cb9bd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: gpx description: Package for load, manipulate, and save GPS data in GPX format (a light-weight XML data format for the interchange of GPS data - waypoints, routes, and tracks). -version: 1.0.1+1 +version: 1.0.1+2 homepage: https://github.com/kb0/dart-gpx/ environment: