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

PostGIS stores its geometry entities as long strings:

SELECT ST_GeomFromText('POINT(32.0 34.0)',4326);

For nearby points like (32.0 34.0) and (32.01 34.01), the string has a common prefix 0101000020E6100000 which might suggest a suggest a geohash technique:

SELECT ST_GeomFromText('POINT(32.01 34.01)',4326);

Any idea what is the storage format of PostGIS geometries?

share|improve this question
PostGIS is open source, if ever in doubt read the source. – Nathan W Jul 20 '14 at 13:41
@NathanW Sure. I was looking for a reference to an explanation, rather than code. – Adam Matan Jul 20 '14 at 13:43
up vote 10 down vote accepted

It is not a string format. It is a binary format using integers, double precission and special bytes used for flags.

What you see as output above is not the internal format but the wkb format represented as hex numbers

The internal format is described here:

The document is written before postgis 2.0 when g-serialized also is used for the geometey type. But as far as I know it is the same.

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.