[postgis-users] psql2shp on two tables to get one shapefile...

Nick Ton nton at photon.com
Wed Jun 25 12:40:00 PDT 2003



Hi Everyone,

I am trying to create a shapefile where the data is based on two different
tables.
Has anyone done this before? Here is my problem, simplified:

-- City table contains some information, plus the_geom
CREATE TABLE city_tbl
(
   city_id	int,
   name text,
   area_cvrg real,
   the_geom geometry,
PRIMARY KEY (city_id)
);

-- City statistics table contains additional information 
-- that has to be linked to the city table in order to make the shapefile
complete
CREATE TABLE city_stats_tbl
(
   budget	numeric,
   population real,
   city_id REFERENCES city_tbl
);

One thought I had but wasn't sure if this is correct -- could I join the two
tables
together into a temp table, then perform a pgsql2shp on the temp table.
Please let
me your thoughts.

Thanks,
Nick






More information about the postgis-users mailing list