Roads around my current location

Hello, looking for a query to group all roads around my current location as described in the image…

So if it was a raster you would want to flood fill out to the middle of the roads and then return everything within the flooded area?

the main idea was to group the red square as an id group so I can control and connect all users that their current location is in this red square

You didn’t write anything about the technology stack you’re using. Maybe that’s not ideal, if you’re expecting any kind of hint.

I’m using react js with next.js

Ok, these are frontend components. You’ve mentioned some “query” to group elements. What language would that be in? SQL? Where do you plant to get your data from?

And how does this all relate to OpenStreetMap?

using PostgreSQL as DB and next.js for the backend.
What do you mean by “Where do you plan to get your data from?”

One potential approach might be to calculate all polygons of such city blocks enclosed by roads in advance, then do a point-in-polygon query to find the block for your location.

See the preparation steps up to 2.5 in this tutorial about a different problem: How to make a “Retreats from Streets” map. This requires the PostGIS extension.