Skip to content

Commit 84050f4

Browse files
author
Jörg Battermann
committed
features are done
1 parent f90a2fa commit 84050f4

2 files changed

Lines changed: 34 additions & 11 deletions

File tree

src/GeoJSON.Net/Feature/Feature.cs

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,39 @@ namespace GeoJSON.Net.Feature
1717
using Newtonsoft.Json;
1818

1919
/// <summary>
20-
/// The Features endpoint provides details for all SimpleGeo features.
20+
/// A GeoJSON <see cref="http://geojson.org/geojson-spec.html#feature-objects">Feature Object</see>.
2121
/// </summary>
22-
/// <seealso cref="http://simplegeo.com/docs/getting-started/simplegeo-101#feature"/>
23-
/// <seealso cref="http://simplegeo.com/docs/api-endpoints/simplegeo-features"/>
24-
/// <seealso cref="http://developers.simplegeo.com/blog/2010/12/08/simplegeo-features-api/"/>
2522
public class Feature : GeoJSONObject
2623
{
2724
/// <summary>
28-
/// Gets the <see cref="id"/>.
25+
/// Initializes a new instance of the <see cref="Feature"/> class.
26+
/// </summary>
27+
/// <param name="geometry">The Geometry Object.</param>
28+
/// <param name="properties">The properties.</param>
29+
public Feature(IGeometryObject geometry, Dictionary<string, object> properties = null)
30+
{
31+
this.Geometry = geometry;
32+
this.Properties = properties;
33+
34+
this.Type = GeoJSONObjectType.Feature;
35+
}
36+
37+
/// <summary>
38+
/// Gets or sets the id.
2939
/// </summary>
3040
/// <value>The handle.</value>
3141
[JsonProperty(PropertyName = "id")]
32-
public string Id { get; private set; }
42+
public string Id { get; set; }
3343

3444
/// <summary>
35-
/// Gets the geometry.
45+
/// Gets or sets the geometry.
3646
/// </summary>
37-
/// <value>The geometry.</value>
47+
/// <value>
48+
/// The geometry.
49+
/// </value>
3850
[JsonProperty(PropertyName = "geometry", Required = Required.AllowNull)]
3951
[JsonConverter(typeof(GeometryConverter))]
40-
public IGeometryObject GeometryObject { get; private set; }
52+
public IGeometryObject Geometry { get; set; }
4153

4254
/// <summary>
4355
/// Gets the properties.

src/GeoJSON.Net/Feature/FeatureCollection.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,24 @@ namespace GeoJSON.Net.Feature
1616
/// <summary>
1717
/// Defines the FeatureCollection type.
1818
/// </summary>
19-
public class FeatureCollection : Feature
19+
public class FeatureCollection : GeoJSONObject
2020
{
21+
/// <summary>
22+
/// Initializes a new instance of the <see cref="FeatureCollection"/> class.
23+
/// </summary>
24+
/// <param name="features">The features.</param>
25+
public FeatureCollection(List<Feature> features)
26+
{
27+
this.Features = features;
28+
29+
this.Type = GeoJSONObjectType.FeatureCollection;
30+
}
31+
2132
/// <summary>
2233
/// Gets the features.
2334
/// </summary>
2435
/// <value>The features.</value>
25-
[JsonProperty(PropertyName = "feature", Required = Required.Always)]
36+
[JsonProperty(PropertyName = "features", Required = Required.Always)]
2637
public List<Feature> Features { get; private set; }
2738
}
2839
}

0 commit comments

Comments
 (0)