diff --git a/README.md b/README.md
index 2667bd2..cfeb781 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-[](https://github.com/GeoJSON-Net/GeoJSON.Text/actions/workflows/ci-build.yml) [](https://codecov.io/gh/GeoJSON-Net/GeoJSON.Text)
+[](https://www.nuget.org/packages/GeoJSON.Text/) [](https://github.com/GeoJSON-Net/GeoJSON.Text/actions/workflows/ci-build.yml) [](https://codecov.io/gh/GeoJSON-Net/GeoJSON.Text)
# GeoJSON.Text
GeoJSON.Text is a .NET library for the [RFC 7946 The GeoJSON Format](https://tools.ietf.org/html/rfc7946) and it uses and provides [System.Text.Json](https://docs.microsoft.com/en-us/dotnet/api/system.text.json?view=net-6.0) converters for serialization and deserialization of GeoJSON data.
diff --git a/src/GeoJSON.Text.Test.Unit/GeoJSON.Text.Test.Unit.csproj b/src/GeoJSON.Text.Test.Unit/GeoJSON.Text.Test.Unit.csproj
index 8b52673..af09af1 100644
--- a/src/GeoJSON.Text.Test.Unit/GeoJSON.Text.Test.Unit.csproj
+++ b/src/GeoJSON.Text.Test.Unit/GeoJSON.Text.Test.Unit.csproj
@@ -22,6 +22,9 @@
+
+
+
@@ -48,6 +51,8 @@
+
+
@@ -76,6 +81,9 @@
+
+
+
Always
diff --git a/src/GeoJSON.Text.Test.Unit/Geometry/LineStringTests.cs b/src/GeoJSON.Text.Test.Unit/Geometry/LineStringTests.cs
index 0f77d8a..63d9b56 100644
--- a/src/GeoJSON.Text.Test.Unit/Geometry/LineStringTests.cs
+++ b/src/GeoJSON.Text.Test.Unit/Geometry/LineStringTests.cs
@@ -83,6 +83,83 @@ public void Can_Deserialize()
Assert.AreEqual(expectedLineString.Coordinates[0].Longitude, actualLineString.Coordinates[0].Longitude);
}
+ [Test]
+ public void Can_Deserialize_Strings()
+ {
+ var coordinates = new List
+ {
+ new Position(52.370725881211314, 4.889259338378906),
+ new Position(52.3711451105601, 4.895267486572266),
+ new Position(52.36931095278263, 4.892091751098633),
+ new Position(52.370725881211314, 4.889259338378906)
+ };
+
+ var expectedLineString = new LineString(coordinates);
+
+ var json = GetExpectedJson();
+ var options = new JsonSerializerOptions { NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString };
+ var actualLineString = JsonSerializer.Deserialize(json, options);
+
+ Assert.AreEqual(expectedLineString, actualLineString);
+
+ Assert.AreEqual(4, actualLineString.Coordinates.Count);
+ Assert.AreEqual(expectedLineString.Coordinates[0].Latitude, actualLineString.Coordinates[0].Latitude);
+ Assert.AreEqual(expectedLineString.Coordinates[0].Longitude, actualLineString.Coordinates[0].Longitude);
+ }
+
+ [Test]
+ public void Can_Deserialize_With_Altitude()
+ {
+ var coordinates = new List
+ {
+ new Position(52.370725881211314, 4.889259338378906, 10.0),
+ new Position(52.3711451105601, 4.895267486572266, 10.5),
+ new Position(52.36931095278263, 4.892091751098633, null),
+ new Position(52.370725881211314, 4.889259338378906, 10.2)
+ };
+
+ var expectedLineString = new LineString(coordinates);
+
+ var json = GetExpectedJson();
+ var actualLineString = JsonSerializer.Deserialize(json);
+
+ Assert.AreEqual(expectedLineString, actualLineString);
+
+ Assert.AreEqual(4, actualLineString.Coordinates.Count);
+ Assert.AreEqual(expectedLineString.Coordinates[0].Latitude, actualLineString.Coordinates[0].Latitude);
+ Assert.AreEqual(expectedLineString.Coordinates[0].Longitude, actualLineString.Coordinates[0].Longitude);
+ Assert.AreEqual(expectedLineString.Coordinates[0].Altitude, actualLineString.Coordinates[0].Altitude);
+ Assert.AreEqual(expectedLineString.Coordinates[2].Altitude, actualLineString.Coordinates[2].Altitude);
+ }
+
+ [Test]
+ public void Can_Deserialize_String_Literals()
+ {
+ var coordinates = new List
+ {
+ new Position(52.370725881211314, 4.889259338378906, double.NegativeInfinity),
+ new Position(52.3711451105601, 4.895267486572266, double.PositiveInfinity),
+ new Position(52.36931095278263, 4.892091751098633, double.NaN),
+ new Position(52.370725881211314, 4.889259338378906, double.NegativeInfinity)
+ };
+
+ var expectedLineString = new LineString(coordinates);
+
+ var json = GetExpectedJson();
+ var options = new JsonSerializerOptions { NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowNamedFloatingPointLiterals };
+ var actualLineString = JsonSerializer.Deserialize(json, options);
+
+ bool b = expectedLineString.Coordinates[0].Equals(actualLineString.Coordinates[0]);
+ Assert.AreEqual(expectedLineString, actualLineString);
+
+ Assert.AreEqual(4, actualLineString.Coordinates.Count);
+ Assert.AreEqual(expectedLineString.Coordinates[0].Latitude, actualLineString.Coordinates[0].Latitude);
+ Assert.AreEqual(expectedLineString.Coordinates[0].Longitude, actualLineString.Coordinates[0].Longitude);
+ Assert.AreEqual(expectedLineString.Coordinates[0].Altitude, actualLineString.Coordinates[0].Altitude);
+ Assert.AreEqual(expectedLineString.Coordinates[1].Altitude, actualLineString.Coordinates[1].Altitude);
+ Assert.AreEqual(expectedLineString.Coordinates[2].Altitude, actualLineString.Coordinates[2].Altitude);
+ }
+
[Test]
public void Constructor_No_Coordinates_Throws_Exception()
{
diff --git a/src/GeoJSON.Text.Test.Unit/Geometry/LineStringTests_Can_Deserialize_String_Literals.json b/src/GeoJSON.Text.Test.Unit/Geometry/LineStringTests_Can_Deserialize_String_Literals.json
new file mode 100644
index 0000000..594d58f
--- /dev/null
+++ b/src/GeoJSON.Text.Test.Unit/Geometry/LineStringTests_Can_Deserialize_String_Literals.json
@@ -0,0 +1,9 @@
+{
+ "coordinates": [
+ [4.8892593383789062, 52.370725881211314, "-Infinity"],
+ [4.8952674865722656, 52.3711451105601, "Infinity"],
+ [4.8920917510986328, 52.369310952782627, "NaN"],
+ [4.8892593383789062, 52.370725881211314, "-Infinity"]
+ ],
+ "type": "LineString"
+}
\ No newline at end of file
diff --git a/src/GeoJSON.Text.Test.Unit/Geometry/LineStringTests_Can_Deserialize_Strings.json b/src/GeoJSON.Text.Test.Unit/Geometry/LineStringTests_Can_Deserialize_Strings.json
new file mode 100644
index 0000000..7c5a502
--- /dev/null
+++ b/src/GeoJSON.Text.Test.Unit/Geometry/LineStringTests_Can_Deserialize_Strings.json
@@ -0,0 +1,9 @@
+{
+ "coordinates": [
+ ["4.8892593383789062", "52.370725881211314"],
+ ["4.8952674865722656", "52.3711451105601"],
+ ["4.8920917510986328", "52.369310952782627"],
+ ["4.8892593383789062", "52.370725881211314"]
+ ],
+ "type": "LineString"
+}
\ No newline at end of file
diff --git a/src/GeoJSON.Text.Test.Unit/Geometry/LineStringTests_Can_Deserialize_With_Altitude.json b/src/GeoJSON.Text.Test.Unit/Geometry/LineStringTests_Can_Deserialize_With_Altitude.json
new file mode 100644
index 0000000..f0ed4f0
--- /dev/null
+++ b/src/GeoJSON.Text.Test.Unit/Geometry/LineStringTests_Can_Deserialize_With_Altitude.json
@@ -0,0 +1,9 @@
+{
+ "coordinates": [
+ [4.8892593383789062, 52.370725881211314, 10.0],
+ [4.8952674865722656, 52.3711451105601, 10.5],
+ [4.8920917510986328, 52.369310952782627, null],
+ [4.8892593383789062, 52.370725881211314, 10.2]
+ ],
+ "type": "LineString"
+}
\ No newline at end of file
diff --git a/src/GeoJSON.Text/Converters/CrsConverter.cs b/src/GeoJSON.Text/Converters/CrsConverter.cs
index 5fadd87..d4d8674 100644
--- a/src/GeoJSON.Text/Converters/CrsConverter.cs
+++ b/src/GeoJSON.Text/Converters/CrsConverter.cs
@@ -10,7 +10,7 @@ namespace GeoJSON.Text.Converters
///
/// Converts types to and from JSON.
///
- public class CrsConverter : JsonConverter