Microsoft SQL spatial database

learn more… | top users | synonyms (2)

1
vote
1answer
31 views

Simple POLYGON works for Geometry, goes nuts for Geography

I am trying to do some rough conversions on existing data in SQL Server, and I've run into a fundamental problem: some values result in absolutely insane Geography values (completely different than ...
0
votes
0answers
12 views

Conversion from 32643 to 4326 in Sql server

I am working with SQL server 2012 Spatial Database and i need to convert from Spatial Reference System 32643 to Spatial Reference System 4326. Is there any spatial function for this type of spatial ...
1
vote
0answers
23 views

Mapinfo 15.2.2 not displaying all polygons from a MSSQL Spatial DB table

I am trying to open a fairly large table stored on our MSSQL Spatial DB - the table has around 22,000 polygons. The table opens perfectly on Mapinfo 12.5 (both 64bit and non-64bit), but for some ...
1
vote
1answer
102 views

MSSQL Spatial Query (View) is Slow in ArcMap

I created the following view in Microsoft SQL Server 2008 R2: CREATE VIEW test AS SELECT p.id, p.shape FROM p INNER JOIN r ON p.shape.STIntersects(r.shape) = 1 WHERE r.Name = '...
0
votes
0answers
20 views

How can I load data into SQL Server spatial using SQL Server Integration Services?

How can I load data into SQL Server spatial using SQL Server Integration Services (SSIS)? I'm aware of other tools, like FME and ogr2ogr, but my only option is using SSIS
0
votes
0answers
23 views

QGIS MSSQL on OSX

Could someone please help me or point me to the right resource with my Question. I have an OSX machine, with QGis 2.12.1, and a windows instance with MSSQL running on AWS. For the life of me I cannot ...
1
vote
0answers
14 views

Text imported into SQL Server using ogr2ogr had extra characters at the beginning

I've managed to import some MapInfo data sets into SQL Server using ogr2ogr But when I run a query in SQL Management Studio (SSMS), the various text fields look to be "blank" However if I use the ...
2
votes
1answer
61 views

Why would FME imported data into SQL Server not being found by QGIS?

Why is FME imported data into SQL Server not being found by QGIS? I've imported some MapInfo format data into SQL Server 2014 using FME. In SQL Management Studio (SSMS), I can do a query and the ...
1
vote
2answers
87 views

Migrating data from ArcSDE to SQL Server Spatial Database

I am looking for a process or a tool that would allow me to migrate data from an ESRI SDE Database to a SQL Spatial Database. This would include converting the ESRI geometry to SQL geometry types, as ...
2
votes
0answers
19 views

Why does QGIS try to create spatial tables when loading into MSSQL Server?

When trying to load a layer from the QGIS layers panel or browsers panel, errors pop up that either the 'spatial_ref_sys' table or 'geometry_columns' table exists: If these tables exist already, ...
0
votes
1answer
47 views

Do different RDMS use different SRID's to identify the coordinate system of a spatial object?

I'm looking for a reference that lists a standard SRID for a given CRS. Do RDMS's utilize a standardized SRID, such as OGC? Or is it unique to the RDMS?
0
votes
0answers
34 views

What is the impact of changing grid sizes while applying spatial index on specified table in SQL Server 2014

I have a Feature class with millions of points of interest (contains OID and geometry columns) which is stored in ArcSDE along with other non-spatial datatables which are stored in SQL Server DB . I ...
1
vote
1answer
117 views

How to publish SQL Server Spatial views to GeoServer?

I have a web mapping service created on ESRI infrastructure (ArcGIS Server (WFS and WMS) with editable data from SQL Server Spatial. I am trying to switch from ArcGIS to Geoserver. I have published ...
3
votes
1answer
152 views

How to cast geometry to varbinary in PostGIS / PostgreSQL

In MSSQL Server, casting geometry to varbinary(max) produces a string that looks like this: 0x3D0B0000010CA0F3BE3B5CE9474100EC414E3AF93941 When you insert that string into a geometry column, a ...
3
votes
1answer
114 views

SQL Spatial select record where intersects another record

I have two tables - 'Tree' (point) and 'ServiceArea' (polygon) in the GIS database. Trying to select all Tree records that intersect a ServiceArea where the value in Tree.ServiceAreaNumber field ...
0
votes
1answer
90 views

How to find Nearest point on line from a point cordinate in SQL server

I want to find out the nearest point on my road network which is a multiline string from a point with lat lon value. The below code I have tried for finding buffer distance line from a point. ...
0
votes
1answer
122 views

How do you filter a layer on a joined table in QGIS?

I am attempting to do a join in QGIS between a SQL Server Spatial table and a non-spatial table (on a single integer field). I was able to add both successfully and make the join, but the query ...
2
votes
1answer
213 views

Should the QGIS “DB Manager” have Microsoft SQL Server as an option?

I was looking for interactive query options for SQL Server (similar to SQL Server Management Studio). The "DB Manager" works great for Postgres and I'm primarily using the Load as new layer as I build ...
2
votes
0answers
146 views

How to return GeoJson from a SQL Server Query using GeoJson.Net in ASP.NET MVC

I have a spatial table in SQL Server, which I want to map using either OpenLayers or Leaflet. My problem is I can't figure out how to convert the returned results from my query to geojson. My Linq ...
1
vote
0answers
20 views

Using gdal_rasterize with a MSSQL Connection, possible?

I'm a bit new to gdal, I mostly use ogr2ogr for data imports to MS SQL Server -- so I'm a bit out of my tree on gdal_rasterize My goal is to create png raster files 200x200 from a geometry column. I ...
0
votes
0answers
56 views

Querying geom from MS SQL 2014 in PHP/PDO returns empty array

I'm using the following php code: $query = $dbconn->prepare("SELECT [geom].ToString() as geom FROM [the_table_im_using]"); $query->execute(); if($query->errorCode() != 0) { die("Query ...
2
votes
1answer
59 views

Cannot see created SQL Server tables in ArcGIS

I have a MSSQL 2012 database that I can connect to from ArcGIS using 'Add Database Connection'. In this database I have a spatial table that I can see and open in ArcGIS, however when I create a table ...
0
votes
0answers
57 views

Z and M values get lost when extending MS SQL geography Linestring by .STUnion

I'm trying to add new geography points with Z and M values to a geography linestring. This has to be SQL 2008 R2 compatible. I've found some references to .STUnion() and tried that. The linestrings ...
1
vote
0answers
54 views

Offsetting points from lines using SQL Server Spatial?

I'm new with SQL spatial data processing, so I'm not sure how to solve my task. I have two tables - table with lines and table with points that are located on lines. Lines and points are related by ID ...
1
vote
3answers
577 views

How do I find points that are NOT within a list of polygons using MS SQL?

I have a table of points, and and a table of polygons. I have managed to build queries (MS SQL) to get the containing polygon for a given point, as well as listing all the points within a specified ...
1
vote
0answers
190 views

What if 'geometry_columns' already exists in MSSQL Server Database?

When trying to load a .SHP into MSSQLSpatial using OGR2OGR, I get the following error: ERROR 1: Error initializing the metadata tables : [Microsoft][ODBC SQL Server Dr iver][SQL Server]There is ...
0
votes
1answer
220 views

Converting coordinates into decimal using SQL Server Spatial?

I am looking to convert a pair of coordinates to decimal, and am unsure how to go about doing it. The following script select Centroid.STY as Longitude, Centroid.STX as Latidude from ( select ...
1
vote
0answers
71 views

Difference between adding spatial layer from MSSQL through “browser” and “add MSSQL table”

So I am trying to pinpoint the difference of adding layers from MSSQL Database that contains spatial layers like geography and geometry. I have noticed that when adding from the browser it retains it ...
1
vote
1answer
75 views

Does SQL Server Data Need to be Spatial

In reference to my previous question. I am looking for the benefits of telling SQL Server your data is spatial. For instance, I have a duplicate of that table generated by the Shape2SQL tool (see ...
1
vote
1answer
1k views

SQL Server Spatial Querying

I am looking for ways to learn querying for SQL Server Spatial (2008/2012). I have a table created from Shape2SQL and have been trying to run a simple intersection query to get results from that ...
0
votes
1answer
540 views

SQL Server geometry vs. geography in Esri map service

We have a SQL Server 2008R2 database where point coordinates are stored as decimal degrees. I want to create an Esri map service which shows those points. As the point data is dynamic I decided to ...
2
votes
1answer
267 views

convert ordnance survey easting and northing data to WGS84 latitude longitude values

The C# code published here is not very accurate as also mentioned by tanoshimi. I think this has to do with the lack of 'approximate Helmurt transformation'. Just curious is anyone aware of some ...
0
votes
0answers
65 views

ArcGIS Data Interopabality Extension and Exporting from Mapcom M4

I am exporting from Mapcom's M4 database into Geodatabase or Shapefile. I have the ArcGIS Data Interopability extension and I was able to connect and export the Lines, Points, polys, etc. When I ...
0
votes
0answers
137 views

SQL Spatial Tools package - linear referencing

The SQLSpatialTools package website seems to be temporarily down, so I cannot access the article on linear referencing tool posted there at the moment. Is it possible, by any other means, to obtain a ...
0
votes
1answer
35 views

Geog vs. Geom - not same results [duplicate]

I have these two SQL Server 2008 R2 queries: SELECT COUNT(*) FROM OIS_NOA_Buffers WHERE geog.STIntersects(geography::Point(35.25934, -120.64432, 4326))=1; SELECT COUNT(*) FROM OIS_NOA_Buffers WHERE ...
2
votes
3answers
815 views

How to use STUnion with GroupBy

I'm using SQL Server 2008 R2 to store Geometry data types. I have a bunch of lines as individual features, that share common names ('NAME' field). I would like to create a view that Groups By 'NAME' ...
0
votes
1answer
257 views

SRID, Shape2SQL and SQL Server 2008r2 query

I'm using Shape2SQL to load the Ordinance Survey's Meridian 2 map into SQL Server 2008r2 (which is working very smoothly and painlessly). According to this page (https://alastaira.wordpress.com/2011/...
5
votes
2answers
1k views

Optimizing Geometry.STIntersect Query

I am attempting to move simple Geoprocessing routines from ESRI based processes to SQL Server. My assumption is that it will be far more efficient. For my initial test I am working on an intersection ...
1
vote
1answer
162 views

How to speed up SQL spatial query (spatial index error)

I am trying to split polylines by points which have a small buffer around them. Currently I have over 370,000 lines and 320,000 nodes and the query is running really slowly (I've left it for 3 days ...
4
votes
5answers
334 views

How do you generate WKT from a graphic drawn on a map?

All, In order to do some quick analysis using SQL spatial, I'd like to generate spatial objects using the STGeomFromText / ST_GeomFromText function. With point data, I can do this by geocoding an ...
1
vote
3answers
216 views

ST spatial queries to select multi-level location

I'm trying to write a query in SQL Server using 1 set of points and 2 sets of polygons. The polygons overlap, and I only want to select the points that fall inside of 1 polygon but not the other. I ...
1
vote
0answers
154 views

Creating Irregular ellipses using SQL Spatial 2012 Geometry

I have stumbled across a problem in SQL Server 2012 - whereby I need to create different shape ellipses from the following data points: centre_x | centre_y | max_x | max_y | min_x | min_y I have ...
1
vote
2answers
2k views

accurately find the bounding box of geography polygons

Im displaying polygons on a map and have had issues with the spatial index where the index performs well only for certain data sets (large areas with low density / high density small map areas). I've ...
1
vote
1answer
242 views

How to union polygons and add attribute values of combined output features

I have a layer containing 10 polygons all overlapping at various locations. Each polygon has a value of '1' in a column called "value" How do I Union the polygons (rows) together such that the ...
4
votes
2answers
388 views

How to migrate spatial tables from MSSQL to PostGIS

I'd like to migrate my spatial data from MS SQL Server to PostGIS. Originaly the data was stored with SDE under MS SQL. Then I migrated with an ArcGIS tool. That created a spatial data column with ...
5
votes
2answers
490 views

Storing SRID:4326 data as Geometry or Geography?

I used OGR2OGR to import SRID 4326 point data into MSSQL Server. Didn't realize that it defaults to creating a geometry column instead of detecting the data as 4326 and creating a geography column. ...
0
votes
1answer
1k views

SQL Geometry Query similar to Select by Centroid

Does anyone know if it's possible to query SQL geometry by something like 'centroid of polygon'...similar to ArcMap's select by location? I'm using SQL Server 2008 R2 as the DBMS. I have two polygon ...
4
votes
4answers
364 views

How to assign geometry to records in a table that contain an ID of a geometry point?

We are looking to map out 'incidents' at schools, but the incident table, which contains a few thousand records, only has a school number (plus the incident data). The table format is an Excel ...
1
vote
2answers
265 views

How to count points once with overlappying polygons?

All, We're using parcel data (polygon) to count student locations (point) based on parcel type. We're doing this using SQL and the ST_Intersects function. It works great, except the City and County ...
1
vote
1answer
335 views

MSSQL server 2008 dissolve sql query

I have a set of spatial objects in a MSSQL server 2008 R2 trying to dissolve adjoining objects where one of the attributes are equal. The table below is somewhat representative to my original table: ...