Skip to content

Commit

Permalink
Updated packages. (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgernand authored Jun 7, 2022
1 parent 39583b1 commit 0460fd4
Show file tree
Hide file tree
Showing 38 changed files with 54 additions and 64 deletions.
2 changes: 1 addition & 1 deletion src/Fluxera.Spatial.JsonNet/Fluxera.Spatial.JsonNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.10.1">
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
8 changes: 4 additions & 4 deletions src/Fluxera.Spatial.JsonNet/GeometryCollectionConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ public override GeometryCollection ReadJson(JsonReader reader, Type objectType,

if(item.ContainsKey("type"))
{
string type = item["type"]!.Value<string>()!;
string type = item["type"].Value<string>();
if(type == "GeometryCollection")
{
if(item.ContainsKey("geometries"))
{
JToken geometriesToken = item["geometries"]!;
JToken geometriesToken = item["geometries"];
if(geometriesToken.Type == JTokenType.Array)
{
JArray geometriesArray = (JArray)geometriesToken;

IList<IGeometry> geometries = new List<IGeometry>();
foreach(JToken token in geometriesArray)
{
string geometryTypeName = token["type"]!.Value<string>()!;
string geometryTypeName = token["type"].Value<string>();

Type geometryType = geometryTypeName switch
{
Expand All @@ -71,7 +71,7 @@ public override GeometryCollection ReadJson(JsonReader reader, Type objectType,
_ => throw new ArgumentOutOfRangeException()
};

object geometry = serializer.Deserialize(token.CreateReader(), geometryType)!;
object geometry = serializer.Deserialize(token.CreateReader(), geometryType);
geometries.Add((IGeometry)geometry);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Fluxera.Spatial.JsonNet/LineStringConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public override LineString ReadJson(JsonReader reader, Type objectType, LineStri

if(item.ContainsKey("type"))
{
string type = item["type"]!.Value<string>()!;
string type = item["type"].Value<string>();
if(type == "LineString")
{
if(item.ContainsKey("coordinates"))
{
JToken jToken = item["coordinates"]!;
JToken jToken = item["coordinates"];
if(jToken.Type == JTokenType.Array)
{
JArray jArray = (JArray)jToken;
Expand Down
4 changes: 2 additions & 2 deletions src/Fluxera.Spatial.JsonNet/MultiLineStringConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ public override MultiLineString ReadJson(JsonReader reader, Type objectType, Mul

if(item.ContainsKey("type"))
{
string type = item["type"]!.Value<string>()!;
string type = item["type"].Value<string>();
if(type == "MultiLineString")
{
if(item.ContainsKey("coordinates"))
{
JToken jToken = item["coordinates"]!;
JToken jToken = item["coordinates"];
if(jToken.Type == JTokenType.Array)
{
JArray outerArray = (JArray)jToken;
Expand Down
4 changes: 2 additions & 2 deletions src/Fluxera.Spatial.JsonNet/MultiPointConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public override MultiPoint ReadJson(JsonReader reader, Type objectType, MultiPoi

if(item.ContainsKey("type"))
{
string type = item["type"]!.Value<string>()!;
string type = item["type"].Value<string>();
if(type == "MultiPoint")
{
if(item.ContainsKey("coordinates"))
{
JToken coordinatesToken = item["coordinates"]!;
JToken coordinatesToken = item["coordinates"];
if(coordinatesToken.Type == JTokenType.Array)
{
JArray positionsArray = (JArray)coordinatesToken;
Expand Down
4 changes: 2 additions & 2 deletions src/Fluxera.Spatial.JsonNet/MultiPolygonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ public override MultiPolygon ReadJson(JsonReader reader, Type objectType, MultiP

if(item.ContainsKey("type"))
{
string type = item["type"]!.Value<string>()!;
string type = item["type"].Value<string>();
if(type == "MultiPolygon")
{
if(item.ContainsKey("coordinates"))
{
JToken coordinatesToken = item["coordinates"]!;
JToken coordinatesToken = item["coordinates"];
if(coordinatesToken.Type == JTokenType.Array)
{
JArray coordinatesArray = (JArray)coordinatesToken;
Expand Down
4 changes: 2 additions & 2 deletions src/Fluxera.Spatial.JsonNet/PointConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ public override Point ReadJson(JsonReader reader, Type objectType, Point existin

if(item.ContainsKey("type"))
{
string type = item["type"]!.Value<string>()!;
string type = item["type"].Value<string>();
if(type == "Point")
{
if(item.ContainsKey("coordinates"))
{
JToken coordinates = item["coordinates"]!;
JToken coordinates = item["coordinates"];

Position position = coordinates.CreateReader().ReadPosition();
return new Point(position);
Expand Down
4 changes: 2 additions & 2 deletions src/Fluxera.Spatial.JsonNet/PolygonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ public override Polygon ReadJson(JsonReader reader, Type objectType, Polygon exi

if(item.ContainsKey("type"))
{
string type = item["type"]!.Value<string>()!;
string type = item["type"].Value<string>();
if(type == "Polygon")
{
if(item.ContainsKey("coordinates"))
{
JToken jToken = item["coordinates"]!;
JToken jToken = item["coordinates"];
if(jToken.Type == JTokenType.Array)
{
JArray outerArray = (JArray)jToken;
Expand Down
2 changes: 1 addition & 1 deletion src/Fluxera.Spatial.LiteDB/Fluxera.Spatial.LiteDB.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.10.1">
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions src/Fluxera.Spatial.MongoDB/Fluxera.Spatial.MongoDB.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.10.1">
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JetBrains.Annotations" Version="2022.1.0" />
<PackageReference Include="MongoDB.Driver" Version="2.15.1" />
<PackageReference Include="MongoDB.Driver" Version="2.16.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.10.1">
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ public override GeometryCollection Read(ref Utf8JsonReader reader, Type typeToCo

while(reader.Read() && reader.TokenType != JsonTokenType.EndObject)
{
string propertyName = reader.GetString()!;
string propertyName = reader.GetString();

reader.Read();
if(propertyName == "type")
{
type = reader.GetString()!;
type = reader.GetString();
}
else if(propertyName == "geometries")
{
while(reader.Read() && reader.TokenType != JsonTokenType.EndArray)
{
JsonObject jObject = JsonSerializer.Deserialize<JsonObject>(ref reader, options)!;
string geometryTypeName = jObject["type"]!.GetValue<string>();
JsonObject jObject = JsonSerializer.Deserialize<JsonObject>(ref reader, options);
string geometryTypeName = jObject["type"].GetValue<string>();

Type geometryType = geometryTypeName switch
{
Expand All @@ -72,7 +72,7 @@ public override GeometryCollection Read(ref Utf8JsonReader reader, Type typeToCo
_ => throw new ArgumentOutOfRangeException()
};

object geometry = jObject.Deserialize(geometryType, options)!;
object geometry = jObject.Deserialize(geometryType, options);
geometries.Add((IGeometry)geometry);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Fluxera.Spatial.SystemTextJson/LineStringConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ public override LineString Read(ref Utf8JsonReader reader, Type typeToConvert, J

while(reader.Read() && reader.TokenType != JsonTokenType.EndObject)
{
string propertyName = reader.GetString()!;
string propertyName = reader.GetString();

reader.Read();
if(propertyName == "type")
{
type = reader.GetString()!;
type = reader.GetString();
}
else if(propertyName == "coordinates")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ public override MultiLineString Read(ref Utf8JsonReader reader, Type typeToConve

while(reader.Read() && reader.TokenType != JsonTokenType.EndObject)
{
string propertyName = reader.GetString()!;
string propertyName = reader.GetString();

reader.Read();
if(propertyName == "type")
{
type = reader.GetString()!;
type = reader.GetString();
}
else if(propertyName == "coordinates")
{
Expand Down
4 changes: 2 additions & 2 deletions src/Fluxera.Spatial.SystemTextJson/MultiPointConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ public override MultiPoint Read(ref Utf8JsonReader reader, Type typeToConvert, J

while(reader.Read() && reader.TokenType != JsonTokenType.EndObject)
{
string propertyName = reader.GetString()!;
string propertyName = reader.GetString();

reader.Read();
if(propertyName == "type")
{
type = reader.GetString()!;
type = reader.GetString();
}
else if(propertyName == "coordinates")
{
Expand Down
4 changes: 2 additions & 2 deletions src/Fluxera.Spatial.SystemTextJson/MultiPolygonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ public override MultiPolygon Read(ref Utf8JsonReader reader, Type typeToConvert,

while(reader.Read() && reader.TokenType != JsonTokenType.EndObject)
{
string propertyName = reader.GetString()!;
string propertyName = reader.GetString();

reader.Read();
if(propertyName == "type")
{
type = reader.GetString()!;
type = reader.GetString();
}
else if(propertyName == "coordinates")
{
Expand Down
4 changes: 2 additions & 2 deletions src/Fluxera.Spatial.SystemTextJson/PointConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ public override Point Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSe

while(reader.Read() && reader.TokenType != JsonTokenType.EndObject)
{
string propertyName = reader.GetString()!;
string propertyName = reader.GetString();

reader.Read();
if(propertyName == "type")
{
type = reader.GetString()!;
type = reader.GetString();
}
else if(propertyName == "coordinates")
{
Expand Down
4 changes: 2 additions & 2 deletions src/Fluxera.Spatial.SystemTextJson/PolygonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ public override Polygon Read(ref Utf8JsonReader reader, Type typeToConvert, Json

while(reader.Read() && reader.TokenType != JsonTokenType.EndObject)
{
string propertyName = reader.GetString()!;
string propertyName = reader.GetString();

reader.Read();
if(propertyName == "type")
{
type = reader.GetString()!;
type = reader.GetString();
}
else if(propertyName == "coordinates")
{
Expand Down
4 changes: 2 additions & 2 deletions src/Fluxera.Spatial/Fluxera.Spatial.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Fluxera.Guards" Version="6.0.22" />
<PackageReference Include="GitVersion.MsBuild" Version="5.10.1">
<PackageReference Include="Fluxera.Guards" Version="6.1.0" />
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion src/Fluxera.Spatial/Geometry/GeometryCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public override bool Equals(object obj)
/// <inheritdoc />
public override int GetHashCode()
{
int hashCode = base.GetHashCode();
int hashCode = 17;

foreach(IGeometry geometryObject in this.Geometries)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Fluxera.Spatial/Geometry/LineString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public override bool Equals(object obj)
/// <inheritdoc />
public override int GetHashCode()
{
int hashCode = base.GetHashCode();
int hashCode = 17;

foreach(Position position in this.Coordinates)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Fluxera.Spatial/Geometry/MultiLineString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public override bool Equals(object obj)
/// <inheritdoc />
public override int GetHashCode()
{
int hashCode = base.GetHashCode();
int hashCode = 17;

foreach(LineString lineString in this.Coordinates)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Fluxera.Spatial/Geometry/MultiPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public override bool Equals(object obj)
/// <inheritdoc />
public override int GetHashCode()
{
int hashCode = base.GetHashCode();
int hashCode = 17;

foreach(Position position in this.Coordinates)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Fluxera.Spatial/Geometry/MultiPolygon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public override bool Equals(object obj)
/// <inheritdoc />
public override int GetHashCode()
{
int hashCode = base.GetHashCode();
int hashCode = 17;

foreach(Polygon polygon in this.Coordinates)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Fluxera.Spatial/Geometry/Polygon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public override bool Equals(object obj)
/// <inheritdoc />
public override int GetHashCode()
{
int hashCode = base.GetHashCode();
int hashCode = 17;

foreach(LineString lineString in this.Coordinates)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected override void OnSetup()
/// <inheritdoc />
protected override GeometryCollection Deserialize(string jsonName)
{
return JsonConvert.DeserializeObject<GeometryCollection>(this.GetJson(jsonName))!;
return JsonConvert.DeserializeObject<GeometryCollection>(this.GetJson(jsonName));
}

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected override void OnSetup()
/// <inheritdoc />
protected override LineString Deserialize(string jsonName)
{
return JsonConvert.DeserializeObject<LineString>(this.GetJson(jsonName))!;
return JsonConvert.DeserializeObject<LineString>(this.GetJson(jsonName));
}

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected override void OnSetup()
/// <inheritdoc />
protected override MultiLineString Deserialize(string jsonName)
{
return JsonConvert.DeserializeObject<MultiLineString>(this.GetJson(jsonName))!;
return JsonConvert.DeserializeObject<MultiLineString>(this.GetJson(jsonName));
}

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected override void OnSetup()
/// <inheritdoc />
protected override MultiPoint Deserialize(string jsonName)
{
return JsonConvert.DeserializeObject<MultiPoint>(this.GetJson(jsonName))!;
return JsonConvert.DeserializeObject<MultiPoint>(this.GetJson(jsonName));
}

/// <inheritdoc />
Expand Down
Loading

0 comments on commit 0460fd4

Please sign in to comment.