Skip to main content
added 526 characters in body
Source Link

I have a PostGIS (PostgreSQL 13/PostGIS 3.1.1 on Debian 11.7) table with points in EPSG:6708, so it's plain coordinates (data from Northern Italy). I need to get lat/long coordinates, so I do:

    SELECT ST_AsText(the_geom) AS xy, ST_AsText(ST_Transform(the_geom,4326)) AS ll FROM acq_impianti WHERE gid=426;
                         xy                     |                    ll                     
    --------------------------------------------+-------------------------------------------
     POINT(291349.5482259364 5072882.274108588) | POINT(52.9750863624063 2.074122662821441)

which is absolutely wrong; in fact if I do the same transformation using this tool, I obtain: enter image description here

I can't figure out what I'm doing wrong....

EDIT: Using ST_FlipCoordinates solves the problem, but maybe there is a better way to handle this

SELECT ST_AsText(the_geom) AS xy, ST_AsText(ST_Transform(ST_FlipCoordinates(the_geom),4326)) AS ll FROM acq_impianti WHERE gid=426;                     xy                     |                     ll                      
--------------------------------------------+---------------------------------------------
 POINT(291349.5482259364 5072882.274108588) | POINT(12.316072170259908 45.77796903086367)

I have a PostGIS (PostgreSQL 13/PostGIS 3.1.1 on Debian 11.7) table with points in EPSG:6708, so it's plain coordinates (data from Northern Italy). I need to get lat/long coordinates, so I do:

    SELECT ST_AsText(the_geom) AS xy, ST_AsText(ST_Transform(the_geom,4326)) AS ll FROM acq_impianti WHERE gid=426;
                         xy                     |                    ll                     
    --------------------------------------------+-------------------------------------------
     POINT(291349.5482259364 5072882.274108588) | POINT(52.9750863624063 2.074122662821441)

which is absolutely wrong; in fact if I do the same transformation using this tool, I obtain: enter image description here

I can't figure out what I'm doing wrong....

I have a PostGIS (PostgreSQL 13/PostGIS 3.1.1 on Debian 11.7) table with points in EPSG:6708, so it's plain coordinates (data from Northern Italy). I need to get lat/long coordinates, so I do:

    SELECT ST_AsText(the_geom) AS xy, ST_AsText(ST_Transform(the_geom,4326)) AS ll FROM acq_impianti WHERE gid=426;
                         xy                     |                    ll                     
    --------------------------------------------+-------------------------------------------
     POINT(291349.5482259364 5072882.274108588) | POINT(52.9750863624063 2.074122662821441)

which is absolutely wrong; in fact if I do the same transformation using this tool, I obtain: enter image description here

I can't figure out what I'm doing wrong....

EDIT: Using ST_FlipCoordinates solves the problem, but maybe there is a better way to handle this

SELECT ST_AsText(the_geom) AS xy, ST_AsText(ST_Transform(ST_FlipCoordinates(the_geom),4326)) AS ll FROM acq_impianti WHERE gid=426;                     xy                     |                     ll                      
--------------------------------------------+---------------------------------------------
 POINT(291349.5482259364 5072882.274108588) | POINT(12.316072170259908 45.77796903086367)
naming
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

Latitude/longitude from PostgisPostGIS table with coordinates transformation not working

I have a PostgisPostGIS (PostgresqlPostgreSQL 13/PostgisPostGIS 3.1.1 on Debian 11.7) table with points in EPSG:6708, so it's plain coordinates (data from Northern Italy). I need to get lat/long coordinates, so I do:

    SELECT ST_AsText(the_geom) AS xy, ST_AsText(ST_Transform(the_geom,4326)) AS ll FROM acq_impianti WHERE gid=426;
                         xy                     |                    ll                     
    --------------------------------------------+-------------------------------------------
     POINT(291349.5482259364 5072882.274108588) | POINT(52.9750863624063 2.074122662821441)

which is absolutely wrong; infactin fact if I do the same transformation using this tool, I obtain: enter image description here

I can't figure out what I'm doing wrong....

Latitude/longitude from Postgis table with coordinates transformation not working

I have a Postgis (Postgresql 13/Postgis 3.1.1 on Debian 11.7) table with points in EPSG:6708, so it's plain coordinates (data from Northern Italy). I need to get lat/long coordinates, so I do:

    SELECT ST_AsText(the_geom) AS xy, ST_AsText(ST_Transform(the_geom,4326)) AS ll FROM acq_impianti WHERE gid=426;
                         xy                     |                    ll                     
    --------------------------------------------+-------------------------------------------
     POINT(291349.5482259364 5072882.274108588) | POINT(52.9750863624063 2.074122662821441)

which is absolutely wrong; infact if I do the same transformation using this tool, I obtain: enter image description here

I can't figure out what I'm doing wrong....

Latitude/longitude from PostGIS table with coordinates transformation not working

I have a PostGIS (PostgreSQL 13/PostGIS 3.1.1 on Debian 11.7) table with points in EPSG:6708, so it's plain coordinates (data from Northern Italy). I need to get lat/long coordinates, so I do:

    SELECT ST_AsText(the_geom) AS xy, ST_AsText(ST_Transform(the_geom,4326)) AS ll FROM acq_impianti WHERE gid=426;
                         xy                     |                    ll                     
    --------------------------------------------+-------------------------------------------
     POINT(291349.5482259364 5072882.274108588) | POINT(52.9750863624063 2.074122662821441)

which is absolutely wrong; in fact if I do the same transformation using this tool, I obtain: enter image description here

I can't figure out what I'm doing wrong....

Source Link

Latitude/longitude from Postgis table with coordinates transformation not working

I have a Postgis (Postgresql 13/Postgis 3.1.1 on Debian 11.7) table with points in EPSG:6708, so it's plain coordinates (data from Northern Italy). I need to get lat/long coordinates, so I do:

    SELECT ST_AsText(the_geom) AS xy, ST_AsText(ST_Transform(the_geom,4326)) AS ll FROM acq_impianti WHERE gid=426;
                         xy                     |                    ll                     
    --------------------------------------------+-------------------------------------------
     POINT(291349.5482259364 5072882.274108588) | POINT(52.9750863624063 2.074122662821441)

which is absolutely wrong; infact if I do the same transformation using this tool, I obtain: enter image description here

I can't figure out what I'm doing wrong....