Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I want to know, In which format the Geographic data stored in geometry data type of SQLServer 2008.it looks like a long string,like 0xE6100010466DFEOA4089663524....... for one polygon. My second question is How can i get set of google latitudes/longitudes from this data format ?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

It's binary data, you need to use the STAsText() method to return it as a string that contains the lat/longs, as in:

SELECT [OBJECTID]
  ,[TRACT_ID]
  ,[TRACT_NAME]
  ,[SHAPE].STAsText()
FROM [City].[dbo].[TRACTS]

To go the other way, use the STAsBinary() method.

share|improve this answer
    
Fine! Thats what i needed. Can i go in reverse. I mean is it possible to convert set of lat/longs back to binary format? –  user1899 Feb 6 '12 at 14:59
    
@user1899 - Yes, see my edit. –  Chad Cooper Feb 6 '12 at 15:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.