public void CovertTwoWays_OnlyOnePoint_ShouldBeTheSame() { GpxFile gpx = new GpxFile(); gpx.Waypoints.Add(new GpxWaypoint(new GpxLongitude(1), new GpxLatitude(2), 3)); var featureCollection = _gpxGeoJsonConverter.ToGeoJson(gpx); var newGpx = _gpxGeoJsonConverter.ToGpx(featureCollection); Assert.AreEqual(gpx.Waypoints.Count, newGpx.Waypoints.Count); Assert.AreEqual(gpx.Waypoints[0].Name, newGpx.Waypoints[0].Name); Assert.AreEqual(gpx.Waypoints[0].ElevationInMeters, newGpx.Waypoints[0].ElevationInMeters); Assert.AreEqual(gpx.Waypoints[0].Latitude, newGpx.Waypoints[0].Latitude); Assert.AreEqual(gpx.Waypoints[0].Longitude, newGpx.Waypoints[0].Longitude); }
public void CovertTwoWays_OnlyOnePoint_ShouldBeTheSame() { gpxType gpx = new gpxType { wpt = new[] { new wptType { lat = 1, lon = 2, ele = 3, eleSpecified = true } } }; var featureCollection = _gpxGeoJsonConverter.ToGeoJson(gpx); var newGpx = _gpxGeoJsonConverter.ToGpx(featureCollection); Assert.AreEqual(gpx.wpt.Length, newGpx.wpt.Length); Assert.AreEqual(gpx.wpt[0].name, newGpx.wpt[0].name); Assert.AreEqual(gpx.wpt[0].ele, newGpx.wpt[0].ele); Assert.AreEqual(gpx.wpt[0].lat, newGpx.wpt[0].lat); Assert.AreEqual(gpx.wpt[0].lon, newGpx.wpt[0].lon); }
///<inheritdoc /> public byte[] Transform(byte[] content) { return(_gpxGeoJsonConverter.ToGpx(content.ToFeatureCollection()).ToBytes()); }