efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Support Spatial Data Types on SQL Server and SQLite

Open vijayantkatyal opened this issue 12 years ago • 320 comments

how to use Spatial Data types (e.g. DbGeography) in model (code-first method) to save points, shapes etc.

e.g.

public DbGeography gps_points {get; set;}

i'm unable to use "DbGeography".

vijayantkatyal avatar Nov 19 '14 03:11 vijayantkatyal

@vijayantkatyal are you asking about EF Core?

rowanmiller avatar Nov 24 '14 19:11 rowanmiller

I have the same Question. I am trying to use the DbGeometry datatype, but it is unavailable with EF Core, neither System.Data.Entity.Spatial nor System.Data.Spatial are referable.

simonseyock avatar Nov 25 '14 15:11 simonseyock

Partially covered by https://github.com/aspnet/EntityFramework/issues/242 but we probably also want to look at built-in support for spatial types.

rowanmiller avatar Nov 26 '14 20:11 rowanmiller

@rowanmiller sorry for late response. yes i'm asking about EF Core.

vijayantkatyal avatar Nov 29 '14 18:11 vijayantkatyal

+100000. We make extensive use of spatial data in our applications.

neil-119 avatar Sep 07 '15 13:09 neil-119

I know you guys aren't working on this at the moment, but what are the chances that you'll be reusing types and concepts from EF6's System.Data.Entity.Spatial namespace?

I'm asking because there's some interest in working on this namespace and I'd like to have an idea (if possible) as to whether that will be useful going forward...

cc @rossini-t

roji avatar Sep 30 '15 16:09 roji

@roji At the moment, I don't think we intend to put a common abstraction over it. Instead we would light-up provider-specific types like SqlGeography leveraging the work of #242.

bricelam avatar Sep 30 '15 22:09 bricelam

OK thanks.

Note that this mean it will no longer be possible to write provider-independent code that manipulates spatial DB values (as was possible in EF6). I have no idea to what extent spatial support across databases (SqlServer, PostGIS, etc.) overlaps, so this may or may not be a big loss.

Then again with the EF Core approach a common spatial abstraction seems to be a problem outside of EF's domain - as long as #242 allows for reading/writing the provider-specific spatial types a common abstraction may or may not be used afterwards.

roji avatar Oct 01 '15 04:10 roji

Any news about Spatial types in EF Core?

balivo avatar Dec 18 '15 19:12 balivo

I'd also love an update -- it's a blocker for EF Core, ASP.NET Core and .Net Core for us. Can't wait to try out the new toys though!

dfaivre avatar Dec 18 '15 20:12 dfaivre

Spatial data type support will happen post initial RTM of EF Core (i.e. after the 7.0.0 release). This is purely due to how much work we can achieve between now and RTM and not because we think this scenario is unimportant.

rowanmiller avatar Dec 22 '15 19:12 rowanmiller

Tks for answer @rowanmiller...

balivo avatar Dec 29 '15 12:12 balivo

it seems we have no way but waiting for next release of EF Core to include and support the Spatial types

BehnamAbdy avatar Feb 25 '16 21:02 BehnamAbdy

Just a vote for basic DbGeography support.

Our application (like many others I am sure) relies on the DbGeography datatype mapping to the geography type in SQL Server.

Very disappointing that an actual datatype, fully supported by EF6, would be de-prioritized for EF Core. There isn't even a mention of it in the roadmap.

Please don't let this one slip through the cracks.

RobertDM avatar Apr 02 '16 20:04 RobertDM

So what can we do now to use spatial types from EF Core? Will creating a type mapper to Well-Known text work?

xperiandri avatar Apr 17 '16 16:04 xperiandri

Also a vote here for some DbGeography support!

Ronan-Farrell avatar May 03 '16 20:05 Ronan-Farrell

Speaking from a PostgreSQL perspective, if and when you do tackle the problem of spatial data it's extremely important to do so with a cross-provider vision. EF6's spatial types, just like most other things in EF6, were designed to work with SqlServer's spatial support and don't necessarily capture what PostgreSQL's PostGIS allows - so a provider-independent abstraction such as DbGeography may not work well here.

Am far from being an expert here but it's important not to rush into this without comparing spatial support in different databases etc.

roji avatar May 03 '16 21:05 roji

Any Timeline to support DbGeography or DbGeometry?

spass2000 avatar Jun 11 '16 06:06 spass2000

It is in the roadmap: https://github.com/aspnet/EntityFramework/wiki/Roadmap

ErikEJ avatar Jun 11 '16 07:06 ErikEJ

"High priority features" means "lowest priority" of the list?

ischas avatar Jun 11 '16 14:06 ischas