Questions tagged [dbgeography]
19 questions
2
votes
1 answer
NetTopologySuite: calculate length/area of geography
I've been using DbGeography in C# to calculate length and area of WKT geometries (geographies), like this:
var polygon = DbGeography.FromText(wkt, 4326);
var area = polygon.Area;
var line = DbGeography.FromText(wkt2, 4326);
var length =…

Alcibiades
- 335
- 5
- 16
2
votes
1 answer
SQL: MakeValid() not working on type SqlGeography
I'm trying to get the SQL MakeValid() function to work on a geography type but am getting the following error:
Could not find method 'MakeValid' for type 'Microsoft.SqlServer.Types.SqlGeography' in assembly…

NickyLarson
- 127
- 1
- 1
- 12
2
votes
1 answer
Concatenate two C# DbGeography Polygons into a single multipolygon
I have downloaded a map with Swedish districts as Shape files from an official source. I then used QGIS to convert the data into geojson and then converted the geojson to DbGeography like this:
https://stackoverflow.com/a/49225753/3850405
Map…

Ogglas
- 62,132
- 37
- 328
- 418
1
vote
2 answers
DbGeography.FromText - Unable to load DLL 'SqlServerSpatial140.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
I have tried to copy spatial140 from packages folder "\packages\Microsoft.SqlServer.Types...\nativeBinaries", in Visual Studio build is a success, not found some error.
But when run the project, I got that error.

Iqbal Fasyah
- 85
- 1
- 1
- 8
1
vote
1 answer
DbGeography does not work when published to a server
The following code works in my local machine while debugging but throws an error when published to a server.
public IEnumerable Nearby(double latitude, double longitude, double distance)
{
var region =…

Siddanth
- 290
- 3
- 9
1
vote
1 answer
DbGeography Union subtracting instead of combining
I am trying to combine thousands of rectangles into one polygon using DbGeography. For testing, I'm starting with just two rectangles (because the thousands failed with a fullglobe result). When I use the union method of DbGeography, it returns a…

Mikecito
- 2,053
- 11
- 17
0
votes
1 answer
Finding a point on a straight line with DbGeography.Intersect()
I am currently learning about DbGeography in C# and playing around with some functionality.
I have been trying to ascertain whether the Intersects() method will return true for a point lying on a straight line (represented as a LineString…

J.Manifold
- 3
- 2
0
votes
1 answer
Roles user BD Geo Azure without access error 916
In SQL Azure, The roles of the users created in the main database are not replicated or copied to the geo database and generate error 916
enter image description here
Can you help me?
Could you please help me with a solution to this error, so that…
0
votes
1 answer
Snowflake - error converting binary to geography
I am running the following query:
select…

Gabriel
- 488
- 4
- 8
0
votes
1 answer
Can you read additional data strings from Web API POST which are not in the data model?
In Entity Framework I have a DBGeography object:
using System.Data.Entity.Spatial;
...
public DbGeography Location { get; set; }
As I haven't discovered a better way to send a POINT object over JSON, I'm intending to send 'lat' and 'lng' string…

kdpnz
- 638
- 6
- 18
0
votes
1 answer
Bind System.Data.Entity.Spatial.DbGeography to MVC Model
I have an MVC model with a DBGeometry field
[Required(AllowEmptyStrings = false, ErrorMessage = "Location is required")]
public System.Data.Entity.Spatial.DbGeography LocationGps { get; set; } // LocationGPS
Inside my View i have this…

kk_nou
- 103
- 1
- 10
0
votes
1 answer
DbGeography.Distance returned incorrect result
Here is my simplified code:
var P1 = Common.Geography.CreatePoint((decimal)-73.980000, (decimal)40.7155773);
var P2 = Common.Geography.CreatePoint((decimal)-73.984434, (decimal)40.7155773);
var Distance = P1.Distance(P2);
Here is "CreatePoint"…

Ivan Sadovsky
- 37
- 3
0
votes
1 answer
Will System.Data.Spatial DBGeography.Distance() will work with SQL Server 2008?
I am using System.Data.Spatial.DBGeography.Distance() to calculate distance between two DBGeography locations using LINQToSQL, c#. I verified this is working with SQL Server 2012. Can I use same with SQL Server 2008.
Thank you in advance!

Sandeep Padarthy
- 1
- 1
0
votes
1 answer
how use Microsoft.SqlServer.Types in WCF Service Application
I am working on a WCF Service Application. i want to find closest location to someone.
my porblem is when i want call any methods related to System.Data.Entity.Spatial.DbGeography i get this error
"Spatial types and functions are not available for…

Hamed
- 15
- 4
0
votes
1 answer
Removing a radius clause in my dbGeography linq-to-entity statement
How can I remove the 'radius' in my linq-to-entity statement so that it doesn't limit the search to the radius?
FYI - I want my query to search for names that start with the 'term' and search outward starting with the names that are closest to the…

chuckd
- 13,460
- 29
- 152
- 331