Questions tagged [sqlgeography]

The MS SQL Server SqlGeography type represents data in a geodetic (round earth) coordinate system.

264 questions
2
votes
0 answers

Out of memory exception while the build of a GPS trace containing a lot of GPS data

I obtain GPS points of a vehicle in order to build its trace. I develop in C# and use the SqlGeography type (LineString). I store it into a SQL Server database by using the geography type. Each received GPS point is added with the AddLine method…
profou
  • 197
  • 1
  • 17
2
votes
0 answers

EF trying to map SqlGeography instead of DbGeography when using ExecuteReader

Why the Entity Framework binds the same field of Geography type with two different types (SqlGeography and DbGeography) based on way of retrieving data? I recieve an exception when trying to read data by ExecuteReader The specified cast from a…
dsky
  • 55
  • 4
2
votes
2 answers

Cannot read SqlGeography with Dapper

I followed alot of SO questions and I am getting simillar error but I cannot fix this issue. My Dapper version is 1.50.1 My Microsoft.SqlServer.Types version is 11.0.2 I have added binding redirect in configuration file as follows:
Robert
  • 2,407
  • 1
  • 24
  • 35
2
votes
1 answer

ServiceStack OrmLite Not Retrieving SqlGeography Fields

I've following the instructions here to use SqlGeography types with ServiceStack OrmLite v.…
Chris Klepeis
  • 9,783
  • 16
  • 83
  • 149
2
votes
2 answers

finding sql geography point within rectangular (polygon)

I have an interesting/annoying issue with finding lat and long of land marks inside the rectangular boundary. I believe my two points are inside my rectangular boundary. but as you can test yourself the result of the the first select is false…
Azadeh Khojandi
  • 3,806
  • 1
  • 30
  • 32
2
votes
1 answer

polygon does'nt work when using my database but works fine with master in sql server geography

STPolyFromText function works fine with both clock-wise and anti-clock-wise order of points when using master, but not working in anti-clock-wise mode when i use myDB. Here is my code: use MyDB go DECLARE @polygon geography DECLARE…
Amid Gol
  • 305
  • 2
  • 7
2
votes
2 answers

How to return DbGeography.Distance calculated value In Code First Entity Framework without losing strong typing?

Currently I have an entity that is "geolocatable" via a SqlGeography column that I can use via expressions for filtering and sorting. I am already able to get all entities within distance x of point y and sort by entities closest to (or furthest…
2
votes
1 answer

Could not open system assembly microsoft.sqlserver.types.dll

We're in the process of migrating our servers onto AWS. We have set up a IIS web server and moved a copy of our DB on a RDS SQL Server 2012. Everything has worked ok for a few days until we got this error from the asp.net web site: Could not open…
Johann
  • 12,158
  • 11
  • 62
  • 89
2
votes
0 answers

Spatial Data not returning correct distance

I have the two following locations. They're both towns in Australia , State of Victoria Fitzroy,-37.798701, 144.978687 Footscray,-37.799736, 144.899734 I've followed this tutorial to work out the distance between two cities After running…
Code Ratchet
  • 5,758
  • 18
  • 77
  • 141
2
votes
2 answers

SQL Geography data type, how to use the gibberish it contains?

I'm looking at the sql geography data type and it doesn't seem very intuitive and I'm just not finding a lot of good (or rather "easy to understand") information on it. For example (taken 'partially' from a site I found talking about it…
user4593252
  • 3,496
  • 6
  • 29
  • 55
2
votes
1 answer

Create Ellipse Geography Representation

I wish to create a spatial object representing an ellipse in SQL Server 2008 R2. I have the point coordinates, and min and major axis values. The closest built in function I can find, which doesn't get me all the way there, is STBuffer - which…
mojo
  • 988
  • 6
  • 17
2
votes
2 answers

How to read a `geography` column by `SqlDataReader`?

I have a SQL Server 2008 database with a geography column which is generated by System.Data.Entity.Spatial.DbGeography in Entity Framework 6.0.0-alpha3. Now I need to read that column with a SqlDataReader. But I have no idea how to do this. Using…
amiry jd
  • 27,021
  • 30
  • 116
  • 215
2
votes
2 answers

How to resolve an InvalidCastException when retrieving a SqlGeography type from a DataReader?

I'm developing in C# using Visual Studio 2013 and SQL Server 2012. I've been able to store polygons in geography columns using T-SQL and am not trying to use the SqlGeography class in code to retrieve the data. When I try: SqlGeography polyB =…
Hank Brandenburg
  • 319
  • 3
  • 12
2
votes
1 answer

Efficient Technique to Calculate Geographic Union of Many Polygons

I have database tables containing many (70,000+) GEOGRAPHY polygons. (The polygons are property parcels.) We need to perform a number of calculations on the aggregate shape (a MULTIPOLYGON) which consists of the geographic union of all of these…
jbeldock
  • 2,755
  • 3
  • 18
  • 31
2
votes
3 answers

How to import Microsoft.SqlServer.Types into Microsoft SQL Server 2012?

I just finished importing census block shape files into Microsoft SQL Server 2012 and am now having issues when trying to use some of the geography features (STContains, STWithin, UnionAggregate, etc) on the data I've brought in. I checked the .prj…
user3083674