1 //---------------------------------------------------------------------
2 // <copyright file="DbSpatialServices.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
7 // @backupOwner Microsoft
8 //---------------------------------------------------------------------
10 using System.Data.Common.Utils;
12 namespace System.Data.Spatial
15 /// A provider-independent service API for geospatial (Geometry/Geography) type support.
17 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db")]
19 public abstract class DbSpatialServices
21 private static readonly Singleton<DbSpatialServices> defaultServices = new Singleton<DbSpatialServices>(LoadDefaultServices);
23 public static DbSpatialServices Default
27 return defaultServices.Value;
31 protected DbSpatialServices()
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()
40 if (System.Data.SqlClient.SqlProviderServices.SqlTypesAssemblyIsAvailable)
42 return System.Data.SqlClient.SqlSpatialServices.Instance;
46 return DefaultSpatialServices.Instance;
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.
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)
61 spatialServices.CheckNull("spatialServices");
62 providerValue.CheckNull("providerValue");
63 return new DbGeography(spatialServices, providerValue);
67 /// Creates a new <see cref="DbGeography"/> value based on a provider-specific value that is compatible with this spatial services implementation.
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);
76 /// Creates a provider-specific value compatible with this spatial services implementation based on the specified well known <see cref="DbGeography"/> representation.
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);
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.
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);
92 #region Geography Constructors - well known binary
95 /// Creates a new <see cref="DbGeography"/> value based on the specified well known binary value.
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);
103 /// Creates a new <see cref="DbGeography"/> value based on the specified well known binary value and coordinate system identifier (SRID).
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);
113 /// Creates a new <see cref="DbGeography"/> line value based on the specified well known binary value and coordinate system identifier (SRID).
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);
123 /// Creates a new <see cref="DbGeography"/> point value based on the specified well known binary value and coordinate system identifier (SRID).
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);
133 /// Creates a new <see cref="DbGeography"/> polygon value based on the specified well known binary value and coordinate system identifier (SRID).
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);
143 /// Creates a new <see cref="DbGeography"/> multiline value based on the specified well known binary value and coordinate system identifier (SRID).
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);
157 /// Creates a new <see cref="DbGeography"/> multipoint value based on the specified well known binary value and coordinate system identifier (SRID).
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);
171 /// Creates a new <see cref="DbGeography"/> multipolygon value based on the specified well known binary value and coordinate system identifier (SRID).
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);
183 /// Creates a new <see cref="DbGeography"/> collection value based on the specified well known binary value and coordinate system identifier (SRID).
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);
194 #region Geography Constructors - well known text
197 /// Creates a new <see cref="DbGeography"/> value based on the specified well known text value.
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);
205 /// Creates a new <see cref="DbGeography"/> value based on the specified well known text value and coordinate system identifier (SRID).
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);
215 /// Creates a new <see cref="DbGeography"/> line value based on the specified well known text value and coordinate system identifier (SRID).
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);
225 /// Creates a new <see cref="DbGeography"/> point value based on the specified well known text value and coordinate system identifier (SRID).
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);
235 /// Creates a new <see cref="DbGeography"/> polygon value based on the specified well known text value and coordinate system identifier (SRID).
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);
245 /// Creates a new <see cref="DbGeography"/> multiline value based on the specified well known text value and coordinate system identifier (SRID).
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);
259 /// Creates a new <see cref="DbGeography"/> multipoint value based on the specified well known text value and coordinate system identifier (SRID).
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);
273 /// Creates a new <see cref="DbGeography"/> multipolygon value based on the specified well known text value and coordinate system identifier (SRID).
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);
285 /// Creates a new <see cref="DbGeography"/> collection value based on the specified well known text value and coordinate system identifier (SRID).
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);
296 #region Geography Constructors - Geography Markup Language (GML)
299 /// Creates a new <see cref="DbGeography"/> value based on the specified Geography Markup Language (GML) value.
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);
308 /// Creates a new <see cref="DbGeography"/> value based on the specified Geography Markup Language (GML) value and coordinate system identifier (SRID).
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);
320 #region Geography Instance Property Accessors
323 /// Gets the coordinate system identifier (SRID) of the coordinate system used by the given <see cref="DbGeography"/> value.
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);
332 /// Gets the dimension of the given <see cref="DbGeography"/> value or, if the value is a collections, the largest element dimension.
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);
341 /// Gets the spatial type name, as a string, of the given <see cref="DbGeography"/> value.
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);
350 /// Gets a Boolean value indicating whether the given <see cref="DbGeography"/> value represents the empty geography.
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);
360 #region Geography Well Known Format Conversion
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.
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);
372 /// Gets the well known text representation of the given <see cref="DbGeography"/> value, including Longitude, Latitude, Elevation (Z) and Measure (M) for points.
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)
384 /// Gets the well known binary representation of the given <see cref="DbGeography"/> value.
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);
394 /// Generates the Geography Markup Language (GML) representation of this <see cref="DbGeography"/> value.
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);
405 #region Geography Instance Methods - Spatial Relation
408 /// Determines whether the two given <see cref="DbGeography"/> values are spatially equal.
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);
418 /// Determines whether the two given <see cref="DbGeography"/> values are spatially disjoint.
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);
428 /// Determines whether the two given <see cref="DbGeography"/> values spatially intersect.
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);
439 #region Geography Instance Methods - Spatial Analysis
442 /// Creates a geography value representing all points less than or equal to <paramref name="distance"/> from the given <see cref="DbGeography"/> value.
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);
452 /// Computes the distance between the closest points in two <see cref="DbGeography"/> values.
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);
462 /// Computes the intersection of two <see cref="DbGeography"/> values.
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);
472 /// Computes the union of two <see cref="DbGeography"/> values.
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);
482 /// Computes the difference of two <see cref="DbGeography"/> values.
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);
492 /// Computes the symmetric difference of two <see cref="DbGeography"/> values.
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);
503 #region Geography Collection
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>
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);
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>
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);
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>
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);
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>
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);
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>
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);
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>
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);
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>
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);
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>
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);
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>
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);
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>
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);
606 #region LineString, Line, LinearRing
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>
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);
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>
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);
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>
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);
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.
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)
655 spatialServices.CheckNull("spatialServices");
656 providerValue.CheckNull("providerValue");
657 return new DbGeometry(spatialServices, providerValue);
661 /// Creates a provider-specific value compatible with this spatial services implementation based on the specified well known <see cref="DbGeometry"/> representation.
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);
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.
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);
678 /// Creates a new <see cref="DbGeometry"/> value based on a provider-specific value that is compatible with this spatial services implementation.
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);
686 #region Geometry Constructors - well known binary
689 /// Creates a new <see cref="DbGeometry"/> value based on the specified well known binary value.
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);
697 /// Creates a new <see cref="DbGeometry"/> value based on the specified well known binary value and coordinate system identifier (SRID).
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);
707 /// Creates a new <see cref="DbGeometry"/> line value based on the specified well known binary value and coordinate system identifier (SRID).
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);
717 /// Creates a new <see cref="DbGeometry"/> point value based on the specified well known binary value and coordinate system identifier (SRID).
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);
727 /// Creates a new <see cref="DbGeometry"/> polygon value based on the specified well known binary value and coordinate system identifier (SRID).
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);
737 /// Creates a new <see cref="DbGeometry"/> multiline value based on the specified well known binary value and coordinate system identifier (SRID).
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);
751 /// Creates a new <see cref="DbGeometry"/> multipoint value based on the specified well known binary value and coordinate system identifier (SRID).
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);
765 /// Creates a new <see cref="DbGeometry"/> multipolygon value based on the specified well known binary value and coordinate system identifier (SRID).
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);
777 /// Creates a new <see cref="DbGeometry"/> collection value based on the specified well known binary value and coordinate system identifier (SRID).
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);
788 #region Geometry Constructors - well known text
791 /// Creates a new <see cref="DbGeometry"/> value based on the specified well known text value.
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);
799 /// Creates a new <see cref="DbGeometry"/> value based on the specified well known text value and coordinate system identifier (SRID).
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);
809 /// Creates a new <see cref="DbGeometry"/> line value based on the specified well known text value and coordinate system identifier (SRID).
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);
819 /// Creates a new <see cref="DbGeometry"/> point value based on the specified well known text value and coordinate system identifier (SRID).
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);
829 /// Creates a new <see cref="DbGeometry"/> polygon value based on the specified well known text value and coordinate system identifier (SRID).
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);
839 /// Creates a new <see cref="DbGeometry"/> multiline value based on the specified well known text value and coordinate system identifier (SRID).
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);
853 /// Creates a new <see cref="DbGeometry"/> multipoint value based on the specified well known text value and coordinate system identifier (SRID).
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);
867 /// Creates a new <see cref="DbGeometry"/> multipolygon value based on the specified well known text value and coordinate system identifier (SRID).
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);
879 /// Creates a new <see cref="DbGeometry"/> collection value based on the specified well known text value and coordinate system identifier (SRID).
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);
890 #region Geometry Constructors - Geography Markup Language (GML)
893 /// Creates a new <see cref="DbGeometry"/> value based on the specified Geography Markup Language (GML) value.
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);
902 /// Creates a new <see cref="DbGeometry"/> value based on the specified Geography Markup Language (GML) value and coordinate system identifier (SRID).
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);
914 #region Geometry Instance Property Accessors
917 /// Gets the coordinate system id (SRID) of the coordinate system used by the given <see cref="DbGeometry"/> value.
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);
926 /// Gets the boundary of the given <see cref="DbGeometry"/> value.
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);
935 /// Gets the dimension of the given <see cref="DbGeometry"/> value or, if the value is a collections, the largest element dimension.
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);
944 /// Gets the envelope (minimum bounding box) of the given <see cref="DbGeometry"/> value, as a geometry value.
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);
953 /// Gets the spatial type name, as a string, of the given <see cref="DbGeometry"/> value.
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);
962 /// Gets a Boolean value indicating whether the given <see cref="DbGeometry"/> value represents the empty geometry.
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);
971 /// Gets a Boolean value indicating whether the given <see cref="DbGeometry"/> value is simple, according to the conditions required for its geometry type.
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);
980 /// Gets a Boolean value indicating whether the given <see cref="DbGeometry"/> value is valid.
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);
990 #region Geometry Well Known Format Conversion
993 /// Gets the well known text representation of the given <see cref="DbGeometry"/> value, including only X and Y coordinates for points.
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);
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.
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)
1014 /// Gets the well known binary representation of the given <see cref="DbGeometry"/> value.
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);
1024 /// Generates the Geography Markup Language (GML) representation of this <see cref="DbGeometry"/> value.
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);
1035 #region Geometry Instance Methods - Spatial Relation
1038 /// Determines whether the two given <see cref="DbGeometry"/> values are spatially equal.
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);
1048 /// Determines whether the two given <see cref="DbGeometry"/> values are spatially disjoint.
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);
1058 /// Determines whether the two given <see cref="DbGeometry"/> values spatially intersect.
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);
1068 /// Determines whether the two given <see cref="DbGeometry"/> values spatially touch.
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);
1078 /// Determines whether the two given <see cref="DbGeometry"/> values spatially cross.
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);
1088 /// Determines whether one <see cref="DbGeometry"/> value is spatially within the other.
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);
1098 /// Determines whether one <see cref="DbGeometry"/> value spatially contains the other.
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);
1108 /// Determines whether the two given <see cref="DbGeometry"/> values spatially overlap.
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);
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.
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);
1131 #region Geometry Instance Methods - Spatial Analysis
1134 /// Creates a geometry value representing all points less than or equal to <paramref name="distance"/> from the given <see cref="DbGeometry"/> value.
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);
1144 /// Computes the distance between the closest points in two <see cref="DbGeometry"/> values.
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);
1154 /// Gets the convex hull of the given <see cref="DbGeometry"/> value.
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);
1163 /// Computes the intersection of two <see cref="DbGeometry"/> values.
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);
1173 /// Computes the union of two <see cref="DbGeometry"/> values.
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);
1183 /// Computes the difference between two <see cref="DbGeometry"/> values.
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);
1193 /// Computes the symmetric difference between two <see cref="DbGeometry"/> values.
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);
1204 #region Geometry Collection
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>
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);
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>
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);
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>
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);
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>
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);
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>
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);
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>
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);
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>
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);
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>
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);
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>
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);
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>
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);
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>
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);
1316 #region LineString, Line, LinearRing
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>
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);
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>
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);
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>
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);
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>
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);
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>
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);
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>
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);
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>
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);
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>
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);