.NET 4.5 Beta DbGeography NotImplementedException

DefaultSpatialServices in Entity Framework are using SqlGeography and SqlGeometry types as backing types. These two types live in Microsoft.SqlServer.Types.dll assembly that is not part of the .NET Framework. The exception is thrown when EF cannot find these types (the exception could be more helpful…). When you install Visual Studio it will install localdb on your … Read more

sql geography to dbgeography?

Sorry for the late response – but saw this whilst searching for something else. Simply do the following: SqlGeography theGeography; int srid = 4326; // or alternative DbGeography newGeography = DbGeography.FromText(theGeography.ToString(), srid); To reverse it: DbGeography theGeography; SqlGeography newGeography = SqlGeography.Parse(theGeography.AsText()).MakeValid(); Hope that helps!

What’s the best way to store co-ordinates (longitude/latitude, from Google Maps) in SQL Server?

Fair Warning! Before taking the advice to use the GEOGRAPHY type, make sure you are not planning on using Linq or Entity Framework to access the data because it’s not supported (as of November 2010) and you will be sad! Update Jul 2017 For those reading this answer now, it is obsolete as it refers … Read more

Python: find contour lines from matplotlib.pyplot.contour()

You can get the vertices back by looping over collections and paths and using the iter_segments() method of matplotlib.path.Path. Here’s a function that returns the vertices as a set of nested lists of contour lines, contour sections and arrays of x,y vertices: import numpy as np def get_contour_verts(cn): contours = [] # for each contour … Read more