Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Display longitude / latitude from geography datatype

Posted on 2013-01-28
4
Medium Priority
?
643 Views
Last Modified: 2013-01-29
How do I Display longitude / latitude from a geography datatype??
0
Comment
Question by:HLRosenberger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 40

Expert Comment

by:lcohan
ID: 38828303
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 38828334
that's the opposite.  I already have the geography data.  I want a simple query that displays the longitude / latitude based on the geography data.
0
 
LVL 40

Accepted Solution

by:
lcohan earned 2000 total points
ID: 38828650
Yes, is just the opposite of the same function like:


DECLARE @gstring geography;
SET @gstring = geography::STLineFromText('LINESTRING(-122.360 47.656, -122.343 47.656 )' , 4326);
SELECT @gstring.STPointN(1).ToString(), @gstring.STPointN(2).ToString();

http://msdn.microsoft.com/en-us/library/bb895372(v=sql.100).aspx

"Spatial Data Types Overview"
http://msdn.microsoft.com/en-us/library/bb964711.aspx
0
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 38831423
Thanks
0

Featured Post

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question