Skip to content

Commit c67d925

Browse files
More comment tidying
1 parent 3254bac commit c67d925

10 files changed

Lines changed: 63 additions & 74 deletions

File tree

src/GeoJSON.Net/CoordinateReferenceSystem/CRSBase.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,29 @@
22
// <copyright file="CRSBase.cs" company="Joerg Battermann">
33
// Copyright © Joerg Battermann 2014
44
// </copyright>
5-
// <summary>
6-
// Defines the CRSBase type.
7-
// </summary>
85
// --------------------------------------------------------------------------------------------------------------------
96

7+
using System;
108
using System.Collections.Generic;
119
using Newtonsoft.Json;
1210
using Newtonsoft.Json.Converters;
13-
using GeoJSON.Net.Converters;
14-
using System;
1511

1612
namespace GeoJSON.Net.CoordinateReferenceSystem
1713
{
1814
/// <summary>
19-
/// Base class for all IGeometryObject implementing types
15+
/// Base class for all IGeometryObject implementing types
2016
/// </summary>
2117
[JsonObject(MemberSerialization.OptIn)]
2218
public abstract class CRSBase : IEqualityComparer<CRSBase>, IEquatable<CRSBase>
2319
{
2420
/// <summary>
25-
/// Gets the properties.
21+
/// Gets the properties.
2622
/// </summary>
2723
[JsonProperty(PropertyName = "properties", Required = Required.Always)]
2824
public Dictionary<string, object> Properties { get; internal set; }
2925

3026
/// <summary>
31-
/// Gets the type of the GeometryObject object.
27+
/// Gets the type of the GeometryObject object.
3228
/// </summary>
3329
[JsonProperty(PropertyName = "type", Required = Required.Always)]
3430
[JsonConverter(typeof(StringEnumConverter))]
@@ -108,7 +104,7 @@ public bool Equals(CRSBase left, CRSBase right)
108104
{
109105
return false;
110106
}
111-
return left.Equals(right);
107+
return left != null && left.Equals(right);
112108
}
113109

114110
/// <summary>

src/GeoJSON.Net/CoordinateReferenceSystem/CRSType.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22
// <copyright file="CRSType.cs" company="Joerg Battermann">
33
// Copyright © Joerg Battermann 2014
44
// </copyright>
5-
// <summary>
6-
// Defines the GeoJSON Coordinate Reference System Objects (CRS) types originally defined in the <see cref="http://geojson.org/geojson-spec.html#coordinate-reference-system-objects">geojson.org v1.0 spec</see>.
7-
// The current spec <see cref="https://tools.ietf.org/html/rfc7946#section-4" removes the CRS type, but allows to be left in for backwards compatibility.
8-
// </summary>
95
// --------------------------------------------------------------------------------------------------------------------
106

117
using System.Runtime.Serialization;
128

139
namespace GeoJSON.Net.CoordinateReferenceSystem
1410
{
1511
/// <summary>
16-
/// Defines the GeoJSON Coordinate Reference System Objects (CRS) types as defined in the
12+
/// Defines the GeoJSON Coordinate Reference System Objects (CRS) types as originally defined in the geojson.org v1.0 spec
1713
/// </summary>
14+
/// <remarks>
15+
/// Originally defined http://geojson.org/geojson-spec.html#coordinate-reference-system-objects
16+
/// The current RFC removes the CRS type, but allows to be left in for backwards compatibility. See https://tools.ietf.org/html/rfc7946#section-4
17+
/// </remarks>
1818
public enum CRSType
1919
{
2020
/// <summary>
21-
/// Defines a CRS type where the CRS cannot be assumed
21+
/// Defines a CRS type where the CRS cannot be assumed
2222
/// </summary>
2323
[EnumMember(Value = "unspecified")]
2424
Unspecified,
2525

2626
/// <summary>
27-
/// Defines the Named CRS type.
27+
/// Defines the Named CRS type.
2828
/// </summary>
2929
[EnumMember(Value = "name")]
3030
Name,
3131

3232
/// <summary>
33-
/// Defines the Linked CRS type.
33+
/// Defines the Linked CRS type.
3434
/// </summary>
3535
[EnumMember(Value = "link")]
3636
Link

src/GeoJSON.Net/CoordinateReferenceSystem/DefaultCRS.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,35 @@
22
// <copyright file="GeometryCollection.cs" company="Joerg Battermann">
33
// Copyright © Joerg Battermann 2014
44
// </copyright>
5-
// <summary>
6-
// Defines the GeoJSON Coordinate Reference System Objects (CRS) types originally defined in the <see cref="http://geojson.org/geojson-spec.html#coordinate-reference-system-objects">geojson.org v1.0 spec</see>.
7-
// The current spec <see cref="https://tools.ietf.org/html/rfc7946#section-4" removes the CRS type, but allows to be left in for backwards compatibility.
8-
// </summary>
95
// --------------------------------------------------------------------------------------------------------------------
106

117
namespace GeoJSON.Net.CoordinateReferenceSystem
128
{
139
/// <summary>
14-
/// The default CRS is a geographic coordinate reference system,
15-
/// using the WGS84 datum, and with longitude and latitude units of decimal degrees.
16-
/// see https://tools.ietf.org/html/rfc7946#section-4
10+
/// The default CRS is a geographic coordinate reference system,
11+
/// using the WGS84 datum, and with longitude and latitude units of decimal degrees.
12+
/// see https://tools.ietf.org/html/rfc7946#section-4
1713
/// </summary>
14+
/// <remarks>
15+
/// Defines the GeoJSON Coordinate Reference System Objects (CRS) types originally defined in the geojson.org v1.0 spec
16+
/// see http://geojson.org/geojson-spec.html#coordinate-reference-system-objects.
17+
/// The current RFC removes the CRS type, but allows to be left in for backwards compatibility. See https://tools.ietf.org/html/rfc7946#section-4
18+
/// </remarks>
1819
public class DefaultCRS : NamedCRS
1920
{
2021
/// <summary>
21-
/// Initializes a new instance of the <see cref="DefaultCRS" /> class.
22+
/// Initializes a new instance of the <see cref="DefaultCRS" /> class.
2223
/// </summary>
2324
private DefaultCRS()
2425
: base("urn:ogc:def:crs:OGC::CRS84")
2526
{
2627
}
2728

2829
/// <summary>
29-
/// Gets the instance.
30+
/// Gets the instance.
3031
/// </summary>
3132
/// <value>
32-
/// The instance.
33+
/// The instance.
3334
/// </value>
3435
public static DefaultCRS Instance { get; } = new DefaultCRS();
3536
}

src/GeoJSON.Net/CoordinateReferenceSystem/ICRSObject.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// <copyright file="ICRSObject.cs" company="Joerg Battermann">
33
// Copyright © Joerg Battermann 2014
44
// </copyright>
5-
// <summary>
6-
// Base Interface for CRSBase Object types.
7-
// </summary>
85
// --------------------------------------------------------------------------------------------------------------------
96

107
namespace GeoJSON.Net.CoordinateReferenceSystem

src/GeoJSON.Net/CoordinateReferenceSystem/LinkedCRS.cs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
// <copyright file="LinkedCRS.cs" company="Joerg Battermann">
33
// Copyright © Joerg Battermann 2014
44
// </copyright>
5-
// <summary>
6-
// Defines the <see cref="http://geojson.org/geojson-spec.html#named-crs">Linked CRS type</see>.
7-
// The current spec <see cref="https://tools.ietf.org/html/rfc7946#section-4" removes the CRS type, but allows to be left in for backwards compatibility.
8-
// </summary>
95
// --------------------------------------------------------------------------------------------------------------------
106

117
using System;
@@ -14,18 +10,23 @@
1410
namespace GeoJSON.Net.CoordinateReferenceSystem
1511
{
1612
/// <summary>
17-
/// Defines the <see cref="http://geojson.org/geojson-spec.html#linked-crs">Linked CRS type</see>.
13+
/// Defines the Linked CRS type.
1814
/// </summary>
15+
/// <remarks>
16+
/// This was originally defined in the spec http://geojson.org/geojson-spec.html#named-crs
17+
/// The current RFC removes the CRS type, but allows to be left in for backwards compatibility.
18+
/// See https://tools.ietf.org/html/rfc7946#section-4
19+
/// </remarks>
1920
public class LinkedCRS : CRSBase, ICRSObject
2021
{
2122
/// <summary>
22-
/// Initializes a new instance of the <see cref="LinkedCRS" /> class.
23+
/// Initializes a new instance of the <see cref="LinkedCRS" /> class.
2324
/// </summary>
2425
/// <param name="href">
25-
/// The mandatory href member must be a dereferenceable URI.
26+
/// The mandatory href member must be a dereferenceable URI.
2627
/// </param>
2728
/// <param name="type">
28-
/// The optional type member will be put in the properties Dictionary
29+
/// The optional type member will be put in the properties Dictionary
2930
/// </param>
3031
public LinkedCRS(string href, string type = "")
3132
{
@@ -51,13 +52,13 @@ public LinkedCRS(string href, string type = "")
5152
}
5253

5354
/// <summary>
54-
/// Initializes a new instance of the <see cref="LinkedCRS" /> class.
55+
/// Initializes a new instance of the <see cref="LinkedCRS" /> class.
5556
/// </summary>
5657
/// <param name="href">
57-
/// The mandatory href member must be a dereferenceable URI.
58+
/// The mandatory href member must be a dereferenceable URI.
5859
/// </param>
5960
/// <param name="type">
60-
/// The optional type member will be put in the properties Dictionary
61+
/// The optional type member will be put in the properties Dictionary
6162
/// </param>
6263
public LinkedCRS(Uri href, string type = "") : this(href != null ? href.ToString() : null, type)
6364
{

src/GeoJSON.Net/CoordinateReferenceSystem/NamedCRS.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,28 @@
22
// <copyright file="NamedCRS.cs" company="Joerg Battermann">
33
// Copyright © Joerg Battermann 2014
44
// </copyright>
5-
// <summary>
6-
// Defines the <see cref="http://geojson.org/geojson-spec.html#named-crs">Named CRS type</see>.
7-
// The current spec <see cref="https://tools.ietf.org/html/rfc7946#section-4" removes the CRS type, but allows to be left in for backwards compatibility.
8-
// </summary>
95
// --------------------------------------------------------------------------------------------------------------------
106
using System;
117
using System.Collections.Generic;
128

139
namespace GeoJSON.Net.CoordinateReferenceSystem
1410
{
1511
/// <summary>
16-
/// Defines the Named CRS type.
12+
/// Defines the Named CRS type.
1713
/// </summary>
14+
/// <remarks>
15+
/// See http://geojson.org/geojson-spec.html#named-crs
16+
/// The current RFC removes the CRS type, but allows to be left in for backwards compatibility.
17+
/// See https://tools.ietf.org/html/rfc7946#section-4
18+
/// </remarks>
1819
public class NamedCRS : CRSBase, ICRSObject
1920
{
2021
/// <summary>
21-
/// Initializes a new instance of the <see cref="NamedCRS" /> class.
22+
/// Initializes a new instance of the <see cref="NamedCRS" /> class.
2223
/// </summary>
2324
/// <param name="name">
24-
/// The mandatory name member must be a string identifying a coordinate reference system. OGC CRS URNs such as
25-
/// 'urn:ogc:def:crs:OGC:1.3:CRS84' shall be preferred over legacy identifiers such as 'EPSG:4326'.
25+
/// The mandatory name member must be a string identifying a coordinate reference system. OGC CRS URNs such as
26+
/// 'urn:ogc:def:crs:OGC:1.3:CRS84' shall be preferred over legacy identifiers such as 'EPSG:4326'.
2627
/// </param>
2728
public NamedCRS(string name)
2829
{

src/GeoJSON.Net/CoordinateReferenceSystem/UnspecifiedCRS.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public bool Equals(ICRSObject obj)
5454
{
5555
return false;
5656
}
57-
return left.Equals(right);
57+
return left != null && left.Equals(right);
5858
}
5959

6060
/// <summary>

src/GeoJSON.Net/Exceptions/ParsingException.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// <copyright file="ParsingException.cs" company="Joerg Battermann">
33
// Copyright © Joerg Battermann 2014
44
// </copyright>
5-
// <summary>
6-
// Defines the ParsingException type.
7-
// </summary>
85
// --------------------------------------------------------------------------------------------------------------------
96

107
namespace GeoJSON.Net.Exceptions

src/GeoJSON.Net/Feature/Feature.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// <copyright file="Feature.cs" company="Joerg Battermann">
33
// Copyright © Joerg Battermann 2014
44
// </copyright>
5-
// <summary>
6-
// Defines the Feature type.
7-
// </summary>
85
// --------------------------------------------------------------------------------------------------------------------
96

107
using System.Collections.Generic;
@@ -18,12 +15,15 @@
1815
namespace GeoJSON.Net.Feature
1916
{
2017
/// <summary>
21-
/// A GeoJSON <see cref="https://tools.ietf.org/html/rfc7946#section-3.2">Feature Object</see>.
18+
/// A GeoJSON Feature Object.
2219
/// </summary>
20+
/// <remarks>
21+
/// See https://tools.ietf.org/html/rfc7946#section-3.2
22+
/// </remarks>
2323
public class Feature : GeoJSONObject, IEqualityComparer<Feature>, IEquatable<Feature>
2424
{
2525
/// <summary>
26-
/// Initializes a new instance of the <see cref="Feature" /> class.
26+
/// Initializes a new instance of the <see cref="Feature" /> class.
2727
/// </summary>
2828
/// <param name="geometry">The Geometry Object.</param>
2929
/// <param name="properties">The properties.</param>
@@ -39,12 +39,12 @@ public Feature(IGeometryObject geometry, Dictionary<string, object> properties =
3939
}
4040

4141
/// <summary>
42-
/// Initializes a new instance of the <see cref="Feature" /> class.
42+
/// Initializes a new instance of the <see cref="Feature" /> class.
4343
/// </summary>
4444
/// <param name="geometry">The Geometry Object.</param>
4545
/// <param name="properties">
46-
/// Class used to fill feature properties. Any public member will be added to feature
47-
/// properties
46+
/// Class used to fill feature properties. Any public member will be added to feature
47+
/// properties
4848
/// </param>
4949
/// <param name="id">The (optional) identifier.</param>
5050
public Feature(IGeometryObject geometry, object properties, string id = null)
@@ -67,10 +67,10 @@ public Feature(IGeometryObject geometry, object properties, string id = null)
6767
}
6868

6969
/// <summary>
70-
/// Gets or sets the geometry.
70+
/// Gets or sets the geometry.
7171
/// </summary>
7272
/// <value>
73-
/// The geometry.
73+
/// The geometry.
7474
/// </value>
7575
[JsonProperty(PropertyName = "geometry", Required = Required.AllowNull)]
7676
[JsonConverter(typeof(GeometryConverter))]
@@ -84,7 +84,7 @@ public Feature(IGeometryObject geometry, object properties, string id = null)
8484
public string Id { get; set; }
8585

8686
/// <summary>
87-
/// Gets the properties.
87+
/// Gets the properties.
8888
/// </summary>
8989
/// <value>The properties.</value>
9090
[JsonProperty(PropertyName = "properties", Required = Required.AllowNull)]

src/GeoJSON.Net/Feature/FeatureCollection.cs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// <copyright file="FeatureCollection.cs" company="Joerg Battermann">
33
// Copyright © Joerg Battermann 2014
44
// </copyright>
5-
// <summary>
6-
// Defines the FeatureCollection type.
7-
// </summary>
85
// --------------------------------------------------------------------------------------------------------------------
96

107
using System;
@@ -15,34 +12,34 @@
1512
namespace GeoJSON.Net.Feature
1613
{
1714
/// <summary>
18-
/// Defines the FeatureCollection type.
15+
/// Defines the FeatureCollection type.
1916
/// </summary>
2017
public class FeatureCollection : GeoJSONObject, IEqualityComparer<FeatureCollection>, IEquatable<FeatureCollection>
2118
{
2219
/// <summary>
23-
/// Initializes a new instance of the <see cref="FeatureCollection" /> class.
20+
/// Initializes a new instance of the <see cref="FeatureCollection" /> class.
2421
/// </summary>
2522
public FeatureCollection() : this(new List<Feature>())
2623
{
2724
}
2825

2926
/// <summary>
30-
/// Initializes a new instance of the <see cref="FeatureCollection" /> class.
27+
/// Initializes a new instance of the <see cref="FeatureCollection" /> class.
3128
/// </summary>
3229
/// <param name="features">The features.</param>
3330
public FeatureCollection(List<Feature> features)
3431
{
3532
if (features == null)
3633
{
37-
throw new ArgumentNullException("features");
34+
throw new ArgumentNullException(nameof(features));
3835
}
3936

4037
Features = features;
4138
Type = GeoJSONObjectType.FeatureCollection;
4239
}
4340

4441
/// <summary>
45-
/// Gets the features.
42+
/// Gets the features.
4643
/// </summary>
4744
/// <value>The features.</value>
4845
[JsonProperty(PropertyName = "features", Required = Required.Always)]
@@ -91,7 +88,7 @@ public bool Equals(FeatureCollection left, FeatureCollection right)
9188
{
9289
return false;
9390
}
94-
return left.Equals(right);
91+
return left != null && left.Equals(right);
9592
}
9693

9794
/// <summary>
@@ -124,6 +121,5 @@ public int GetHashCode(FeatureCollection other)
124121
}
125122

126123
#endregion
127-
128124
}
129125
}

0 commit comments

Comments
 (0)