Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

252
Visualizações
How to get lat and long from geom column in postgres DB

I have a table in postgres DB named "building_footprints".

Please see attached image

Postgres table image

and running below query to table

SELECT row_to_json(fc) FROM (
SELECT 'FeatureCollection' As type, array_to_json(array_agg(f)) As features FROM (
    SELECT 'Feature' As type, ST_AsGeoJSON(lg.the_geom)::json As geometry,
    row_to_json((gid, the_geom)) As properties FROM building_footprints As lg
) As f) As fc

Query Result is:

Query Output

I want to convert coordinates value(coordinates":[[[[530500.00039933,545400.008863266],) in to lat/long.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

try this

SELECT id, the_geom , ST_X(the_geom::geometry), ST_Y(the_geom::geometry) FROM building_footprints;

you should have postgis extension installed!

see: https://gis.stackexchange.com/questions/57018/get-lon-lat-values-from-a-geography-data-type-in-postgis

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda