Questions tagged [sqlgeometry]

The SqlGeometry class in MSSQL Server API representing data in a Euclidean (flat) coordinate system.

68 questions
1
vote
0 answers

SQL, How to improve the speed of STGeomFromText and STDistance in this query?

I am trying to get the geo distance using query but it seems to be very slow (taking about 10 seconds on a table of 15k records). Is there a way to improve this? select count(contact_id) from matcher_contact WHERE…
Vibol
  • 615
  • 1
  • 8
  • 25
1
vote
1 answer

Insert geometry values in SQL Server 2008 R2

I want to insert GEOMETRY values into a table. For which I have a table with three columns as shown below: Table: geo create table geo ( p1 float, p2 float, Paths GEOMETRY ); Input values: I have following values p1 = 22.9901232886963 p2 =…
MAK
  • 6,824
  • 25
  • 74
  • 131
1
vote
1 answer

Django model creating geography not geometry fields

I have a Django model in which i declare maplocation = models.PointField() I'd like to work with geography not geometry, if i use python manage.py sql it maps as "maplocation" geometry(POINT,4326) NOT NULL, what do i need to do so that the…
liv a
  • 3,232
  • 6
  • 35
  • 76
1
vote
1 answer

SQL error while using MySQL geometry function

ALTER PROCEDURE dbo.StoredProcedure1 AS DECLARE @Seedid int, @data1 float, @data2 float, @g geometry DECLARE member_cursor CURSOR FOR SELECT id from test1 ; OPEN member_cursor; FETCH NEXT FROM member_cursor INTO @Seedid ; WHILE…
PhantomM
  • 825
  • 6
  • 17
  • 34
0
votes
0 answers

Trying to create an SQL Server geometry instance using STGeomFromText() and a MultiPolygon but the created geometry instance is invalid

I'm trying to create a geometry instance in SQL Server using STGeomFromText() and a MultiPolygon but I keep getting an invalid instance. What is wrong with the MultiPolygon? DECLARE @area0 geometry = geometry::STGeomFromText('MULTIPOLYGON…
jen
  • 59
  • 6
0
votes
1 answer

Spatial data type in SQL Server Data Tools (SSDT) is not working

I have a regular SQL Server view that refers to the planar spatial data type, geometry. When I import this database view into my SSDT project, it throws the following exception: SQL70561: Cannot schema bind view 'MyView' because name 'geometry'…
Mukesh Kumar
  • 656
  • 5
  • 26
0
votes
0 answers

How to manage null geometric field wising SqlGeometry type?

I was trying to get geometric value from DB. SqlGeometry g = new SqlGeometry(); g.Read(new BinaryReader(reader.GetSqlBytes(2).Stream)); this code does not work when the field is null, gives exception. I'm struggling to find a solution. Does…
shifat
  • 11
  • 3
0
votes
1 answer

SQL Server Geography - Find International Dateline and Equator

In SQL Server, I want to find if geography intersects/crosses the international dateline and equator. I thought of the below logic but am not sure if it is the right way of doing this. Geography crossing international date line: if the coordinates…
Reyan Chougle
  • 4,917
  • 2
  • 30
  • 57
0
votes
0 answers

Change precision on geometry operations in SQL Server

Is it possible to change/define precision on/for geometry operations like STEquals, STUnion, ...? More concrete... let say we have to geometries in Web Mercator coordinate system (3857) where I want to have precision, let's say, on 1 decimal…
Rok
  • 451
  • 3
  • 21
0
votes
0 answers

How to import GEOMETRY TYPE data in mysql database

I am trying to import CSV data into MySQL using the LOAD DATA LOCAL INFILE syntax. In this case the data includes a geometry field that is tripping me up. An error occurs when MYSQL WORKBENCH loads GEOMETRY TYPE data. Error messages : Row import…
haksun
  • 1
0
votes
1 answer

SQL Server 2012, UnionAggregate Missing Z and M

Used union aggregate on multiple, ordered line geometries with M and Z but the final result is missing those Z and M values. I tried using geographies as well but no luck. Query for testing create table #test (shape geometry) insert into…
I_Tried
  • 41
  • 6
0
votes
0 answers

24114 error when creating Geometry from SQLChar

I am calling a web service in my C# code. The service returns Geometry in WKT (well known text). When printing out the returned WKT in a message box, it looks as follows: POINT(-9206304.681343028 5363253.767605823) However when I attempt to create…
Ihab
  • 1
0
votes
1 answer

Convert Geometry from T-SQL to Postgres

I have this column for creating a geometry from SQL Server: Shape AS ([geometry]::STGeomFromText(((('POINT('+CONVERT([varchar](20);,Longitude))+' ')+CONVERT([varchar](20),Latitude))+')',(4326))), PRIMARY KEY CLUSTERED I need to create the column…
Arnold Cristobal
  • 843
  • 2
  • 16
  • 36
0
votes
1 answer

Display SQL geometry in VB Picturebox

My first post here and somewhat new to VB.NET, so I'm aware that I may breach some protocols. So please be patient. A bit of background on what I'm trying to do. I've created a Windows form with a picturebox that the user can draw objects on…
ACA
  • 1
  • 2
0
votes
1 answer

Repeating Map in SSRS?

I have a tablix in which I've inserted a chart that repeats based on the tablix row group. This effectively displays a separate chart in the report for each row group. I've scheduled this to run daily and it emails off as a pdf. I'd like to so the…