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

209
Visualizações
How to find all circles that have their center in their intercection a main circle

Is there a clean way to find all the circles that are not only intersection with a main circle but also have their center inside the intersection with that main circle.

enter image description here

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

0

Sure it's simple. You need to use @@ or center to get the center point and then @> to use contains.

SELECT
  x AS r_value,
  circle('0,0', x) @> @@ circle('2,3', 1) AS contains
FROM generate_series(1,5) AS gs(x);

-or-

SELECT
  x AS r_value,
  circle('0,0', x) @> center(circle('2,3', 1)) AS contains
FROM generate_series(1,5) AS gs(x);

This brute-force tests circles with the center at the origin, with a radius of [1,5] whether they contain the center of circle('2,3',1).

See the docs on geometry functions for more info.

over 4 years ago · Santiago Trujillo Relatório

0

select * from circles a , circles b
 where st_intersects(a.geom,st_centroid(b.geom)) 

Also, you can filter the results by adding condition in where clause. I am assuming main circle name.

select * from circles a , circles b
 where st_intersects(a.geom,st_centroid(b.geom))  and a.circle_name = 'Main Circle';
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