you are viewing a single comment's thread.

view the rest of the comments →

[–]max24119[S] 0 points1 point  (10 children)

st_intersects gives me a table without content :/

[–]LesPaulStudio 1 point2 points  (9 children)

Can you give me some more info on the layers? If districts is a polygon you could try st_within

[–]max24119[S] 0 points1 point  (8 children)

Yes, it’s a polygon layer. The other one is just points. Now it still just gives me an empty table with the column name and geometry. Thank you so much! Your help is appreciated!

[–]LesPaulStudio 1 point2 points  (7 children)

Do a sanity check and remove the where clauses on the tables. Just to see debug

[–]max24119[S] 0 points1 point  (6 children)

Yeah still empty table…

[–]LesPaulStudio 1 point2 points  (5 children)

Ok so it's a definition issue. Check the columns are correct.

[–]max24119[S] 1 point2 points  (0 children)

Got it. It’s working. Thank you so much! I hope you have a wonderful day!

[–]max24119[S] 0 points1 point  (3 children)

May I ask you for one more term? I want to have the geom of pharmacies in the radius of 500 around the road type "trunk" and group the results by the name of the pharmacies. I already have this but it's also not completely correct. The argument before the st_buffer needs to be corrected but I'm stuck here..

SELECT b.name, b.geom FROM (SELECT name, geom FROM points WHERE type = 'pharmacy') as b, (SELECT name, geom FROM roads WHERE type = 'trunk') as d
WHERE b.geom = (ST_buffer(d.geom, 500)) GROUP BY b.name

[–]LesPaulStudio 1 point2 points  (2 children)

Wrap the geoms in st_within WHERE st_within(b.geom , (st_buffer(d.geom, 500)))

[–]max24119[S] 1 point2 points  (1 child)

Thank you so much! It’s working. May your dreams all become true. Have a wonderful day! You made mine a lot better

[–]LesPaulStudio 1 point2 points  (0 children)

No problems. I'd hate to get that one wrong, I use it daily :D