-- Create a table for polygons
CREATE TABLE polygons (
id SERIAL PRIMARY KEY,
name VARCHAR(50),
geom GEOMETRY(POLYGON, 4326)
);
-- Create a table for points
CREATE TABLE points (
id SERIAL PRIMARY KEY,
name VARCHAR(50),
geom GEOMETRY(POINT, 4326)
);
-- Insert polygons
INSERT INTO polygons (name, geom)
VALUES
('Sydney Opera House', ST_GeomFromText('POLYGON((151.2069 -33.8651, 151.2073 -33.8655, 151.2081 -33.8663, 151.2085 -33.8667, 151.2069 -33.8651))', 4326)),
('Melbourne Cricket Ground', ST_GeomFromText('POLYGON((144.9883 -37.8193, 144.9887 -37.8197, 144.9901 -37.8207, 144.9905 -37.8211, 144.9883 -37.8193))', 4326)),
-- ... (8 more polygons)
-- Insert points
INSERT INTO points (name, geom)
VALUES
('Sydney Harbour Bridge', ST_GeomFromText('POINT(151.2069 -33.8651)', 4326)),
('Melbourne City Centre', ST_GeomFromText('POINT(144.9883 -37.8193)', 4326)),
-- ... (98 more points)
i tried and get nothing
New contributor
12B20 Sukhjinder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2