I have a SpatiaLite database using the projection EPSG:31983 and I can see it inside QGIS as the following:

[![enter image description here](https://i.stack.imgur.com/3cRZS.png)](https://i.stack.imgur.com/3cRZS.png)

When I use the following query I can successfully create a buffer of 100 meters on a point of this database:

```
SELECT GEOMETRY FROM lotes WHERE ST_Area(ST_Intersection(ST_Buffer(ST_GeomFromText('POINT ( 339298.446287788 7391719.02695803 )', 4326), 100), lotes.geometry)) > 0 AND lotes.rowid IN (SELECT rowid FROM SpatialIndex WHERE f_table_name = 'lotes' AND search_frame = ST_Buffer(ST_GeomFromText('POINT ( 339298.446287788 7391719.02695803 )', 4326), 100));

```

[![enter image description here](https://i.stack.imgur.com/IWjnt.png)](https://i.stack.imgur.com/IWjnt.png)

So far everything is fine...

My problem is that I'd like to use the projection EPSG:4326 instead of the EPSG:31983. So, I've converted my SpatiaLite database to the EPSG:4326 projection with the following command:

```
ogr2ogr -s_srs EPSG:31983 -t_srs EPSG:4326 -f SQLite -dsco SPATIALITE=YES lotes4326.sqlite lotes.sqlite

```

However, even though this conversion was successful, I don't manage to make my old query work properly after this projection conversion. The query either returns all my database or it returns nothing... I've tried the following:

```
SELECT GEOMETRY FROM lotes WHERE ST_Area(ST_Intersection(ST_Buffer(ST_GeomFromText('POINT ( -23.5770487595231 -46.57464981079102 )', 4326), 100), lotes.geometry)) > 0 AND lotes.rowid IN (SELECT rowid FROM SpatialIndex WHERE f_table_name = 'lotes' AND search_frame = ST_Buffer(ST_GeomFromText('POINT ( -23.5770487595231 -46.57464981079102 )', 4326), 100));

```

I've read [this other issue](https://gis.stackexchange.com/questions/387144/st-buffer-in-meters-from-4326-point-table) that is very similar to mine where it's recommended to use `points.geom::geography,...)::geometry` or "just cast to `geography`". But I didn't manage to make it work on the context of my query. And since that question is about PostGIS and not SpatiaLite I'm not sure if the same solution applies to SpatiaLite... What am I missing? How can I use `ST_Buffer` in meters while using the projection EPSG:4326?