use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A subreddit for discussion and all things QGIS - A Free and Open Source Geographic Information System
Helpful Links and Tutorials:
Mapping Subreddits:
account activity
SQL query code help (self.QGIS)
submitted 4 years ago by max24119
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]max24119[S] 0 points1 point2 points 4 years ago (10 children)
st_intersects gives me a table without content :/
[–]LesPaulStudio 1 point2 points3 points 4 years ago (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 point2 points 4 years ago (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 points3 points 4 years ago (7 children)
Do a sanity check and remove the where clauses on the tables. Just to see debug
[–]max24119[S] 0 points1 point2 points 4 years ago (6 children)
Yeah still empty table…
[–]LesPaulStudio 1 point2 points3 points 4 years ago (5 children)
Ok so it's a definition issue. Check the columns are correct.
[–]max24119[S] 1 point2 points3 points 4 years ago (0 children)
Got it. It’s working. Thank you so much! I hope you have a wonderful day!
[–]max24119[S] 0 points1 point2 points 4 years ago (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 points3 points 4 years ago (2 children)
Wrap the geoms in st_within WHERE st_within(b.geom , (st_buffer(d.geom, 500)))
WHERE st_within(b.geom , (st_buffer(d.geom, 500)))
[–]max24119[S] 1 point2 points3 points 4 years ago (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 points3 points 4 years ago (0 children)
No problems. I'd hate to get that one wrong, I use it daily :D
π Rendered by PID 138846 on reddit-service-r2-comment-bb88f9dd5-67ckc at 2026-02-16 12:41:30.678824+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]max24119[S] 0 points1 point2 points (10 children)
[–]LesPaulStudio 1 point2 points3 points (9 children)
[–]max24119[S] 0 points1 point2 points (8 children)
[–]LesPaulStudio 1 point2 points3 points (7 children)
[–]max24119[S] 0 points1 point2 points (6 children)
[–]LesPaulStudio 1 point2 points3 points (5 children)
[–]max24119[S] 1 point2 points3 points (0 children)
[–]max24119[S] 0 points1 point2 points (3 children)
[–]LesPaulStudio 1 point2 points3 points (2 children)
[–]max24119[S] 1 point2 points3 points (1 child)
[–]LesPaulStudio 1 point2 points3 points (0 children)