Questions tagged [sqlgeography]

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

264 questions
5
votes
2 answers

SQL Geography data type column in GROUP BY clause

I'm using SQL Server and creating a script which will get the workers geographical location out of my database. The script is below. SELECT w.display_name, w.geo_location FROM jobs j WITH(NOLOCK) INNER JOIN workers w WITH(NOLOCK) ON w.worker_id =…
Richard Nixon
  • 159
  • 1
  • 12
4
votes
1 answer

How to bulk insert geography into a new sql server 2008 table

I have a very large shape file with hundreds of thousands of rows of polygons and other associated data, like formatted addressing and APN numbers. How do I get this data into a table with geography without using things like Shape2SQL? I can't…
4
votes
1 answer

Group by value and create geography polyline from points (latitude and longitude) for each group in T-SQL

A similar question has been asked here: Create geography polyline from points in T-SQL Taking that question further, I have a table schema that looks like this: CREATE TABLE [dbo].[LongAndLats]( [Longitude] [float] NULL, [Latitude] [float]…
user3799279
  • 143
  • 1
  • 11
4
votes
2 answers

Change projection in MSSQL for web mapping (Leaflet,Openlayer, OpenStreetMaps, GoogleAPI, ...) to WSG48 or any other format

I have some WKT/WKB data in the MSSQL server like this and would like to show them on the map with the help of leaflet, Openlayer, OpenStreetMaps, or GoogleAPI. My data look likes this: POLYGON ((1736946.0983 5923253.9175, 1736895.6852 5923333.9451,…
Mohsen Sichani
  • 1,002
  • 12
  • 33
4
votes
1 answer

How to get lat/lng coordinates from GEOMETRY('POINT') with Sequelize?

I have an MS SQL database that contains a table with latitude/longitude positions of some devices. These positions are stored in a GEOGRAPHY field. Now I want to get these positions from my node app with Sequelize. Here's my sequelize model…
Rob
  • 11,492
  • 14
  • 59
  • 94
4
votes
2 answers

SQL server GEOGRAPHY STDistance function is returning big difference than other test results

I am calculating distance in meters between two lat long values - 40.1844441 -77.2252771 and 40.319166 -76.7880552 I tested the distance between these two points in below two web sites - http://www.nhc.noaa.gov/gccalc.shtml…
4
votes
1 answer

SqlServerTypes.Utilities is inaccessible due to its protection level

According to SqlServerTypes README I need to put this line: SqlServerTypes.Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory); before doing spatial operations for a desktop application (mine is a console app). However it outputs…
Kevin Lee
  • 1,104
  • 3
  • 13
  • 33
4
votes
1 answer

SQL Geometry VS decimal(8,6) Lat, Long Performance

I was looking into performance of selecting closest points within certain proximity to given coordinate. Options are to ether use two decimal(8,6) - lat, long columns or single geography column and work with that. I am only interested which is…
4
votes
1 answer

Error getting value from 'WellKnownValue' on 'System.Data.Entity.Spatial.DbGeography

I am using the DbGeography-Type within a SinglePageApplication (with breeze and angular). Now when using the Data with the DbGeography-Type (readOnly) there is no problem. As soon as I save an entity which has a property of DbGeography-Type I get…
NoRyb
  • 1,472
  • 1
  • 14
  • 35
4
votes
1 answer

Sql Server - How do I query a geography column based on Lat/Long min max

I have a table with a geography column that stores the location of a property. I have a procedure something like this - PROCEDURE dbo.spt_sold_property_search ( @latitude_min Decimal(9,6), @latitude_max Decimal(9,6), @longitude_max …
Toby Holland
  • 1,029
  • 2
  • 14
  • 29
4
votes
2 answers

Converting SQL Geography Lat/Long to VARCHAR without loss of precision

I have a geography column called Location. I need to SELECT the Location.Lat and Location.Long as a single VARCHAR result. Using the following I am losing precision: Query: SELECT CONVERT(VARCHAR(MAX), Location.Lat) + ' ' + CONVERT(VARCHAR(MAX),…
4
votes
1 answer

SQL Geography Latitude/Longitude distance calc

I have trouble using geography to calculate distance in miles using the format of my table. Latitude and Longitude of both locations are side by side: id | A_Latitude | A_Longitude | B_Latitude | B_Longitude I'm trying to get the point of A, along…
Onohalp
  • 43
  • 5
4
votes
1 answer

SqlGeography get polygons from multipolygon

I have table Town with column TownBoundary that contains polygon of relevant town (geography datatype). For each town I get polygon data that I need to generate KML(XML) files like: sqlg = SqlGeography.STPolyFromText(new…
BblackK
  • 524
  • 1
  • 8
  • 25
4
votes
1 answer

Create MultiPolygon SqlGeography from Polygon SqlGeographys

I have a list of SqlGeographys that are Polygons. I want to combine them into one SqlGeography of type multipolygon. List areaPolygons = GetAreaPolygons() SqlGeography multiPoly = null; foreach (SqlGeography geog in areaPolygons) { …
Adam Knights
  • 2,141
  • 1
  • 25
  • 48
4
votes
1 answer

Find Nearby GPS Navigation Route

I am developing a car pooling website. For that, I have created the database which has the different route options selected by different user. These routes are saved in the Database as Geography datatype. For data access, I used Entity Framework. In…
petchirajan
  • 4,152
  • 1
  • 18
  • 20
1 2
3
17 18