GpxReaderwill now throw anXmlExceptionwhen it encounters an unexpected top-level child element of the rootgpxelement, instead of running into an infinite loop (#41).- "Unexpected top-level child elements" are elements whose names we do not recognize,
metadataorextensionsshowing up more than once, or themetadataelement showing up somewhere after the first child element.
- "Unexpected top-level child elements" are elements whose names we do not recognize,
GpxReaderSettingsnow has anIgnoreUnexpectedChildrenOfTopLevelElementproperty to use to ignore those elements instead of throwingXmlException.
- Allow specifying arbitrary namespaces (+prefixes) on the root element so that they don't have to be repeated on every
extensionselement (#36). - Add opt-in support in
GpxWebLinkfor URI strings longer than 65519 characters, as a workaround for dotnet/runtime#1875 (#39).- If upstream relaxes this restriction in a later release, then this code will automatically "upgrade" to fully support the new higher restriction.
- Updates to make this compatible with v2 of the core NTS library.
- Mark upper-bounds on package dependencies to make it clear that this only supports the 1.x series.
GpxWriterSettings.TimeZoneInfois no longer completely ignored (#30).- Fix an issue where written timestamps were being rounded to the nearest second instead of preserving as many significant digits as
DateTimeallows (#31). - Tweak the settings used for
GpxFile.BuildStringto avoid repeating thexmlnsdeclaration for extensions that are declared in the standard GPX namespace (#33).
GpxReaderSettingsnow has anIgnoreBadDateTimeproperty to use for ignoring a timestamp value that we cannot parse as an instance of theDateTimestruct, to work around a0000-00-00T00:00:00Zcoming from CompeGPS (#29).- Update referenced packages to latest revisions.
- The opt-in
GpxReaderSettings.AllowMissingVersionAttributeproperty added in 0.3.1 has been replaced byIgnoreVersionAttribute, which enables the same situations asAllowMissingVersionAttributedid, plus situations whereversionwas specified as something other thanversion='1.1'(#28).
GpxReaderSettingsnow has an opt-inAllowMissingVersionAttributeproperty, to allow reading files without aversionattribute (#27).
GpxReaderSettingsnow has aDefaultCreatorIfMissingproperty to use for filling in a missingGpxMetadata.Creatorvalue, to help read values saved from legacy versions of IHM (#23).- Custom
GpxExtensionReaderandGpxExtensionWritersubclasses can now override just one method if there's a common way to handle extensions regardless of where they show up (#26). - All immutable data model types now override
Equals(object)andGetHashCode()to have "value" semantics (#9).- Mutable types, such as
GpxFile, do not do this, for your own safety. - In all lists, including lists of web links, ordering matters. [A, B] is not considered equal to [B, A].
Extensionsvalues are considered for equality.- If you do not use a custom
GpxExtensionReaderfor extensions, or if yours always returnsImmutableXElementContainer, then this should work like you would expect it to work. - Otherwise, whenever you return non-
null, it is your responsibility to make sure that the result'sEquals(object)andGetHashCode()semantics match what you want the container's semantics to be.
- If you do not use a custom
- Mutable types, such as
GpxWebLinknow has a constructor that accepts just the value forHref, since that's the only required value.GpxLongitudeno longer permits +180 as a legal value, in keeping with the GPX 1.1 schema. (#25).- Converting from NTS features will automatically replace +180 with the equivalent -180.
GpxLongitude,GpxLatitude,GpxDegrees, andGpxDgpsStationIdnow all have staticMinValueandMaxValuefields to get the smallest and largest legal values.GpxBoundsnow has a shortcut for getting the a value that covers the entire WGS-84 ellipsoid.GpxWaypointnow has a constructor that accepts aGeoAPI.Geometries.Coordinateinstance, for convenience (#20).GpxWaypointconstructors and helper method now both reject infinite values ofelevationInMeters(#24).GpxWaypointconstructors and helper methods now throwArgumentOutOfRangeExceptioninstead ofArgumentExceptionin situations where the former is more appropriate.- Trying to set
GpxFile.Metadatatonullnow throwsArgumentNullExceptionright away (#21). - Add methods on
GpxFileto allow converting to / from string, for convenience (#19).
- Add a default constructor for
GpxTrackSegmentso that its.WithXmethods are actually meaningful (#22).
- Give most data objects constructors and
.WithXmethods to make it easier to create instances that only set a few members (#13). - Add
GpxFileas a significantly easier way to read + write our underlying data object representation all in one go (#12 / #14). - Make
NetTopologySuiteFeatureBuilderGpxVisitorinternal, since it's really just an implementation detail. - Some more appropriate early
nullhandling in miscellaneous places across-the-board. - Default time zone is now UTC instead of local, since the documentation indicates that this is the convention.
- Reorder some data members (both in constructors and
.ToString()overrides) according to XSD order. - Remove the awkward
GpxReader.ReadFeaturesoverload that took inNetTopologySuiteFeatureBuilderGpxVisitor. - Fix an off-by-one issue that would cause features to get skipped over when not separated by whitespace. (#18).
- Fix an issue where values very close to zero would be written in scientific notation, violating the GPX spec. (#15).
- Add some more
ToString()overrides GpxWaypointconstructor parameters reordered to match the order of the elements that the XSD schema requiresImmutableGpxWaypointTablenow throwsArgumentExceptionif it encounters anullwaypoint.- Rename
GpxMetadata.CreationTimetoGpxMetadata.CreationTimeUtcand validate that it is, in fact, marked as UTC (when specified at all). - xmldoc (#6)
- No longer exposing save / load methods on individual data elements.
- Fix a copy-paste error in
GpxTrack(#11)
- Initial release.