[postgis-users] File size in Postgis and native shape file

David Blasby dblasby at refractions.net
Tue Oct 22 14:34:20 PDT 2002


YC Nyon wrote:

> I compared a shape theme size in its native form and Postgis format
>
> Native form (including shp, shx, dbf) = 1,093,632 bytes
> Postgis = 5,730,356 bytes
> (using the php query "select sum(mem_size(the_geom)) from pm2")
>
> I was expecting that the postgis size would be larger, but this is quite a
> big ratio.
>
> Anyone mind commenting on this?

If your shape file is points, then this makes sense.  Shape just stores the(
x,y) of a point - postgis stores the 3d bounding box + (x,y) + some other info
(like SRID).  If you were to re-write your shapefile as a multipoint, you
should find the sizes comparable.

Also, postgis stores points (and the bounding box) as (x,y,z), while your
shape file is probably only storing (x,y).

If you're interested, there you can look at the GEOMETRY structure in
postgis.h and there used to be more documentation on the postgis site, but
paul moved in somewhere.

dave





More information about the postgis-users mailing list