Solved

Display longitude / latitude from geography datatype

Posted on 2013-01-28
4
616 Views
Last Modified: 2013-01-29
How do I Display longitude / latitude from a geography datatype??
0
Comment
Question by:HLRosenberger
  • 2
  • 2
4 Comments
 
LVL 39

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 39

Accepted Solution

by:
lcohan earned 500 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

839 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