[GIS] How to find SRID for random polygon

postgissrid

I'm testing spatial database performance on a dataset. Spatial objects in this dataset (stored as WKT in a flat text file) are random valid polygons which have vertex coordinates (x,y) where 100,000> x >0 and same for y.

Currently I'm having problem with inserting these data into PostGIS which has a geometry constraint check and I got an error like "violates check constraint "enforce_srid_polygon ".

So, how can I find/create a srid for my dataset ?

BTW: the polygons are valid polygons which are extracted from images by segmenting objects.

Best Answer

You can query it with Find_SRID. So if your table looks something like:

CREATE TABLE ply
(
  id integer NOT NULL,
  geom geometry(Polygon,4326),
  CONSTRAINT ply_pkey PRIMARY KEY (id)
);

then use:

postgis=# SELECT Find_SRID('', 'ply', 'geom');
 find_srid
-----------
      4326
(1 row)
Related Question