-
Notifications
You must be signed in to change notification settings - Fork 224
Spatial Types
Simon Hughes edited this page Mar 20, 2026
·
12 revisions
Enable spatial types (default):
Settings.DisableGeographyTypes = false;Disable spatial types:
Settings.DisableGeographyTypes = true;If
DisableGeographyTypes = trueand a stored procedure contains spatial parameters or return types, that stored procedure will not be generated.
Maps to NetTopologySuite.Geometries.Point / Geometry.
Install NuGet:
Install-Package Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite
Enable in optionsBuilder:
optionsBuilder.UseSqlServer(@"your_connection_string",
x => x.UseNetTopologySuite());Or with DI:
services.AddDbContext<MyDbContext>(options =>
options.UseSqlServer(connectionString, x => x.UseNetTopologySuite()));Maps to System.Data.Entity.Spatial.DbGeography / DbGeometry. No additional NuGet packages are required.