dotConnect for Oracle Documentation
Spatials Comparison

MDSYS.SDO_GEOMETRY is an Oracle object type and it cannot be compared with the '=' operator, like:
(GeometryColumn=AnotherGeometryColumn OR GeometryColumn=:pGeometryParameter)

Oracle offers different ways to compare spatial data, however, not all of them are available in different versions of Oracle Spatial and Oracle Locator. You can see more details in SDO_GEOM Package (Geometry) and Spatial Operators topics of Oracle documentation.

Here is an example, demonstrating setting the comparison method:

var config = OracleEntityProviderConfig.Instance;
config.SpatialOptions.ComparisonMethod = SpatialComparisonMethod.SdoRelate;

Dim config = OracleEntityProviderConfig.Instance
config.SpatialOptions.ComparisonMethod = SpatialComparisonMethod.SdoRelate

Alternatively, you may specify the comparison method in the project config file. For this, you need to update or add the configSections element like it is described in the Entity Framework Provider Configuration section and then add the following Devart.Data.Oracle.Entity tag to the configuration tag:

 <Devart.Data.Oracle.Entity xmlns="http://devart.com/schemas/Devart.Data.Oracle.Entity/1.0">
  <SpatialOptions ComparisonMethod="SdoRelate" />
 </Devart.Data.Oracle.Entity>

Note: If you need to set multiple Entity Framework provider options for dotConnect for Oracle, don't add multiple Devart.Data.Oracle.Entity tags. Specify all settings in one Devart.Data.Oracle.Entity tag.

Let's describe the available SpatialComparisonMethod values:

Default

This is the default value. The comparison behaviour depends on the OracleSpatialEngine setting.

OracleSpatialEngine Actually used SpatialComparisonMethod
Default WellKnownValue
Oracle Spatial (any version) SdoGeomRelate
Oracle Locator (Oracle 10g Release 1 and 9i) SdoRelate
Oracle Locator (Oracle 10g Release 2 and higher) WellKnownValue

SdoRelate

SDO_RELATE spatial operator is used when possible. If the first spatial expression is a table column, SDO_RELATE spatial operator is used. Otherwise, WellKnownValue comparison is used (see below).

Pros:

Cons:

WellKnownValue or DatabaseWellKnownValue

Values are compared as WKT or WKB. In case of WellKnownValue, server-side value reconvertion is performed. In case of DatabaseWellKnownValue, WKT and WKB values are compared as is, without reconvertion.

It's better to use DatabaseWellKnownValue when working with WKB/WKT spatial services, when spatial values are the same on the server and client sides. In such case there is no need for reconvertion, and performance is better.

Pros:

Cons:

SdoGeomRelate

SDO_GEOM.RELATE package function is used.

Pros:

Cons:

See Also

Choosing Spatial Service  | Default SRID  | Tolerance  | Area and Distance Units  | Oracle Spatial Engine  | Spatial Type Name Representation