DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
SpatialType.cs
Go to the documentation of this file.
1 using System;
2 
3 using Deveel.Data.Types;
4 
5 namespace Deveel.Data.Spatial {
6  public sealed class SpatialType : SqlType {
7  public SpatialType()
8  : this(-1) {
9  }
10 
11  public SpatialType(int srid)
12  : base("GEOMETRY", SqlTypeCode.Type) {
13  Srid = srid;
14  }
15 
16  public int Srid { get; private set; }
17 
18  public override bool IsComparable(SqlType type) {
19  var otherType = type as SpatialType;
20  if (otherType == null)
21  return false;
22 
23  return IsComparable(otherType);
24  }
25 
26  public bool IsComparable(SpatialType other) {
27  // TODO: Is this a good assumption?
28  return Srid.Equals(other.Srid);
29  }
30 
31  public static SpatialType Geometry(int srid) {
32  return new SpatialType(srid);
33  }
34 
35  public static SpatialType Geometry() {
36  return Geometry(-1);
37  }
38  }
39 }
bool IsComparable(SpatialType other)
Definition: SpatialType.cs:26
static SpatialType Geometry(int srid)
Definition: SpatialType.cs:31
static SpatialType Geometry()
Definition: SpatialType.cs:35
override bool IsComparable(SqlType type)
Verifies if a given SqlType is comparable to this data-type.
Definition: SpatialType.cs:18
Defines the properties of a specific SQL Type and handles the values compatible.
Definition: SqlType.cs:33
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
Definition: SqlTypeCode.cs:23