Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.Data.Entity / System / Data / Spatial / DbSpatialServices.cs
1 //---------------------------------------------------------------------
2 // <copyright file="DbSpatialServices.cs" company="Microsoft">
3 //      Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //
6 // @owner  willa
7 // @backupOwner Microsoft
8 //---------------------------------------------------------------------
9
10 using System.Data.Common.Utils;
11
12 namespace System.Data.Spatial
13 {
14     /// <summary>
15     /// A provider-independent service API for geospatial (Geometry/Geography) type support.
16     /// </summary>
17     [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db")]
18     [Serializable]
19     public abstract class DbSpatialServices
20     {
21         private static readonly Singleton<DbSpatialServices> defaultServices = new Singleton<DbSpatialServices>(LoadDefaultServices);
22
23         public static DbSpatialServices Default
24         {
25             get
26             {
27                 return defaultServices.Value;
28             }
29         }
30
31         protected DbSpatialServices()
32         {
33         }
34
35         // For CTP1 use the SQL types whenever they are available.   
36         // in future we will have to consider providing a more pluggable 
37         // story here so that users can specify what spatial services they want to use by default.
38         static DbSpatialServices LoadDefaultServices()
39         {
40             if (System.Data.SqlClient.SqlProviderServices.SqlTypesAssemblyIsAvailable)
41             {
42                 return System.Data.SqlClient.SqlSpatialServices.Instance;
43             }
44             else
45             {
46                 return DefaultSpatialServices.Instance;
47             }
48         }
49
50         #region Geography API
51
52         /// <summary>
53         /// This method is intended for use by derived implementations of <see cref="GeographyFromProviderValue"/> after suitable validation of the specified provider value to ensure it is suitable for use with the derived implementation.
54         /// </summary>
55         /// <param name="spatialServices">The spatial services instance that the returned <see cref="DbGeography"/> value will depend on for its implementation of spatial functionality.</param>
56         /// <param name="providerValue"></param>
57         /// <returns>A new <see cref="DbGeography"/> instance that contains the specified <paramref name="providerValue"/> and uses the specified <paramref name="spatialServices"/> as its spatial implementation</returns>
58         /// <exception cref="ArgumentNullException"><paramref name="spatialServices"/> or <paramref name="providerValue"/> is null.</exception>
59         protected static DbGeography CreateGeography(DbSpatialServices spatialServices, object providerValue)
60         {
61             spatialServices.CheckNull("spatialServices");
62             providerValue.CheckNull("providerValue");
63             return new DbGeography(spatialServices, providerValue);
64         }
65
66         /// <summary>
67         /// Creates a new <see cref="DbGeography"/> value based on a provider-specific value that is compatible with this spatial services implementation.
68         /// </summary>
69         /// <param name="providerValue">A provider-specific value that this spatial services implementation is capable of interpreting as a geography value.</param>
70         /// <returns>A new DbGeography value backed by this spatial services implementation and the specified provider value.</returns>
71         /// <exception cref="ArgumentNullException"><paramref name="providerValue"/> is null.</exception>
72         /// <exception cref="ArgumentException"><paramref name="providerValue"/> is not compatible with this spatial services implementation.</exception>
73         public abstract DbGeography GeographyFromProviderValue(object providerValue);
74
75         /// <summary>
76         /// Creates a provider-specific value compatible with this spatial services implementation based on the specified well known <see cref="DbGeography"/> representation.
77         /// </summary>
78         /// <param name="wellKnownValue">An instance of <see cref="DbGeographyWellKnownValue"/> that contains the well known representation of a geography value.</param>
79         /// <returns>A provider-specific value that encodes the information contained in <paramref name="wellKnownValue"/> in a fashion compatible with this spatial services implementation.</returns>
80         /// <exception cref="ArgumentNullException"><paramref name="wellKnownValue"/> is null.</exception>
81         public abstract object CreateProviderValue(DbGeographyWellKnownValue wellKnownValue);
82
83         /// <summary>
84         /// Creates an instance of <see cref="DbGeographyWellKnownValue"/> that represents the specified <see cref="DbGeography"/> value using one or both of the standard well known spatial formats.
85         /// </summary>
86         /// <param name="geographyValue"></param>
87         /// <returns>The well known representation of <paramref name="geographyValue"/>, as a new <see cref="DbGeographyWellKnownValue"/>.</returns>
88         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
89         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
90         public abstract DbGeographyWellKnownValue CreateWellKnownValue(DbGeography geographyValue);
91
92         #region Geography Constructors - well known binary
93
94         /// <summary>
95         /// Creates a new <see cref="DbGeography"/> value based on the specified well known binary value. 
96         /// </summary>
97         /// <param name="wellKnownBinary">A byte array that contains a well known binary representation of the geography value.</param>
98         /// <returns>A new DbGeography value as defined by the well known binary value with the default DbGeography coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
99         /// <exception cref="ArgumentNullException"><paramref name="wellKnownBinary"/> is null.</exception>
100         public abstract DbGeography GeographyFromBinary(byte[] wellKnownBinary);
101
102         /// <summary>
103         /// Creates a new <see cref="DbGeography"/> value based on the specified well known binary value and coordinate system identifier (SRID). 
104         /// </summary>
105         /// <param name="wellKnownBinary">A byte array that contains a well known binary representation of the geography value.</param>
106         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeography value should use.</param>
107         /// <returns>A new DbGeography value as defined by the well known binary value with the specified coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
108         /// <exception cref="ArgumentNullException"><paramref name="wellKnownBinary"/> is null.</exception>
109         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
110         public abstract DbGeography GeographyFromBinary(byte[] wellKnownBinary, int coordinateSystemId);
111
112         /// <summary>
113         /// Creates a new <see cref="DbGeography"/> line value based on the specified well known binary value and coordinate system identifier (SRID). 
114         /// </summary>
115         /// <param name="lineWellKnownBinary">A byte array that contains a well known binary representation of the geography value.</param>
116         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeography value should use.</param>
117         /// <returns>A new DbGeography value as defined by the well known binary value with the specified coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
118         /// <exception cref="ArgumentNullException"><paramref name="lineWellKnownBinary"/> is null.</exception>
119         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
120         public abstract DbGeography GeographyLineFromBinary(byte[] lineWellKnownBinary, int coordinateSystemId);
121
122         /// <summary>
123         /// Creates a new <see cref="DbGeography"/> point value based on the specified well known binary value and coordinate system identifier (SRID). 
124         /// </summary>
125         /// <param name="pointWellKnownBinary">A byte array that contains a well known binary representation of the geography value.</param>
126         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeography value should use.</param>
127         /// <returns>A new DbGeography value as defined by the well known binary value with the specified coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
128         /// <exception cref="ArgumentNullException"><paramref name="pointWellKnownBinary"/> is null.</exception>
129         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
130         public abstract DbGeography GeographyPointFromBinary(byte[] pointWellKnownBinary, int coordinateSystemId);
131
132         /// <summary>
133         /// Creates a new <see cref="DbGeography"/> polygon value based on the specified well known binary value and coordinate system identifier (SRID). 
134         /// </summary>
135         /// <param name="polygonWellKnownBinary">A byte array that contains a well known binary representation of the geography value.</param>
136         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeography value should use.</param>
137         /// <returns>A new DbGeography value as defined by the well known binary value with the specified coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
138         /// <exception cref="ArgumentNullException"><paramref name="polygonWellKnownBinary"/> is null.</exception>
139         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
140         public abstract DbGeography GeographyPolygonFromBinary(byte[] polygonWellKnownBinary, int coordinateSystemId);
141
142         /// <summary>
143         /// Creates a new <see cref="DbGeography"/> multiline value based on the specified well known binary value and coordinate system identifier (SRID). 
144         /// </summary>
145         /// <param name="multiLineWellKnownBinary">A byte array that contains a well known binary representation of the geography value.</param>
146         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeography value should use.</param>
147         /// <returns>A new DbGeography value as defined by the well known binary value with the specified coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
148         /// <exception cref="ArgumentNullException"><paramref name="multiLineWellKnownBinary"/> is null.</exception>
149         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
150         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "MultiLine", Justification = "Match OGC, EDM")]
151         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Multi", Justification = "Match OGC, EDM")]
152         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "multiLine", Justification = "Match OGC, EDM")]
153         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "multi", Justification = "Match OGC, EDM")]
154         public abstract DbGeography GeographyMultiLineFromBinary(byte[] multiLineWellKnownBinary, int coordinateSystemId);
155
156         /// <summary>
157         /// Creates a new <see cref="DbGeography"/> multipoint value based on the specified well known binary value and coordinate system identifier (SRID). 
158         /// </summary>
159         /// <param name="multiPointWellKnownBinary">A byte array that contains a well known binary representation of the geography value.</param>
160         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeography value should use.</param>
161         /// <returns>A new DbGeography value as defined by the well known binary value with the specified coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
162         /// <exception cref="ArgumentNullException"><paramref name="multiPointWellKnownBinary"/> is null.</exception>
163         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
164         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "MultiPoint", Justification = "Match OGC, EDM")]
165         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Multi", Justification = "Match OGC, EDM")]
166         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "multiPoint", Justification = "Match OGC, EDM")]
167         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "multi", Justification = "Match OGC, EDM")]
168         public abstract DbGeography GeographyMultiPointFromBinary(byte[] multiPointWellKnownBinary, int coordinateSystemId);
169
170         /// <summary>
171         /// Creates a new <see cref="DbGeography"/> multipolygon value based on the specified well known binary value and coordinate system identifier (SRID). 
172         /// </summary>
173         /// <param name="multiPolygonWellKnownBinary">A byte array that contains a well known binary representation of the geography value.</param>
174         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeography value should use.</param>
175         /// <returns>A new DbGeography value as defined by the well known binary value with the specified coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
176         /// <exception cref="ArgumentNullException"><paramref name="multiPolygonWellKnownBinary"/> is null.</exception>
177         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
178         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Multi", Justification = "Match OGC, EDM")]
179         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "multi", Justification = "Match OGC, EDM")]
180         public abstract DbGeography GeographyMultiPolygonFromBinary(byte[] multiPolygonWellKnownBinary, int coordinateSystemId);
181
182         /// <summary>
183         /// Creates a new <see cref="DbGeography"/> collection value based on the specified well known binary value and coordinate system identifier (SRID). 
184         /// </summary>
185         /// <param name="geographyCollectionWellKnownBinary">A byte array that contains a well known binary representation of the geography value.</param>
186         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeography value should use.</param>
187         /// <returns>A new DbGeography value as defined by the well known binary value with the specified coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
188         /// <exception cref="ArgumentNullException"><paramref name="geographyCollectionWellKnownBinary"/> is null.</exception>
189         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
190         public abstract DbGeography GeographyCollectionFromBinary(byte[] geographyCollectionWellKnownBinary, int coordinateSystemId);
191
192         #endregion
193
194         #region Geography Constructors - well known text
195
196         /// <summary>
197         /// Creates a new <see cref="DbGeography"/> value based on the specified well known text value. 
198         /// </summary>
199         /// <param name="wellKnownText">A string that contains a well known text representation of the geography value.</param>
200         /// <returns>A new DbGeography value as defined by the well known text value with the default DbGeography coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
201         /// <exception cref="ArgumentNullException"><paramref name="wellKnownText"/> is null.</exception>
202         public abstract DbGeography GeographyFromText(string wellKnownText);
203
204         /// <summary>
205         /// Creates a new <see cref="DbGeography"/> value based on the specified well known text value and coordinate system identifier (SRID). 
206         /// </summary>
207         /// <param name="wellKnownText">A string that contains a well known text representation of the geography value.</param>
208         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeography value should use.</param>
209         /// <returns>A new DbGeography value as defined by the well known text value with the specified coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
210         /// <exception cref="ArgumentNullException"><paramref name="wellKnownText"/> is null.</exception>
211         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
212         public abstract DbGeography GeographyFromText(string wellKnownText, int coordinateSystemId);
213
214         /// <summary>
215         /// Creates a new <see cref="DbGeography"/> line value based on the specified well known text value and coordinate system identifier (SRID). 
216         /// </summary>
217         /// <param name="lineWellKnownText">A string that contains a well known text representation of the geography value.</param>
218         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeography value should use.</param>
219         /// <returns>A new DbGeography value as defined by the well known text value with the specified coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
220         /// <exception cref="ArgumentNullException"><paramref name="lineWellKnownText"/> is null.</exception>
221         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
222         public abstract DbGeography GeographyLineFromText(string lineWellKnownText, int coordinateSystemId);
223
224         /// <summary>
225         /// Creates a new <see cref="DbGeography"/> point value based on the specified well known text value and coordinate system identifier (SRID). 
226         /// </summary>
227         /// <param name="pointWellKnownText">A string that contains a well known text representation of the geography value.</param>
228         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeography value should use.</param>
229         /// <returns>A new DbGeography value as defined by the well known text value with the specified coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
230         /// <exception cref="ArgumentNullException"><paramref name="pointWellKnownText"/> is null.</exception>
231         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
232         public abstract DbGeography GeographyPointFromText(string pointWellKnownText, int coordinateSystemId);
233
234         /// <summary>
235         /// Creates a new <see cref="DbGeography"/> polygon value based on the specified well known text value and coordinate system identifier (SRID). 
236         /// </summary>
237         /// <param name="polygonWellKnownText">A string that contains a well known text representation of the geography value.</param>
238         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeography value should use.</param>
239         /// <returns>A new DbGeography value as defined by the well known text value with the specified coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
240         /// <exception cref="ArgumentNullException"><paramref name="polygonWellKnownText"/> is null.</exception>
241         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
242         public abstract DbGeography GeographyPolygonFromText(string polygonWellKnownText, int coordinateSystemId);
243
244         /// <summary>
245         /// Creates a new <see cref="DbGeography"/> multiline value based on the specified well known text value and coordinate system identifier (SRID). 
246         /// </summary>
247         /// <param name="multiLineWellKnownText">A string that contains a well known text representation of the geography value.</param>
248         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeography value should use.</param>
249         /// <returns>A new DbGeography value as defined by the well known text value with the specified coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
250         /// <exception cref="ArgumentNullException"><paramref name="multiLineWellKnownText"/> is null.</exception>
251         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
252         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "MultiLine", Justification = "Match OGC, EDM")]
253         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Multi", Justification = "Match OGC, EDM")]
254         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "multiLine", Justification = "Match OGC, EDM")]
255         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "multi", Justification = "Match OGC, EDM")]
256         public abstract DbGeography GeographyMultiLineFromText(string multiLineWellKnownText, int coordinateSystemId);
257
258         /// <summary>
259         /// Creates a new <see cref="DbGeography"/> multipoint value based on the specified well known text value and coordinate system identifier (SRID). 
260         /// </summary>
261         /// <param name="multiPointWellKnownText">A string that contains a well known text representation of the geography value.</param>
262         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeography value should use.</param>
263         /// <returns>A new DbGeography value as defined by the well known text value with the specified coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
264         /// <exception cref="ArgumentNullException"><paramref name="multiPointWellKnownText"/> is null.</exception>
265         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
266         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "MultiPoint", Justification = "Match OGC, EDM")]
267         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Multi", Justification = "Match OGC, EDM")]
268         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "multiPoint", Justification = "Match OGC, EDM")]
269         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "multi", Justification = "Match OGC, EDM")]
270         public abstract DbGeography GeographyMultiPointFromText(string multiPointWellKnownText, int coordinateSystemId);
271
272         /// <summary>
273         /// Creates a new <see cref="DbGeography"/> multipolygon value based on the specified well known text value and coordinate system identifier (SRID). 
274         /// </summary>
275         /// <param name="multiPolygonWellKnownText">A string that contains a well known text representation of the geography value.</param>
276         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeography value should use.</param>
277         /// <returns>A new DbGeography value as defined by the well known text value with the specified coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
278         /// <exception cref="ArgumentNullException"><paramref name="multiPolygonWellKnownText"/> is null.</exception>
279         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
280         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Multi", Justification = "Match OGC, EDM")]
281         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "multi", Justification = "Match OGC, EDM")]
282         public abstract DbGeography GeographyMultiPolygonFromText(string multiPolygonWellKnownText, int coordinateSystemId);
283
284         /// <summary>
285         /// Creates a new <see cref="DbGeography"/> collection value based on the specified well known text value and coordinate system identifier (SRID). 
286         /// </summary>
287         /// <param name="geographyCollectionWellKnownText">A string that contains a well known text representation of the geography value.</param>
288         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeography value should use.</param>
289         /// <returns>A new DbGeography value as defined by the well known text value with the specified coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
290         /// <exception cref="ArgumentNullException"><paramref name="geographyCollectionWellKnownText"/> is null.</exception>
291         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
292         public abstract DbGeography GeographyCollectionFromText(string geographyCollectionWellKnownText, int coordinateSystemId);
293
294         #endregion
295
296         #region Geography Constructors - Geography Markup Language (GML)
297
298         /// <summary>
299         /// Creates a new <see cref="DbGeography"/> value based on the specified Geography Markup Language (GML) value.
300         /// </summary>
301         /// <param name="geographyMarkup">A string that contains a Geometry Markup Language (GML) representation of the geography value.</param>
302         /// <returns>A new DbGeography value as defined by the GML value with the default DbGeography coordinate system identifier (SRID) (<see cref="DbGeography.DefaultCoordinateSystemId"/>).</returns>
303         /// <exception cref="ArgumentNullException"><paramref name="geographyMarkup"/> is null.</exception>
304         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gml")]
305         public abstract DbGeography GeographyFromGml(string geographyMarkup);
306
307         /// <summary>
308         /// Creates a new <see cref="DbGeography"/> value based on the specified Geography Markup Language (GML) value and coordinate system identifier (SRID).
309         /// </summary>
310         /// <param name="geographyMarkup">A string that contains a Geometry Markup Language (GML) representation of the geography value.</param>
311         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeography value should use.</param>
312         /// <returns>A new DbGeography value as defined by the GML value with the specified coordinate system identifier (SRID).</returns>
313         /// <exception cref="ArgumentNullException"><paramref name="geographyMarkup"/> is null.</exception>
314         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
315         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gml")]
316         public abstract DbGeography GeographyFromGml(string geographyMarkup, int coordinateSystemId);
317
318         #endregion
319
320         #region Geography Instance Property Accessors
321
322         /// </summary>
323         /// Gets the coordinate system identifier (SRID) of the coordinate system used by the given <see cref="DbGeography"/> value.
324         /// </summary>
325         /// <param name="geographyValue">The geography value from which the coordinate system id should be retrieved.</param>
326         /// <returns>The integer coordinate system id value from <paramref name="geographyValue"/>.</returns>
327         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
328         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
329         public abstract int GetCoordinateSystemId(DbGeography geographyValue);
330
331         /// <summary>
332         /// Gets the dimension of the given <see cref="DbGeography"/> value or, if the value is a collections, the largest element dimension.
333         /// </summary>
334         /// <param name="geographyValue">The geography value for which the dimension value should be retrieved.</param>
335         /// <returns>The dimension of <paramref name="geographyValue"/>, or the largest element dimension if <see cref="DbGeography"/> is a collection.</returns>
336         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
337         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
338         public abstract int GetDimension(DbGeography geographyValue);
339
340         /// </summary>
341         /// Gets the spatial type name, as a string, of the given <see cref="DbGeography"/> value.
342         /// </summary>
343         /// <param name="geographyValue">The geography value from which the spatial type name should be retrieved.</param>
344         /// <returns>The string spatial type from <paramref name="geographyValue"/>.</returns>
345         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
346         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
347         public abstract string GetSpatialTypeName(DbGeography geographyValue);
348
349         /// </summary>
350         /// Gets a Boolean value indicating whether the given <see cref="DbGeography"/> value represents the empty geography.
351         /// </summary>
352         /// <param name="geographyValue">The geography value from which the IsEmpty property should be retrieved.</param>
353         /// <returns><c>true</c> if <paramref name="geographyValue"/> represents the empty geography; otherwise <c>false</c>.</returns>
354         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
355         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
356         public abstract bool GetIsEmpty(DbGeography geographyValue);
357
358         #endregion
359
360         #region Geography Well Known Format Conversion
361
362         /// <summary>
363         /// Gets the well known text representation of the given <see cref="DbGeography"/> value.  This value should include only the Longitude and Latitude of points.
364         /// </summary>
365         /// <param name="geographyValue">The geography value for which the well known text should be generated.</param>
366         /// <returns>A string containing the well known text representation of <paramref name="geographyValue"/></returns>
367         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
368         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
369         public abstract string AsText(DbGeography geographyValue);
370
371         /// <summary>
372         /// Gets the well known text representation of the given <see cref="DbGeography"/> value, including Longitude, Latitude, Elevation (Z) and Measure (M) for points.
373         /// </summary>
374         /// <param name="geographyValue">The geography value for which the well known text should be generated.</param>
375         /// <returns>A string containing the well known text representation of <paramref name="geographyValue"/></returns>
376         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
377         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
378         public virtual string AsTextIncludingElevationAndMeasure(DbGeography geographyValue)
379         {
380             return null;
381         }
382
383         /// <summary>
384         /// Gets the well known binary representation of the given <see cref="DbGeography"/> value.
385         /// </summary>
386         /// <param name="geographyValue">The geography value for which the well known binary should be generated.</param>
387         /// <returns>A byte[] containing the well known binary representation of <paramref name="geographyValue"/></returns>
388         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
389         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
390         public abstract byte[] AsBinary(DbGeography geographyValue);
391
392         // Non-OGC
393         /// <summary>
394         /// Generates the Geography Markup Language (GML) representation of this <see cref="DbGeography"/> value.
395         /// </summary>
396         /// <param name="geographyValue">The geography value for which the GML should be generated.</param>
397         /// <returns>A string containing the GML representation of this DbGeography value.</returns>
398         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
399         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception> 
400         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gml")]
401         public abstract string AsGml(DbGeography geographyValue);
402
403         #endregion
404
405         #region Geography Instance Methods - Spatial Relation
406
407         /// <summary>
408         /// Determines whether the two given <see cref="DbGeography"/> values are spatially equal.
409         /// </summary>
410         /// <param name="geographyValue">The first geography value to compare for equality.</param>
411         /// <param name="otherGeography">The second geography value to compare for equality.</param>
412         /// <returns><c>true</c> if <paramref name="geographyValue"/> is spatially equal to <paramref name="otherGeography"/>; otherwise <c>false</c>.</returns>
413         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> or <paramref name="otherGeography"/> is null.</exception>
414         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> or <paramref name="otherGeography"/> is not compatible with this spatial services implementation.</exception>
415         public abstract bool SpatialEquals(DbGeography geographyValue, DbGeography otherGeography);
416
417         /// <summary>
418         /// Determines whether the two given <see cref="DbGeography"/> values are spatially disjoint.
419         /// </summary>
420         /// <param name="geographyValue">The first geography value to compare for disjointness.</param>
421         /// <param name="otherGeography">The second geography value to compare for disjointness.</param>
422         /// <returns><c>true</c> if <paramref name="geographyValue"/> is disjoint from <paramref name="otherGeography"/>; otherwise <c>false</c>.</returns>
423         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> or <paramref name="otherGeography"/> is null.</exception>
424         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> or <paramref name="otherGeography"/> is not compatible with this spatial services implementation.</exception>         
425         public abstract bool Disjoint(DbGeography geographyValue, DbGeography otherGeography);
426
427         /// <summary>
428         /// Determines whether the two given <see cref="DbGeography"/> values spatially intersect.
429         /// </summary>
430         /// <param name="geographyValue">The first geography value to compare for intersection.</param>
431         /// <param name="otherGeography">The second geography value to compare for intersection.</param>
432         /// <returns><c>true</c> if <paramref name="geographyValue"/> intersects <paramref name="otherGeography"/>; otherwise <c>false</c>.</returns>
433         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> or <paramref name="otherGeography"/> is null.</exception>
434         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> or <paramref name="otherGeography"/> is not compatible with this spatial services implementation.</exception> 
435         public abstract bool Intersects(DbGeography geographyValue, DbGeography otherGeography);
436
437         #endregion
438
439         #region Geography Instance Methods - Spatial Analysis
440
441         /// <summary>
442         /// Creates a geography value representing all points less than or equal to <paramref name="distance"/> from the given <see cref="DbGeography"/> value.
443         /// </summary>
444         /// <param name="geographyValue">The geography value.</param>
445         /// <param name="distance">A double value specifying how far from <paramref name="geographyValue"/> to buffer.</param>
446         /// <returns>A new DbGeography value representing all points less than or equal to <paramref name="distance"/> from <paramref name="geographyValue"/>.</returns>
447         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
448         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
449         public abstract DbGeography Buffer(DbGeography geographyValue, double distance);
450
451         /// <summary>
452         /// Computes the distance between the closest points in two <see cref="DbGeography"/> values.
453         /// </summary>
454         /// <param name="geographyValue">The first geography value.</param>
455         /// <param name="otherGeography">The second geography value.</param>
456         /// <returns>A double value that specifies the distance between the two closest points in <paramref name="geographyValue"/> and <paramref name="otherGeography"/>.</returns>
457         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> or <paramref name="otherGeography"/> is null.</exception>
458         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> or <paramref name="otherGeography"/> is not compatible with this spatial services implementation.</exception> 
459         public abstract double Distance(DbGeography geographyValue, DbGeography otherGeography);
460
461         /// <summary>
462         /// Computes the intersection of two <see cref="DbGeography"/> values.
463         /// </summary>
464         /// <param name="geographyValue">The first geography value.</param>
465         /// <param name="otherGeography">The second geography value.</param>
466         /// <returns>A new DbGeography value representing the intersection of <paramref name="geographyValue"/> and <paramref name="otherGeography"/>.</returns>
467         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> or <paramref name="otherGeography"/> is null.</exception>
468         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> or <paramref name="otherGeography"/> is not compatible with this spatial services implementation.</exception>
469         public abstract DbGeography Intersection(DbGeography geographyValue, DbGeography otherGeography);
470
471         /// <summary>
472         /// Computes the union of two <see cref="DbGeography"/> values.
473         /// </summary>
474         /// <param name="geographyValue">The first geography value.</param>
475         /// <param name="otherGeography">The second geography value.</param>
476         /// <returns>A new DbGeography value representing the union of <paramref name="geographyValue"/> and <paramref name="otherGeography"/>.</returns>
477         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> or <paramref name="otherGeography"/> is null.</exception>
478         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> or <paramref name="otherGeography"/> is not compatible with this spatial services implementation.</exception>
479         public abstract DbGeography Union(DbGeography geographyValue, DbGeography otherGeography);
480
481         /// <summary>
482         /// Computes the difference of two <see cref="DbGeography"/> values.
483         /// </summary>
484         /// <param name="geographyValue">The first geography value.</param>
485         /// <param name="otherGeography">The second geography value.</param>
486         /// <returns>A new DbGeography value representing the difference of <paramref name="geographyValue"/> and <paramref name="otherGeography"/>.</returns>
487         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> or <paramref name="otherGeography"/> is null.</exception>
488         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> or <paramref name="otherGeography"/> is not compatible with this spatial services implementation.</exception>
489         public abstract DbGeography Difference(DbGeography geographyValue, DbGeography otherGeography);
490
491         /// <summary>
492         /// Computes the symmetric difference of two <see cref="DbGeography"/> values.
493         /// </summary>
494         /// <param name="geographyValue">The first geography value.</param>
495         /// <param name="otherGeography">The second geography value.</param>
496         /// <returns>A new DbGeography value representing the symmetric difference of <paramref name="geographyValue"/> and <paramref name="otherGeography"/>.</returns>
497         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> or <paramref name="otherGeography"/> is null.</exception>
498         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> or <paramref name="otherGeography"/> is not compatible with this spatial services implementation.</exception>
499         public abstract DbGeography SymmetricDifference(DbGeography geographyValue, DbGeography otherGeography);
500
501         #endregion
502
503         #region Geography Collection
504
505         /// <summary>
506         /// Returns the number of elements in the given <see cref="DbGeography"/> value, if it represents a geography collection.
507         /// <param name="geographyValue">The geography value, which need not represent a geography collection.</param>
508         /// <returns>The number of elements in <paramref name="geographyValue"/>, if it represents a collection of other geography values; otherwise <c>null</c>.</returns>
509         /// </summary>
510         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
511         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
512         public abstract int? GetElementCount(DbGeography geographyValue);
513
514         /// <summary>
515         /// Returns an element of the given <see cref="DbGeography"/> value, if it represents a geography collection.
516         /// <param name="geographyValue">The geography value, which need not represent a geography collection.</param>
517         /// <param name="index">The position within the geography value from which the element should be taken.</param>
518         /// <returns>The element in <paramref name="geographyValue"/> at position <paramref name="index"/>, if it represents a collection of other geography values; otherwise <c>null</c>.</returns>
519         /// </summary>
520         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
521         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
522         public abstract DbGeography ElementAt(DbGeography geographyValue, int index);
523
524         #endregion
525
526         #region Point
527
528         /// <summary>
529         /// Returns the Latitude coordinate of the given <see cref="DbGeography"/> value, if it represents a point.
530         /// <param name="geographyValue">The geography value, which need not represent a point.</param>
531         /// <returns>The Latitude coordinate of <paramref name="geographyValue"/>, if it represents a point; otherwise <c>null</c>.</returns>
532         /// </summary>
533         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
534         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
535         public abstract double? GetLatitude(DbGeography geographyValue);
536
537         /// <summary>
538         /// Returns the Longitude coordinate of the given <see cref="DbGeography"/> value, if it represents a point.
539         /// <param name="geographyValue">The geography value, which need not represent a point.</param>
540         /// <returns>The Longitude coordinate of <paramref name="geographyValue"/>, if it represents a point; otherwise <c>null</c>.</returns>
541         /// </summary>
542         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
543         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
544         public abstract double? GetLongitude(DbGeography geographyValue);
545
546         /// <summary>
547         /// Returns the elevation (Z coordinate) of the given <see cref="DbGeography"/> value, if it represents a point.
548         /// <param name="geographyValue">The geography value, which need not represent a point.</param>
549         /// <returns>The elevation (Z coordinate) of <paramref name="geographyValue"/>, if it represents a point; otherwise <c>null</c>.</returns>
550         /// </summary>
551         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
552         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
553         public abstract double? GetElevation(DbGeography geographyValue);
554
555         /// <summary>
556         /// Returns the M (Measure) coordinate of the given <see cref="DbGeography"/> value, if it represents a point.
557         /// <param name="geographyValue">The geography value, which need not represent a point.</param>
558         /// <returns>The M (Measure) coordinate of <paramref name="geographyValue"/>, if it represents a point; otherwise <c>null</c>.</returns>
559         /// </summary>
560         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
561         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
562         public abstract double? GetMeasure(DbGeography geographyValue);
563
564         #endregion
565
566         #region Curve
567
568         /// <summary>
569         /// Returns a nullable double value that indicates the length of the given <see cref="DbGeography"/> value, which may be null if the value does not represent a curve.
570         /// <param name="geographyValue">The geography value, which need not represent a curve.</param>
571         /// <returns>The length of <paramref name="geographyValue"/>, if it represents a curve; otherwise <c>null</c>.</returns>
572         /// </summary>
573         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
574         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
575         public abstract double? GetLength(DbGeography geographyValue);
576
577         /// <summary>
578         /// Returns a <see cref="DbGeography"/> value that represents the start point of the given DbGeography value, which may be null if the value does not represent a curve.
579         /// <param name="geographyValue">The geography value, which need not represent a curve.</param>
580         /// <returns>The start point of <paramref name="geographyValue"/>, if it represents a curve; otherwise <c>null</c>.</returns>
581         /// </summary>
582         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
583         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
584         public abstract DbGeography GetStartPoint(DbGeography geographyValue);
585
586         /// <summary>
587         /// Returns a <see cref="DbGeography"/> value that represents the end point of the given DbGeography value, which may be null if the value does not represent a curve.
588         /// <param name="geographyValue">The geography value, which need not represent a curve.</param>
589         /// <returns>The end point of <paramref name="geographyValue"/>, if it represents a curve; otherwise <c>null</c>.</returns>
590         /// </summary>
591         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
592         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
593         public abstract DbGeography GetEndPoint(DbGeography geographyValue);
594
595         /// <summary>
596         /// Returns a nullable Boolean value that whether the given <see cref="DbGeography"/> value is closed, which may be null if the value does not represent a curve.
597         /// <param name="geographyValue">The geography value, which need not represent a curve.</param>
598         /// <returns><c>true</c> if <paramref name="geographyValue"/> represents a closed curve; <c>false</c> if <paramref name="geographyValue"/> represents a curve that is not closed; otherwise <c>null</c>.</returns>
599         /// </summary>
600         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
601         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
602         public abstract bool? GetIsClosed(DbGeography geographyValue);
603
604         #endregion
605
606         #region LineString, Line, LinearRing
607
608         /// <summary>
609         /// Returns the number of points in the given <see cref="DbGeography"/> value, if it represents a linestring or linear ring.
610         /// <param name="geographyValue">The geography value, which need not represent a linestring or linear ring.</param>
611         /// <returns>The number of elements in <paramref name="geographyValue"/>, if it represents a linestring or linear ring; otherwise <c>null</c>.</returns>
612         /// </summary>
613         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
614         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
615         public abstract int? GetPointCount(DbGeography geographyValue);
616
617         /// <summary>
618         /// Returns a point element of the given <see cref="DbGeography"/> value, if it represents a linestring or linear ring.
619         /// <param name="geographyValue">The geography value, which need not represent a linestring or linear ring.</param>
620         /// <param name="index">The position within the geography value from which the element should be taken.</param>
621         /// <returns>The point in <paramref name="geographyValue"/> at position <paramref name="index"/>, if it represents a linestring or linear ring; otherwise <c>null</c>.</returns>
622         /// </summary>
623         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
624         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
625         public abstract DbGeography PointAt(DbGeography geographyValue, int index);
626
627         #endregion
628
629         #region Surface
630
631         /// <summary>
632         /// Returns a nullable double value that indicates the area of the given <see cref="DbGeography"/> value, which may be null if the value does not represent a surface.
633         /// <param name="geographyValue">The geography value, which need not represent a surface.</param>
634         /// <returns>The area of <paramref name="geographyValue"/>, if it represents a surface; otherwise <c>null</c>.</returns>
635         /// </summary>
636         /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception>
637         /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception>
638         public abstract double? GetArea(DbGeography geographyValue);
639
640         #endregion
641
642         #endregion
643
644         #region Geometry API
645
646         /// <summary>
647         /// This method is intended for use by derived implementations of <see cref="GeometryFromProviderValue"/> after suitable validation of the specified provider value to ensure it is suitable for use with the derived implementation.
648         /// </summary>
649         /// <param name="spatialServices">The spatial services instance that the returned <see cref="DbGeometry"/> value will depend on for its implementation of spatial functionality.</param>
650         /// <param name="providerValue"></param>
651         /// <returns>A new <see cref="DbGeometry"/> instance that contains the specified <paramref name="providerValue"/> and uses the specified <paramref name="spatialServices"/> as its spatial implementation</returns>
652         /// <exception cref="ArgumentNullException"><paramref name="spatialServices"/> or <paramref name="providerValue"/> is null.</exception>
653         protected static DbGeometry CreateGeometry(DbSpatialServices spatialServices, object providerValue)
654         {
655             spatialServices.CheckNull("spatialServices");
656             providerValue.CheckNull("providerValue");
657             return new DbGeometry(spatialServices, providerValue);
658         }
659
660         /// <summary>
661         /// Creates a provider-specific value compatible with this spatial services implementation based on the specified well known <see cref="DbGeometry"/> representation.
662         /// </summary>
663         /// <param name="wellKnownValue">An instance of <see cref="DbGeometryWellKnownValue"/> that contains the well known representation of a geometry value.</param>
664         /// <returns>A provider-specific value that encodes the information contained in <paramref name="wellKnownValue"/> in a fashion compatible with this spatial services implementation.</returns>
665         /// <exception cref="ArgumentNullException"><paramref name="wellKnownValue"/> is null.</exception>
666         public abstract object CreateProviderValue(DbGeometryWellKnownValue wellKnownValue);
667
668         /// <summary>
669         /// Creates an instance of <see cref="DbGeometryWellKnownValue"/> that represents the specified <see cref="DbGeometry"/> value using one or both of the standard well known spatial formats.
670         /// </summary>
671         /// <param name="geometryValue"></param>
672         /// <returns>The well known representation of <paramref name="geometryValue"/>, as a new <see cref="DbGeometryWellKnownValue"/>.</returns>
673         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
674         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
675         public abstract DbGeometryWellKnownValue CreateWellKnownValue(DbGeometry geometryValue);
676
677         /// <summary>
678         /// Creates a new <see cref="DbGeometry"/> value based on a provider-specific value that is compatible with this spatial services implementation.
679         /// </summary>
680         /// <param name="providerValue">A provider-specific value that this spatial services implementation is capable of interpreting as a geometry value.</param>
681         /// <returns>A new DbGeometry value backed by this spatial services implementation and the specified provider value.</returns>
682         /// <exception cref="ArgumentNullException"><paramref name="providerValue"/> is null.</exception>
683         /// <exception cref="ArgumentException"><paramref name="providerValue"/> is not compatible with this spatial services implementation.</exception>
684         public abstract DbGeometry GeometryFromProviderValue(object providerValue);
685
686         #region Geometry Constructors - well known binary
687
688         /// <summary>
689         /// Creates a new <see cref="DbGeometry"/> value based on the specified well known binary value. 
690         /// </summary>
691         /// <param name="wellKnownBinary">A byte array that contains a well known binary representation of the geometry value.</param>
692         /// <returns>A new DbGeometry value as defined by the well known binary value with the default DbGeometry coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
693         /// <exception cref="ArgumentNullException"><paramref name="wellKnownBinary"/> is null.</exception>
694         public abstract DbGeometry GeometryFromBinary(byte[] wellKnownBinary);
695
696         /// <summary>
697         /// Creates a new <see cref="DbGeometry"/> value based on the specified well known binary value and coordinate system identifier (SRID). 
698         /// </summary>
699         /// <param name="wellKnownBinary">A byte array that contains a well known binary representation of the geometry value.</param>
700         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeometry value should use.</param>
701         /// <returns>A new DbGeometry value as defined by the well known binary value with the specified coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
702         /// <exception cref="ArgumentNullException"><paramref name="wellKnownBinary"/> is null.</exception>
703         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
704         public abstract DbGeometry GeometryFromBinary(byte[] wellKnownBinary, int coordinateSystemId);
705
706         /// <summary>
707         /// Creates a new <see cref="DbGeometry"/> line value based on the specified well known binary value and coordinate system identifier (SRID). 
708         /// </summary>
709         /// <param name="lineWellKnownBinary">A byte array that contains a well known binary representation of the geometry value.</param>
710         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeometry value should use.</param>
711         /// <returns>A new DbGeometry value as defined by the well known binary value with the specified coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
712         /// <exception cref="ArgumentNullException"><paramref name="lineWellKnownBinary"/> is null.</exception>
713         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
714         public abstract DbGeometry GeometryLineFromBinary(byte[] lineWellKnownBinary, int coordinateSystemId);
715
716         /// <summary>
717         /// Creates a new <see cref="DbGeometry"/> point value based on the specified well known binary value and coordinate system identifier (SRID). 
718         /// </summary>
719         /// <param name="pointWellKnownBinary">A byte array that contains a well known binary representation of the geometry value.</param>
720         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeometry value should use.</param>
721         /// <returns>A new DbGeometry value as defined by the well known binary value with the specified coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
722         /// <exception cref="ArgumentNullException"><paramref name="pointWellKnownBinary"/> is null.</exception>
723         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
724         public abstract DbGeometry GeometryPointFromBinary(byte[] pointWellKnownBinary, int coordinateSystemId);
725
726         /// <summary>
727         /// Creates a new <see cref="DbGeometry"/> polygon value based on the specified well known binary value and coordinate system identifier (SRID). 
728         /// </summary>
729         /// <param name="polygonWellKnownBinary">A byte array that contains a well known binary representation of the geometry value.</param>
730         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeometry value should use.</param>
731         /// <returns>A new DbGeometry value as defined by the well known binary value with the specified coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
732         /// <exception cref="ArgumentNullException"><paramref name="polygonWellKnownBinary"/> is null.</exception>
733         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
734         public abstract DbGeometry GeometryPolygonFromBinary(byte[] polygonWellKnownBinary, int coordinateSystemId);
735
736         /// <summary>
737         /// Creates a new <see cref="DbGeometry"/> multiline value based on the specified well known binary value and coordinate system identifier (SRID). 
738         /// </summary>
739         /// <param name="multiLineWellKnownBinary">A byte array that contains a well known binary representation of the geometry value.</param>
740         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeometry value should use.</param>
741         /// <returns>A new DbGeometry value as defined by the well known binary value with the specified coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
742         /// <exception cref="ArgumentNullException"><paramref name="multiLineWellKnownBinary"/> is null.</exception>
743         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
744         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "MultiLine", Justification = "Match OGC, EDM")]
745         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Multi", Justification = "Match OGC, EDM")]
746         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "multiLine", Justification = "Match OGC, EDM")]
747         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "multi", Justification = "Match OGC, EDM")]
748         public abstract DbGeometry GeometryMultiLineFromBinary(byte[] multiLineWellKnownBinary, int coordinateSystemId);
749
750         /// <summary>
751         /// Creates a new <see cref="DbGeometry"/> multipoint value based on the specified well known binary value and coordinate system identifier (SRID). 
752         /// </summary>
753         /// <param name="multiPointWellKnownBinary">A byte array that contains a well known binary representation of the geometry value.</param>
754         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeometry value should use.</param>
755         /// <returns>A new DbGeometry value as defined by the well known binary value with the specified coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
756         /// <exception cref="ArgumentNullException"><paramref name="multiPointWellKnownBinary"/> is null.</exception>
757         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
758         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "MultiPoint", Justification = "Match OGC, EDM")]
759         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Multi", Justification = "Match OGC, EDM")]
760         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "multiPoint", Justification = "Match OGC, EDM")]
761         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "multi", Justification = "Match OGC, EDM")]
762         public abstract DbGeometry GeometryMultiPointFromBinary(byte[] multiPointWellKnownBinary, int coordinateSystemId);
763
764         /// <summary>
765         /// Creates a new <see cref="DbGeometry"/> multipolygon value based on the specified well known binary value and coordinate system identifier (SRID). 
766         /// </summary>
767         /// <param name="multiPolygonWellKnownBinary">A byte array that contains a well known binary representation of the geometry value.</param>
768         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeometry value should use.</param>
769         /// <returns>A new DbGeometry value as defined by the well known binary value with the specified coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
770         /// <exception cref="ArgumentNullException"><paramref name="multiPolygonWellKnownBinary"/> is null.</exception>
771         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
772         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Multi", Justification = "Match OGC, EDM")]
773         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "multi", Justification = "Match OGC, EDM")]
774         public abstract DbGeometry GeometryMultiPolygonFromBinary(byte[] multiPolygonWellKnownBinary, int coordinateSystemId);
775
776         /// <summary>
777         /// Creates a new <see cref="DbGeometry"/> collection value based on the specified well known binary value and coordinate system identifier (SRID). 
778         /// </summary>
779         /// <param name="geometryCollectionWellKnownBinary">A byte array that contains a well known binary representation of the geometry value.</param>
780         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeometry value should use.</param>
781         /// <returns>A new DbGeometry value as defined by the well known binary value with the specified coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
782         /// <exception cref="ArgumentNullException"><paramref name="geometryCollectionWellKnownBinary"/> is null.</exception>
783         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
784         public abstract DbGeometry GeometryCollectionFromBinary(byte[] geometryCollectionWellKnownBinary, int coordinateSystemId);
785
786         #endregion
787
788         #region Geometry Constructors - well known text 
789
790         /// <summary>
791         /// Creates a new <see cref="DbGeometry"/> value based on the specified well known text value. 
792         /// </summary>
793         /// <param name="wellKnownText">A string that contains a well known text representation of the geometry value.</param>
794         /// <returns>A new DbGeometry value as defined by the well known text value with the default DbGeometry coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
795         /// <exception cref="ArgumentNullException"><paramref name="wellKnownText"/> is null.</exception>
796         public abstract DbGeometry GeometryFromText(string wellKnownText);
797
798         /// <summary>
799         /// Creates a new <see cref="DbGeometry"/> value based on the specified well known text value and coordinate system identifier (SRID). 
800         /// </summary>
801         /// <param name="wellKnownText">A string that contains a well known text representation of the geometry value.</param>
802         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeometry value should use.</param>
803         /// <returns>A new DbGeometry value as defined by the well known text value with the specified coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
804         /// <exception cref="ArgumentNullException"><paramref name="wellKnownText"/> is null.</exception>
805         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
806         public abstract DbGeometry GeometryFromText(string wellKnownText, int coordinateSystemId);
807
808         /// <summary>
809         /// Creates a new <see cref="DbGeometry"/> line value based on the specified well known text value and coordinate system identifier (SRID). 
810         /// </summary>
811         /// <param name="lineWellKnownText">A string that contains a well known text representation of the geometry value.</param>
812         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeometry value should use.</param>
813         /// <returns>A new DbGeometry value as defined by the well known text value with the specified coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
814         /// <exception cref="ArgumentNullException"><paramref name="lineWellKnownText"/> is null.</exception>
815         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
816         public abstract DbGeometry GeometryLineFromText(string lineWellKnownText, int coordinateSystemId);
817
818         /// <summary>
819         /// Creates a new <see cref="DbGeometry"/> point value based on the specified well known text value and coordinate system identifier (SRID). 
820         /// </summary>
821         /// <param name="pointWellKnownText">A string that contains a well known text representation of the geometry value.</param>
822         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeometry value should use.</param>
823         /// <returns>A new DbGeometry value as defined by the well known text value with the specified coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
824         /// <exception cref="ArgumentNullException"><paramref name="pointWellKnownText"/> is null.</exception>
825         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
826         public abstract DbGeometry GeometryPointFromText(string pointWellKnownText, int coordinateSystemId);
827
828         /// <summary>
829         /// Creates a new <see cref="DbGeometry"/> polygon value based on the specified well known text value and coordinate system identifier (SRID). 
830         /// </summary>
831         /// <param name="polygonWellKnownText">A string that contains a well known text representation of the geometry value.</param>
832         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeometry value should use.</param>
833         /// <returns>A new DbGeometry value as defined by the well known text value with the specified coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
834         /// <exception cref="ArgumentNullException"><paramref name="polygonWellKnownText"/> is null.</exception>
835         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
836         public abstract DbGeometry GeometryPolygonFromText(string polygonWellKnownText, int coordinateSystemId);
837
838         /// <summary>
839         /// Creates a new <see cref="DbGeometry"/> multiline value based on the specified well known text value and coordinate system identifier (SRID). 
840         /// </summary>
841         /// <param name="multiLineWellKnownText">A string that contains a well known text representation of the geometry value.</param>
842         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeometry value should use.</param>
843         /// <returns>A new DbGeometry value as defined by the well known text value with the specified coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
844         /// <exception cref="ArgumentNullException"><paramref name="multiLineWellKnownText"/> is null.</exception>
845         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
846         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "MultiLine", Justification = "Match OGC, EDM")]
847         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Multi", Justification = "Match OGC, EDM")]
848         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "multiLine", Justification = "Match OGC, EDM")]
849         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "multi", Justification = "Match OGC, EDM")]
850         public abstract DbGeometry GeometryMultiLineFromText(string multiLineWellKnownText, int coordinateSystemId);
851
852         /// <summary>
853         /// Creates a new <see cref="DbGeometry"/> multipoint value based on the specified well known text value and coordinate system identifier (SRID). 
854         /// </summary>
855         /// <param name="multiPointWellKnownText">A string that contains a well known text representation of the geometry value.</param>
856         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeometry value should use.</param>
857         /// <returns>A new DbGeometry value as defined by the well known text value with the specified coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
858         /// <exception cref="ArgumentNullException"><paramref name="multiPointWellKnownText"/> is null.</exception>
859         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
860         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "MultiPoint", Justification = "Match OGC, EDM")]
861         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Multi", Justification = "Match OGC, EDM")]
862         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "multiPoint", Justification = "Match OGC, EDM")]
863         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "multi", Justification = "Match OGC, EDM")]
864         public abstract DbGeometry GeometryMultiPointFromText(string multiPointWellKnownText, int coordinateSystemId);
865
866         /// <summary>
867         /// Creates a new <see cref="DbGeometry"/> multipolygon value based on the specified well known text value and coordinate system identifier (SRID). 
868         /// </summary>
869         /// <param name="multiPolygonKnownText">A string that contains a well known text representation of the geometry value.</param>
870         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeometry value should use.</param>
871         /// <returns>A new DbGeometry value as defined by the well known text value with the specified coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
872         /// <exception cref="ArgumentNullException"><paramref name="multiPolygonKnownText"/> is null.</exception>
873         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
874         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Multi", Justification = "Match OGC, EDM")]
875         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "multi", Justification = "Match OGC, EDM")]
876         public abstract DbGeometry GeometryMultiPolygonFromText(string multiPolygonKnownText, int coordinateSystemId);
877
878         /// <summary>
879         /// Creates a new <see cref="DbGeometry"/> collection value based on the specified well known text value and coordinate system identifier (SRID). 
880         /// </summary>
881         /// <param name="geometryCollectionWellKnownText">A string that contains a well known text representation of the geometry value.</param>
882         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeometry value should use.</param>
883         /// <returns>A new DbGeometry value as defined by the well known text value with the specified coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
884         /// <exception cref="ArgumentNullException"><paramref name="geometryCollectionWellKnownText"/> is null.</exception>
885         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
886         public abstract DbGeometry GeometryCollectionFromText(string geometryCollectionWellKnownText, int coordinateSystemId);
887
888         #endregion
889
890         #region Geometry Constructors - Geography Markup Language (GML)
891
892         /// <summary>
893         /// Creates a new <see cref="DbGeometry"/> value based on the specified Geography Markup Language (GML) value.
894         /// </summary>
895         /// <param name="geometryMarkup">A string that contains a Geography Markup Language (GML) representation of the geometry value.</param>
896         /// <returns>A new DbGeometry value as defined by the GML value with the default DbGeometry coordinate system identifier (SRID) (<see cref="DbGeometry.DefaultCoordinateSystemId"/>).</returns>
897         /// <exception cref="ArgumentNullException"><paramref name="geometryMarkup"/> is null.</exception>
898         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gml")]
899         public abstract DbGeometry GeometryFromGml(string geometryMarkup);
900
901         /// <summary>
902         /// Creates a new <see cref="DbGeometry"/> value based on the specified Geography Markup Language (GML) value and coordinate system identifier (SRID).
903         /// </summary>
904         /// <param name="geometryMarkup">A string that contains a Geography Markup Language (GML) representation of the geometry value.</param>
905         /// <param name="coordinateSystemId">The identifier of the coordinate system that the new DbGeometry value should use.</param>
906         /// <returns>A new DbGeometry value as defined by the GML value with the specified coordinate system identifier (SRID).</returns>
907         /// <exception cref="ArgumentNullException"><paramref name="geometryMarkup"/> is null.</exception>
908         /// <exception cref="ArgumentException"><paramref name="coordinateSystemId"/> is not valid.</exception>
909         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gml")]
910         public abstract DbGeometry GeometryFromGml(string geometryMarkup, int coordinateSystemId);
911
912         #endregion
913
914         #region Geometry Instance Property Accessors
915
916         /// </summary>
917         /// Gets the coordinate system id (SRID) of the coordinate system used by the given <see cref="DbGeometry"/> value.
918         /// </summary>
919         /// <param name="geometryValue">The geometry value from which the coordinate system id should be retrieved.</param>
920         /// <returns>The integer coordinate system id value from <paramref name="geometryValue"/>.</returns>
921         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
922         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
923         public abstract int GetCoordinateSystemId(DbGeometry geometryValue);
924
925         /// </summary>
926         /// Gets the boundary of the given <see cref="DbGeometry"/> value.
927         /// </summary>
928         /// <param name="geometryValue">The geometry value from which the Boundary value should be retrieved.</param>
929         /// <returns>The boundary of <paramref name="geometryValue"/>, as a <see cref="DbGeometry"/> value.</returns>
930         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
931         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
932         public abstract DbGeometry GetBoundary(DbGeometry geometryValue);
933
934         /// <summary>
935         /// Gets the dimension of the given <see cref="DbGeometry"/> value or, if the value is a collections, the largest element dimension.
936         /// </summary>
937         /// <param name="geometryValue">The geometry value for which the dimension value should be retrieved.</param>
938         /// <returns>The dimension of <paramref name="geometryValue"/>, or the largest element dimension if <see cref="DbGeometry"/> is a collection.</returns>
939         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
940         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
941         public abstract int GetDimension(DbGeometry geometryValue);
942
943         /// <summary>
944         /// Gets the envelope (minimum bounding box) of the given <see cref="DbGeometry"/> value, as a geometry value.
945         /// </summary>
946         /// <param name="geometryValue">The geometry value for which the envelope value should be retrieved.</param>
947         /// <returns>The envelope of <paramref name="geometryValue"/>, as a <see cref="DbGeometry"/> value.</returns>
948         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
949         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
950         public abstract DbGeometry GetEnvelope(DbGeometry geometryValue);
951
952         /// </summary>
953         /// Gets the spatial type name, as a string, of the given <see cref="DbGeometry"/> value.
954         /// </summary>
955         /// <param name="geometryValue">The geometry value from which the spatial type name should be retrieved.</param>
956         /// <returns>The string spatial type name from <paramref name="geometryValue"/>.</returns>
957         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
958         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
959         public abstract string GetSpatialTypeName(DbGeometry geometryValue);
960
961         /// </summary>
962         /// Gets a Boolean value indicating whether the given <see cref="DbGeometry"/> value represents the empty geometry.
963         /// </summary>
964         /// <param name="geometryValue">The geometry value from which the IsEmpty property should be retrieved.</param>
965         /// <returns><c>true</c> if <paramref name="geometryValue"/> represents the empty geometry; otherwise <c>false</c>.</returns>
966         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
967         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
968         public abstract bool GetIsEmpty(DbGeometry geometryValue);
969
970         /// </summary>
971         /// Gets a Boolean value indicating whether the given <see cref="DbGeometry"/> value is simple, according to the conditions required for its geometry type.
972         /// </summary>
973         /// <param name="geometryValue">The geometry value from which the IsSimple property should be retrieved.</param>
974         /// <returns><c>true</c> if <paramref name="geometryValue"/> satisifies the conditions required for an instance of its geometry type to be considered simple; otherwise <c>false</c>.</returns>
975         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
976         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
977         public abstract bool GetIsSimple(DbGeometry geometryValue);
978
979         /// </summary>
980         /// Gets a Boolean value indicating whether the given <see cref="DbGeometry"/> value is valid.
981         /// </summary>
982         /// <param name="geometryValue">The geometry value from which the IsValid property should be retrieved.</param>
983         /// <returns><c>true</c> if <paramref name="geometryValue"/> is considered valid; otherwise <c>false</c>.</returns>
984         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
985         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
986         public abstract bool GetIsValid(DbGeometry geometryValue);
987
988         #endregion
989
990         #region Geometry Well Known Format Conversion
991
992         /// <summary>
993         /// Gets the well known text representation of the given <see cref="DbGeometry"/> value, including only X and Y coordinates for points.
994         /// </summary>
995         /// <param name="geometryValue">The geometry value for which the well known text should be generated.</param>
996         /// <returns>A string containing the well known text representation of <paramref name="geometryValue"/></returns>
997         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
998         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
999         public abstract string AsText(DbGeometry geometryValue);
1000
1001         /// <summary>
1002         /// Gets the well known text representation of the given <see cref="DbGeometry"/> value, including X coordinate, Y coordinate, Elevation (Z) and Measure (M) for points.
1003         /// </summary>
1004         /// <param name="geometryValue">The geometry value for which the well known text should be generated.</param>
1005         /// <returns>A string containing the well known text representation of <paramref name="geometryValue"/></returns>
1006         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1007         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1008         public virtual string AsTextIncludingElevationAndMeasure(DbGeometry geometryValue)
1009         {
1010             return null;
1011         }
1012
1013         /// <summary>
1014         /// Gets the well known binary representation of the given <see cref="DbGeometry"/> value.
1015         /// </summary>
1016         /// <param name="geometryValue">The geometry value for which the well known binary should be generated.</param>
1017         /// <returns>A byte[] containing the well known binary representation of <paramref name="geometryValue"/></returns>
1018         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1019         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1020         public abstract byte[] AsBinary(DbGeometry geometryValue);
1021
1022         // Non-OGC
1023         /// <summary>
1024         /// Generates the Geography Markup Language (GML) representation of this <see cref="DbGeometry"/> value.
1025         /// </summary>
1026         /// <param name="geometryValue">The geometry value for which the GML should be generated.</param>
1027         /// <returns>A string containing the GML representation of this DbGeometry value.</returns>
1028         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1029         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception> 
1030         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gml")]
1031         public abstract string AsGml(DbGeometry geometryValue);
1032
1033         #endregion
1034
1035         #region Geometry Instance Methods - Spatial Relation
1036
1037         /// <summary>
1038         /// Determines whether the two given <see cref="DbGeometry"/> values are spatially equal.
1039         /// </summary>
1040         /// <param name="geometryValue">The first geometry value to compare for equality.</param>
1041         /// <param name="otherGeometry">The second geometry value to compare for equality.</param>
1042         /// <returns><c>true</c> if <paramref name="geometryValue"/> is spatially equal to <paramref name="otherGeometry"/>; otherwise <c>false</c>.</returns>
1043         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is null.</exception>
1044         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is not compatible with this spatial services implementation.</exception>
1045         public abstract bool SpatialEquals(DbGeometry geometryValue, DbGeometry otherGeometry);
1046
1047         /// <summary>
1048         /// Determines whether the two given <see cref="DbGeometry"/> values are spatially disjoint.
1049         /// </summary>
1050         /// <param name="geometryValue">The first geometry value to compare for disjointness.</param>
1051         /// <param name="otherGeometry">The second geometry value to compare for disjointness.</param>
1052         /// <returns><c>true</c> if <paramref name="geometryValue"/> is disjoint from <paramref name="otherGeometry"/>; otherwise <c>false</c>.</returns>
1053         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is null.</exception>
1054         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is not compatible with this spatial services implementation.</exception>         
1055         public abstract bool Disjoint(DbGeometry geometryValue, DbGeometry otherGeometry);
1056
1057         /// <summary>
1058         /// Determines whether the two given <see cref="DbGeometry"/> values spatially intersect.
1059         /// </summary>
1060         /// <param name="geometryValue">The first geometry value to compare for intersection.</param>
1061         /// <param name="otherGeometry">The second geometry value to compare for intersection.</param>
1062         /// <returns><c>true</c> if <paramref name="geometryValue"/> intersects <paramref name="otherGeometry"/>; otherwise <c>false</c>.</returns>
1063         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is null.</exception>
1064         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is not compatible with this spatial services implementation.</exception> 
1065         public abstract bool Intersects(DbGeometry geometryValue, DbGeometry otherGeometry);
1066
1067         /// <summary>
1068         /// Determines whether the two given <see cref="DbGeometry"/> values spatially touch.
1069         /// </summary>
1070         /// <param name="geometryValue">The first geometry value.</param>
1071         /// <param name="otherGeometry">The second geometry value.</param>
1072         /// <returns><c>true</c> if <paramref name="geometryValue"/> touches <paramref name="otherGeometry"/>; otherwise <c>false</c>.</returns>
1073         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is null.</exception>
1074         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is not compatible with this spatial services implementation.</exception> 
1075         public abstract bool Touches(DbGeometry geometryValue, DbGeometry otherGeometry);
1076
1077         /// <summary>
1078         /// Determines whether the two given <see cref="DbGeometry"/> values spatially cross.
1079         /// </summary>
1080         /// <param name="geometryValue">The first geometry value.</param>
1081         /// <param name="otherGeometry">The second geometry value.</param>
1082         /// <returns><c>true</c> if <paramref name="geometryValue"/> crosses <paramref name="otherGeometry"/>; otherwise <c>false</c>.</returns>
1083         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is null.</exception>
1084         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is not compatible with this spatial services implementation.</exception> 
1085         public abstract bool Crosses(DbGeometry geometryValue, DbGeometry otherGeometry);
1086
1087         /// <summary>
1088         /// Determines whether one <see cref="DbGeometry"/> value is spatially within the other.
1089         /// </summary>
1090         /// <param name="geometryValue">The first geometry value.</param>
1091         /// <param name="otherGeometry">The second geometry value.</param>
1092         /// <returns><c>true</c> if <paramref name="geometryValue"/> is within <paramref name="otherGeometry"/>; otherwise <c>false</c>.</returns>
1093         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is null.</exception>
1094         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is not compatible with this spatial services implementation.</exception>
1095         public abstract bool Within(DbGeometry geometryValue, DbGeometry otherGeometry);
1096
1097         /// <summary>
1098         /// Determines whether one <see cref="DbGeometry"/> value spatially contains the other.
1099         /// </summary>
1100         /// <param name="geometryValue">The first geometry value.</param>
1101         /// <param name="otherGeometry">The second geometry value.</param>
1102         /// <returns><c>true</c> if <paramref name="geometryValue"/> contains <paramref name="otherGeometry"/>; otherwise <c>false</c>.</returns>
1103         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is null.</exception>
1104         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is not compatible with this spatial services implementation.</exception> 
1105         public abstract bool Contains(DbGeometry geometryValue, DbGeometry otherGeometry);
1106
1107         /// <summary>
1108         /// Determines whether the two given <see cref="DbGeometry"/> values spatially overlap.
1109         /// </summary>
1110         /// <param name="geometryValue">The first geometry value.</param>
1111         /// <param name="otherGeometry">The second geometry value.</param>
1112         /// <returns><c>true</c> if <paramref name="geometryValue"/> overlaps <paramref name="otherGeometry"/>; otherwise <c>false</c>.</returns>
1113         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is null.</exception>
1114         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is not compatible with this spatial services implementation.</exception> 
1115         public abstract bool Overlaps(DbGeometry geometryValue, DbGeometry otherGeometry);
1116
1117         /// <summary>
1118         /// Determines whether the two given <see cref="DbGeometry"/> values are spatially related according to the
1119         /// given Dimensionally Extended Nine-Intersection Model (DE-9IM) intersection pattern.
1120         /// </summary>
1121         /// <param name="geometryValue">The first geometry value.</param>
1122         /// <param name="otherGeometry">The geometry value that should be compared with the first geometry value for relation.</param>
1123         /// <param name="matrix">A string that contains the text representation of the (DE-9IM) intersection pattern that defines the relation.</param>
1124         /// <returns><c>true</c> if this <paramref name="geometryValue"/> value relates to <paramref name="otherGeometry"/> according to the specified intersection pattern matrix; otherwise <c>false</c>.</returns>
1125         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/>, <paramref name="otherGeometry"/> or <paramref name="matrix"/> is null.</exception>
1126         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is not compatible with this spatial services implementation.</exception> 
1127         public abstract bool Relate(DbGeometry geometryValue, DbGeometry otherGeometry, string matrix);
1128
1129         #endregion
1130
1131         #region Geometry Instance Methods - Spatial Analysis
1132
1133         /// <summary>
1134         /// Creates a geometry value representing all points less than or equal to <paramref name="distance"/> from the given <see cref="DbGeometry"/> value.
1135         /// </summary>
1136         /// <param name="geometryValue">The geometry value.</param>
1137         /// <param name="distance">A double value specifying how far from <paramref name="geometryValue"/> to buffer.</param>
1138         /// <returns>A new DbGeometry value representing all points less than or equal to <paramref name="distance"/> from <paramref name="geometryValue"/>.</returns>
1139         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1140         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1141         public abstract DbGeometry Buffer(DbGeometry geometryValue, double distance);
1142
1143         /// <summary>
1144         /// Computes the distance between the closest points in two <see cref="DbGeometry"/> values.
1145         /// </summary>
1146         /// <param name="geometryValue">The first geometry value.</param>
1147         /// <param name="otherGeometry">The second geometry value.</param>
1148         /// <returns>A double value that specifies the distance between the two closest points in <paramref name="geometryValue"/> and <paramref name="otherGeometry"/>.</returns>
1149         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is null.</exception>
1150         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is not compatible with this spatial services implementation.</exception> 
1151         public abstract double Distance(DbGeometry geometryValue, DbGeometry otherGeometry);
1152
1153         /// </summary>
1154         /// Gets the convex hull of the given <see cref="DbGeometry"/> value.
1155         /// </summary>
1156         /// <param name="geometryValue">The geometry value for which the convex hull should be computed.</param>
1157         /// <returns>A new DbGeometry value that contains the convex hull of <paramref name="geometryValue"/>.</returns>
1158         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1159         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1160         public abstract DbGeometry GetConvexHull(DbGeometry geometryValue);
1161
1162         /// <summary>
1163         /// Computes the intersection of two <see cref="DbGeometry"/> values.
1164         /// </summary>
1165         /// <param name="geometryValue">The first geometry value.</param>
1166         /// <param name="otherGeometry">The second geometry value.</param>
1167         /// <returns>A new DbGeometry value representing the intersection of <paramref name="geometryValue"/> and <paramref name="otherGeometry"/>.</returns>
1168         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is null.</exception>
1169         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is not compatible with this spatial services implementation.</exception>
1170         public abstract DbGeometry Intersection(DbGeometry geometryValue, DbGeometry otherGeometry);
1171
1172         /// <summary>
1173         /// Computes the union of two <see cref="DbGeometry"/> values.
1174         /// </summary>
1175         /// <param name="geometryValue">The first geometry value.</param>
1176         /// <param name="otherGeometry">The second geometry value.</param>
1177         /// <returns>A new DbGeometry value representing the union of <paramref name="geometryValue"/> and <paramref name="otherGeometry"/>.</returns>
1178         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is null.</exception>
1179         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is not compatible with this spatial services implementation.</exception>
1180         public abstract DbGeometry Union(DbGeometry geometryValue, DbGeometry otherGeometry);
1181
1182         /// <summary>
1183         /// Computes the difference between two <see cref="DbGeometry"/> values.
1184         /// </summary>
1185         /// <param name="geometryValue">The first geometry value.</param>
1186         /// <param name="otherGeometry">The second geometry value.</param>
1187         /// <returns>A new DbGeometry value representing the difference between <paramref name="geometryValue"/> and <paramref name="otherGeometry"/>.</returns>
1188         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is null.</exception>
1189         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is not compatible with this spatial services implementation.</exception>
1190         public abstract DbGeometry Difference(DbGeometry geometryValue, DbGeometry otherGeometry);
1191
1192         /// <summary>
1193         /// Computes the symmetric difference between two <see cref="DbGeometry"/> values.
1194         /// </summary>
1195         /// <param name="geometryValue">The first geometry value.</param>
1196         /// <param name="otherGeometry">The second geometry value.</param>
1197         /// <returns>A new DbGeometry value representing the symmetric difference between <paramref name="geometryValue"/> and <paramref name="otherGeometry"/>.</returns>
1198         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is null.</exception>
1199         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> or <paramref name="otherGeometry"/> is not compatible with this spatial services implementation.</exception>
1200         public abstract DbGeometry SymmetricDifference(DbGeometry geometryValue, DbGeometry otherGeometry);
1201
1202         #endregion
1203
1204         #region Geometry Collection
1205
1206         /// <summary>
1207         /// Returns the number of elements in the given <see cref="DbGeometry"/> value, if it represents a geometry collection.
1208         /// <param name="geometryValue">The geometry value, which need not represent a geometry collection.</param>
1209         /// <returns>The number of elements in <paramref name="geometryValue"/>, if it represents a collection of other geometry values; otherwise <c>null</c>.</returns>
1210         /// </summary>
1211         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1212         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1213         public abstract int? GetElementCount(DbGeometry geometryValue);
1214
1215         /// <summary>
1216         /// Returns an element of the given <see cref="DbGeometry"/> value, if it represents a geometry collection.
1217         /// <param name="geometryValue">The geometry value, which need not represent a geometry collection.</param>
1218         /// <param name="index">The position within the geometry value from which the element should be taken.</param>
1219         /// <returns>The element in <paramref name="geometryValue"/> at position <paramref name="index"/>, if it represents a collection of other geometry values; otherwise <c>null</c>.</returns>
1220         /// </summary>
1221         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1222         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1223         public abstract DbGeometry ElementAt(DbGeometry geometryValue, int index);
1224
1225         #endregion
1226
1227         #region Point
1228
1229         /// <summary>
1230         /// Returns the X coordinate of the given <see cref="DbGeometry"/> value, if it represents a point.
1231         /// <param name="geometryValue">The geometry value, which need not represent a point.</param>
1232         /// <returns>The X coordinate of <paramref name="geometryValue"/>, if it represents a point; otherwise <c>null</c>.</returns>
1233         /// </summary>
1234         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1235         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1236         public abstract double? GetXCoordinate(DbGeometry geometryValue);
1237
1238         /// <summary>
1239         /// Returns the Y coordinate of the given <see cref="DbGeometry"/> value, if it represents a point.
1240         /// <param name="geometryValue">The geometry value, which need not represent a point.</param>
1241         /// <returns>The Y coordinate of <paramref name="geometryValue"/>, if it represents a point; otherwise <c>null</c>.</returns>
1242         /// </summary>
1243         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1244         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1245         public abstract double? GetYCoordinate(DbGeometry geometryValue);
1246
1247         /// <summary>
1248         /// Returns the elevation (Z) of the given <see cref="DbGeometry"/> value, if it represents a point.
1249         /// <param name="geometryValue">The geometry value, which need not represent a point.</param>
1250         /// <returns>The elevation (Z) of <paramref name="geometryValue"/>, if it represents a point; otherwise <c>null</c>.</returns>
1251         /// </summary>
1252         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1253         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1254          public abstract double? GetElevation(DbGeometry geometryValue);
1255
1256         /// <summary>
1257         /// Returns the M (Measure) coordinate of the given <see cref="DbGeometry"/> value, if it represents a point.
1258         /// <param name="geometryValue">The geometry value, which need not represent a point.</param>
1259         /// <returns>The M (Measure) coordinate of <paramref name="geometryValue"/>, if it represents a point; otherwise <c>null</c>.</returns>
1260         /// </summary>
1261         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1262         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1263         public abstract double? GetMeasure(DbGeometry geometryValue);
1264
1265         #endregion
1266
1267         #region Curve
1268
1269         /// <summary>
1270         /// Returns a nullable double value that indicates the length of the given <see cref="DbGeometry"/> value, which may be null if the value does not represent a curve.
1271         /// <param name="geometryValue">The geometry value, which need not represent a curve.</param>
1272         /// <returns>The length of <paramref name="geometryValue"/>, if it represents a curve; otherwise <c>null</c>.</returns>
1273         /// </summary>
1274         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1275         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1276         public abstract double? GetLength(DbGeometry geometryValue);
1277
1278         /// <summary>
1279         /// Returns a <see cref="DbGeometry"/> value that represents the start point of the given DbGeometry value, which may be null if the value does not represent a curve.
1280         /// <param name="geometryValue">The geometry value, which need not represent a curve.</param>
1281         /// <returns>The start point of <paramref name="geometryValue"/>, if it represents a curve; otherwise <c>null</c>.</returns>
1282         /// </summary>
1283         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1284         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1285         public abstract DbGeometry GetStartPoint(DbGeometry geometryValue);
1286
1287         /// <summary>
1288         /// Returns a <see cref="DbGeometry"/> value that represents the end point of the given DbGeometry value, which may be null if the value does not represent a curve.
1289         /// <param name="geometryValue">The geometry value, which need not represent a curve.</param>
1290         /// <returns>The end point of <paramref name="geometryValue"/>, if it represents a curve; otherwise <c>null</c>.</returns>
1291         /// </summary>
1292         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1293         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1294         public abstract DbGeometry GetEndPoint(DbGeometry geometryValue);
1295
1296         /// <summary>
1297         /// Returns a nullable Boolean value that whether the given <see cref="DbGeometry"/> value is closed, which may be null if the value does not represent a curve.
1298         /// <param name="geometryValue">The geometry value, which need not represent a curve.</param>
1299         /// <returns><c>true</c> if <paramref name="geometryValue"/> represents a closed curve; <c>false</c> if <paramref name="geometryValue"/> represents a curve that is not closed; otherwise <c>null</c>.</returns>
1300         /// </summary>
1301         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1302         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1303         public abstract bool? GetIsClosed(DbGeometry geometryValue);
1304
1305         /// <summary>
1306         /// Returns a nullable Boolean value that whether the given <see cref="DbGeometry"/> value is a ring, which may be null if the value does not represent a curve.
1307         /// <param name="geometryValue">The geometry value, which need not represent a curve.</param>
1308         /// <returns><c>true</c> if <paramref name="geometryValue"/> represents a ring; <c>false</c> if <paramref name="geometryValue"/> represents a curve that is not a ring; otherwise <c>null</c>.</returns>
1309         /// </summary>
1310         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1311         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1312         public abstract bool? GetIsRing(DbGeometry geometryValue);
1313
1314         #endregion
1315
1316         #region LineString, Line, LinearRing
1317
1318         /// <summary>
1319         /// Returns the number of points in the given <see cref="DbGeometry"/> value, if it represents a linestring or linear ring.
1320         /// <param name="geometryValue">The geometry value, which need not represent a linestring or linear ring.</param>
1321         /// <returns>The number of elements in <paramref name="geometryValue"/>, if it represents a linestring or linear ring; otherwise <c>null</c>.</returns>
1322         /// </summary>
1323         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1324         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1325         public abstract int? GetPointCount(DbGeometry geometryValue);
1326
1327         /// <summary>
1328         /// Returns a point element of the given <see cref="DbGeometry"/> value, if it represents a linestring or linear ring.
1329         /// <param name="geometryValue">The geometry value, which need not represent a linestring or linear ring.</param>
1330         /// <param name="index">The position within the geometry value from which the element should be taken.</param>
1331         /// <returns>The point in <paramref name="geometryValue"/> at position <paramref name="index"/>, if it represents a linestring or linear ring; otherwise <c>null</c>.</returns>
1332         /// </summary>
1333         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1334         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1335         public abstract DbGeometry PointAt(DbGeometry geometryValue, int index);
1336
1337         #endregion
1338
1339         #region Surface
1340
1341         /// <summary>
1342         /// Returns a nullable double value that indicates the area of the given <see cref="DbGeometry"/> value, which may be null if the value does not represent a surface.
1343         /// <param name="geometryValue">The geometry value, which need not represent a surface.</param>
1344         /// <returns>The area of <paramref name="geometryValue"/>, if it represents a surface; otherwise <c>null</c>.</returns>
1345         /// </summary>
1346         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1347         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1348         public abstract double? GetArea(DbGeometry geometryValue);
1349
1350         /// <summary>
1351         /// Returns a <see cref="DbGeometry"/> value that represents the centroid of the given DbGeometry value, which may be null if the value does not represent a surface.
1352         /// <param name="geometryValue">The geometry value, which need not represent a surface.</param>
1353         /// <returns>The centroid of <paramref name="geometryValue"/>, if it represents a surface; otherwise <c>null</c>.</returns>
1354         /// </summary>
1355         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1356         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1357         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Centroid", Justification = "Naming convention prescribed by OGC specification")]
1358         public abstract DbGeometry GetCentroid(DbGeometry geometryValue);
1359
1360         /// <summary>
1361         /// Returns a <see cref="DbGeometry"/> value that represents a point on the surface of the given DbGeometry value, which may be null if the value does not represent a surface.
1362         /// <param name="geometryValue">The geometry value, which need not represent a surface.</param>
1363         /// <returns>A DbGeometry value representing a point on <paramref name="geometryValue"/>, if it represents a surface; otherwise <c>null</c>.</returns>
1364         /// </summary>
1365         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1366         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1367         public abstract DbGeometry GetPointOnSurface(DbGeometry geometryValue);
1368
1369         #endregion
1370
1371         #region Polygon
1372
1373         /// <summary>
1374         /// Returns a <see cref="DbGeometry"/> value that represents the exterior ring of the given DbGeometry value, which may be null if the value does not represent a polygon.
1375         /// <param name="geometryValue">The geometry value, which need not represent a polygon.</param>
1376         /// <returns>A DbGeometry value representing the exterior ring on <paramref name="geometryValue"/>, if it represents a polygon; otherwise <c>null</c>.</returns>
1377         /// </summary>
1378         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1379         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1380         public abstract DbGeometry GetExteriorRing(DbGeometry geometryValue);
1381
1382         /// <summary>
1383         /// Returns the number of interior rings in the given <see cref="DbGeometry"/> value, if it represents a polygon.
1384         /// <param name="geometryValue">The geometry value, which need not represent a polygon.</param>
1385         /// <returns>The number of elements in <paramref name="geometryValue"/>, if it represents a polygon; otherwise <c>null</c>.</returns>
1386         /// </summary>
1387         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1388         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1389         public abstract int? GetInteriorRingCount(DbGeometry geometryValue);
1390
1391         /// <summary>
1392         /// Returns an interior ring from the the given <see cref="DbGeometry"/> value, if it represents a polygon.
1393         /// <param name="geometryValue">The geometry value, which need not represent a polygon.</param>
1394         /// <param name="index">The position within the geometry value from which the element should be taken.</param>
1395         /// <returns>The interior ring in <paramref name="geometryValue"/> at position <paramref name="index"/>, if it represents a polygon; otherwise <c>null</c>.</returns>
1396         /// </summary>
1397         /// <exception cref="ArgumentNullException"><paramref name="geometryValue"/> is null.</exception>
1398         /// <exception cref="ArgumentException"><paramref name="geometryValue"/> is not compatible with this spatial services implementation.</exception>
1399         public abstract DbGeometry InteriorRingAt(DbGeometry geometryValue, int index);
1400
1401         #endregion
1402
1403         #endregion
1404     }
1405 }