Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to know, In which format the Geographic data stored in geometry data type of SQLServer 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
up vote 5 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:

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

In which format [is] geographic data stored in geometry data type of SQL Server 2008. It looks like a long string, like 0xE6100010466DFEOA4089663524… for one polygon.

These values are essentially BLOBs (binary large objects): Values of the GEOMETRY and GEOGRAPHY types are encoded in a special binary format which is specified in "[MS-SSCLRT]: Microsoft SQL Server CLR Types Serialization Formats".

How can I get set of Google latitudes/longitudes from this data format?

This has already been adressed by a previous answer: Call the .STAsText() method on a GEOMETRY-typed value to get a WKT representation of the geometry. Depending on the projection / coordinate system used by your geometries, this will make lat/long coordinate pairs visible in a plain text format.

share|improve this answer

Your Answer


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.