I have a table of cities that includes the name and location of that city.
CREATE TABLE cities (
name varchar (255),
location GEOGRAPHY(Point)
)
For certain cities, I'll set the location:
UPDATE cities SET location='POINT(32.4543 -99.7384)' WHERE slug='abilene';
But when I retrieve the longitude and latitude for that location, it is different than the value I inserted:
select ST_X(location::geometry),ST_Y(location::geometry) from cities where slug='abilene'
The ST_X is correct at 32.4543 but the ST_Y is incorrect at -80.2616
Why is the latitude different than the value I inserted?
I am using PostgreSQL 9.6.9 and Postgis 2.5
If you do not specify an SRID, the SRID will default to 4326 WGS 84 long/lat will be used, and all calculations will proceed using WGS84.
Latitude can't be -99.7384.