BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

Spatial Data Introduced to Entity Framework

| by Jenni Konrad Follow 0 Followers on Oct 06, 2011. Estimated reading time: 1 minute |

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.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login 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

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT