BT

Spatial Data Introduced to Entity Framework

by Jenni Konrad on Oct 06, 2011 |

One of the new additions in the Entity Framework June CTP is official support for Spatial data types. There have been workarounds for using these data types for some time, since SQL Server 2008 and onward have included Spatial, but this is the first primitive support in the Entity Data Model (EDM).

The Spatial data type allows developers to represent data that uses a system of coordinates, such as shapes, lines, or points on a map. There are two different types of spatial data that can be used: Geometry and Geography. Geometry describes locations on a flat (i.e. Euclidean) plane, and can be used to determine information such as the shape and area of a polygon. Geography is used for ellipsoidal data (to account for the shape of the Earth), and can refer to items like GPS coordinates. Both Geometry and Geography conform to the Open Geospatial Consortium (OGC) specifications.

Previously, Spatial data would be represented on the client side using the SqlGeography and SqlGeometry types. In Entity Framework the types are DbGeography and DbGeometry, with the eventual goal of supporting other data providers beyond SQL Server. (Currently, non-SQL Server-based uses of Spatial data are limited to basic services such as serialization and deserialization.)

Microsoft’s other goals for Spatial in Entity Framework are:

  • first-class support for the Spatial data type in the Entity Designer
  • a rich programming experience using Entity SQL and LINQ
  • support for Code-first, Database-first, and Model-first approaches

To see Spatial data in Entity Framework in action, please visit the ADO.NET team blog’s Walkthrough, and Jason Follas’ Real World Example.

Hello stranger!

You need to Register an InfoQ account or to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT