Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

210
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!