[postgis-users] mapping multi dependencies

Michael Welter mike at introspect.com
Wed Jun 1 09:38:48 PDT 2011


There should be a table for the tree category:

create table category (
	id			SERIAL PRIMARY KEY,
	name		VARCHAR NOT NULL
	other stuff about category
);

and another for the species:

create table species (
	id			SERIAL PRIMARY KEY,
	category		INTEGER REFERENCES category( id ),
	name		VARCHAR NOT NULL
	other stuff about species
);

The detail table references the category table:

create table treelocation (
	id			SERIAL PRIMARY KEY,
	species		INTEGER REFERENCES species( id ),
	geom		...
	other stuff about this tree at this location (age, height, etc0
);

Best regards,
Michael Welter
Conifer, Colorado

create table treelocation 
On Jun 1, 2011, at 8:30 AM, kaotika at gmx.de wrote:

> I have a simple unnormalized table and didn't know how to normalize it in the correct way. The species field depends on the category field. How can I map this?
> 
> gid     the_geom        category            species
> 0       Point 10, 10    broad-leaved tree   chestnut
> 1       Point 20, 10    conifer             fir
> 2       Point 10, 0     conifer             spruce
> 3       Point 0, 0      broad-leaved tree   oak
> 4       Point 0, 10     broad-leaved tree   oak
> 5       Point 20, 0     conifer             spruce
> 6       Point 20, 20    broad-leaved tree   hazel
> 
> -- 
> NEU: FreePhone - kostenlos mobil telefonieren!			
> Jetzt informieren: http://www.gmx.net/de/go/freephone
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list