[postgis-users] which geometry type ?

Mauricio Miranda mmiranda at xoomcode.com
Wed Aug 18 05:51:09 PDT 2010


On Aug 18, 2010, at 09:39 AM, Armand Turpel wrote:

> Hi,
> Which is the best strategy for storing geometries items if the type of geometries could be a point, line or polygon. Geometrycollection ? or storing items in different tables/columns with specific geometry type? What about storing everything as polygons? A point could be stored as a very small polygon.
> 

Hi Armand,

You have many options:

1) Create the geometry_column as generic type "GEOMETRY". It will allow you to store any kind of geom.
2) Create multiple fields in the same table (as you said).
3) Create multiple tables, one for each type.
4) Create one main table with the common fields and use inheritance to create a child table for each type.

Good luck!

--
Mauricio Miranda
Chief Development Officer
http://www.xoomcode.com




More information about the postgis-users mailing list