how to avoid the EF Spatial type wkt conversion?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
christian_bertram
Posts: 16
Joined: Mon 22 Jun 2015 08:38

how to avoid the EF Spatial type wkt conversion?

Post by christian_bertram » Wed 21 Oct 2015 07:59

Hi. I´m working with the dotConnect provider and oracle spatial SDO_GEOMETRY types.

The SQL select part for a spatial type generated by dotConnect looks something like this:

Code: Select all

SDO_UTIL.TO_WKTGEOMETRY("Extent2".SDO_GEOM) AS SDO_GEOM
I´m using the SpatialServiceType NetTopologySuite.

So it emediately converts the type to his wkt representation. With big polygons this takes a long time.
In most cases i dont want the provider to convert the SDO_GEOMETRY to his wkt representation. I only want the business data. Of course i could modify the select to receive an anonymous object without the spatial column but i want to work with my business class object.

Is there a way to avoid the automatic conversion ? Maybe by changing the configuration before and after a select ?

And i have a second question:
i cant find the configuration option

Code: Select all

config.SpatialOptions.AlwaysUseGeometryDefaultSrid 
It is not inside my library, but i have the newest version of dotConnect
It is mentioned in this article:
http://blog.devart.com/enhanced-entity- ... resql.html

Thanks.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: how to avoid the EF Spatial type wkt conversion?

Post by Shalex » Thu 22 Oct 2015 14:51

christian_bertram wrote:In most cases i dont want the provider to convert the SDO_GEOMETRY to his wkt representation. I only want the business data.
We recommend you to implement Table Splitting: http://www.devart.com/entitydeveloper/e ... eloper.chm > ORM Support > Entity Framework > Concepts > Working with Classes > Table Splitting. Table Splitting can be easily (no manual editing of edml) made in Entity Developer: drag&drop particular (unnecessary) SDO_GEOMETRY properties from table on the diagram surface and choose Table Splitting in the dialog.
christian_bertram wrote:i cant find the configuration option

Code: Select all

config.SpatialOptions.AlwaysUseGeometryDefaultSrid 
Thank you for your report. We will investigate the issue and notify you about the result.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: how to avoid the EF Spatial type wkt conversion?

Post by Shalex » Thu 17 Dec 2015 16:55

The bug with availability of the config.SpatialOptions.AlwaysUseGeometryDefaultSrid option in \Entity\EF5\Devart.Data.Oracle.Entity.dll and \Entity\EF6\Devart.Data.Oracle.Entity.dll is fixed in the newest (8.5.558) build of dotConnect for Oracle: http://forums.devart.com/viewtopic.php?f=1&t=32924.

christian_bertram
Posts: 16
Joined: Mon 22 Jun 2015 08:38

Re: how to avoid the EF Spatial type wkt conversion?

Post by christian_bertram » Mon 28 Dec 2015 09:50

thanks, i will try it .

Post Reply