EF error with DbGeography and SRID 104001

516 Views Asked by At

Database table:

,[Location] GEOGRAPHY

Update Location with EF using SRID 104001

item.Location = System.Data.Entity.Spatial.DbGeography.PointFromText($"Point({loc.Lng} {loc.Lat})", 104001);

Exception:

24204: The spatial reference identifier (SRID) is not valid. The specified SRID must match one of the supported SRIDs displayed in the sys.spatial_reference_systems catalog view.

Database check:

SELECT * FROM sys.spatial_reference_systems WHERE spatial_reference_id = 104001

104001  Microsoft   104001  GEOGCS["Unit Sphere", DATUM["Unit Sphere", SPHEROID["Sphere", 1.0, 0.0]], PRIMEM["Greenwich",0.0], UNIT["Degree", 0.0174532925199433]]  radian  1

Using:

.Net Framework 4.6.1;
Entity Framework 6.1.3;
Microsoft SQL Server 2014 (SP2-GDR) (KB3194714) - 12.0.5203.0 (X64)   Sep 23 2016 18:13:56   Copyright (c) Microsoft Corporation  Standard Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) ;
Database Compatibility level 120
0

There are 0 best solutions below