I'm quite new to PostGIS so bear with me.
Suppose I have a table defined as follows:
CREATE TABLE gtest (name varchar, geom geometry);
At first, to insert, I was doing something like:
INSERT INTO gtest
VALUES (
'Polygon',
ST_GeomFromText('POLYGON((0 0,1 0,1 1,0 1,0 0))',4326)
);
I then discovered that it still works by only doing this:
INSERT INTO gtest
VALUES (
'Polygon',
'SRID=4326;POLYGON((0 0,1 0,1 1,0 1,0 0))'
);
When I do a query without converting the geom values back into WKT, they are both encoded properly. Same if I convert the column to EWKT, everything displays properly.
Is there a conversion going on behind the scenes? And if I insert without calling ST_GeomFromText()
, will all other functions using the column work fine?
Thanks