# Specifiying SRID to MySQL using bboverlaps

**URL:** <https://forum.djangoproject.com/t/specifiying-srid-to-mysql-using-bboverlaps/20319>\
**Category:** Mystery Errors\
**Created:** [April 17, 2023, 10:19am UTC](https://forum.djangoproject.com/t/specifiying-srid-to-mysql-using-bboverlaps/20319 "2023-04-17T10:19:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dnlburgess](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/dnlburgess/32/13270_2.png) [@dnlburgess](https://forum.djangoproject.com/u/dnlburgess)\
**Post date:** [April 17, 2023, 10:19am UTC](https://forum.djangoproject.com/t/specifiying-srid-to-mysql-using-bboverlaps/20319/1 "2023-04-17T10:19:08Z")

</div>

Hello, was wondering if anyone might be able to help here.  
I am using the [InBBoxFilter](https://github.com/openwisp/django-rest-framework-gis/tree/8febe79fb8291f20b8f6e9c53ac8db8a24ceb26e#inbboxfilter) provided by django-rest-framework-gis to filter a queryset of geometries in my ReadOnlyModelViewset (DRF):

```auto
from rest_framework import viewsets
from rest_framework_gis import filters

from sites_app.serializers import SiteSerializer

class SiteViewset(viewsets.ReadOnlyModelViewSet):
    bbox_filter_field = "geom"
    bbox_filter_include_overlapping = True
    filter_backends = (filters.InBBoxFilter,)
    serializer_class = SiteSerializer

```

When the query is made in the database, I get:

`django.db.utils.OperationalError: (3033, 'Binary geometry function mbroverlaps given two geometries of different srids: 27700 and 0, which should have been identical.')`

The SRID of the geometry column in the database is EPSG:27700, and the bounding box passed to the view also has EPSG:27700 coordinates - but it looks like the latter is being passed to the database without an SRID? Do I need to specify the SRID of the bounding box somewhere? I’ve tried to trace this through the source code but can’t see how to do this.

The database is MySQL. I was originally using PostgreSQL / PostGIS, and this code worked fine. Unfortunately, I’ve had to switch the database to MySQL, and that’s when the error started.

From the database logs, I can see that the query being run on the database is of the form

```auto
... WHERE MBROverlaps(`table`.`geom`, ST_GeomFromText('POLYGON ((<bbox coords>))'))

```

I.e. no SRID is passed to the database for the bounding box, which is presumably causing the problem because MySQL interprets that as being an SRID of 0.  
Any help on this would be very much appreciated. Many thanks.
