Reputation: 22156
I would like to store a polygon as a set of 2D points represented as x, y coordinates of a Cartesian coordinate system.
Which spatial reference can I use? Looking at my spatial_ref_sys table, all the spatial references seem to be geography related.
The points of the polygon would represent satellite measurements which I would invoke ST_ConvexHull on to get the shape of the satellite footprint.
Upvotes: 1
Views: 1190
Reputation: 2639
I'm able to accomplish this using regular old EPSG:4326 (i.e., lat, lon points):
CREATE TABLE my_points (id SERIAL PRIMARY KEY, point GEOMETRY);
INSERT INTO my_points (id, point) VALUES
(1, ST_GeomFromText('POINT(12 23)', 4326)),
(2, ST_GeomFromText('POINT(23 45)', 4326));
SELECT ST_AsText(ST_ConvexHull(ST_Collect(point))) FROM points;
Returns LINESTRING(12 23,23 45)
Upvotes: 1
Reputation: 11
You don't have to store all data as geography related unless you will use specail postgis functions. You can store your cartesian point's x,y values as varchar or some other type available at postgres.
Upvotes: 1