Skip to main content
Bumped by Community user
added 2 characters in body
Source Link
Evan Carroll
  • 64.7k
  • 49
  • 251
  • 496

I'm trying to work with some data from Google Maps and have a few locations along with their bounding boxs (northeast, southwest) data stored.

Using that data, I have the following query...

SELECT
    * 
FROM
    `address_components` 
WHERE
    MBRContains (
        ST_MakeEnvelope (
            ST_GeomFromText ( 'POINT(39.643950680292 -79.981536819708)', 4326 ),
            ST_GeomFromText ( 'POINT(39.641252719708 -79.984234780292)', 4326 )
        ),
        `location`
    );

The problem I'm running into with this though is that it's saying:

3618 - st_makeenvelope(POINT, POINT)st_makeenvelope(POINT, POINT) has not been implemented for geographic spatial reference systems.

How can I work around this issue?

Additionally, how would I change this so that instead of hard-coding my bounding box, I can select a row based on a place_id and then find all records that its location falls within the envelope of?

I'm trying to work with some data from Google Maps and have a few locations along with their bounding boxs (northeast, southwest) data stored.

Using that data, I have the following query...

SELECT
    * 
FROM
    `address_components` 
WHERE
    MBRContains (
        ST_MakeEnvelope (
            ST_GeomFromText ( 'POINT(39.643950680292 -79.981536819708)', 4326 ),
            ST_GeomFromText ( 'POINT(39.641252719708 -79.984234780292)', 4326 )
        ),
        `location`
    );

The problem I'm running into with this though is that it's saying:

3618 - st_makeenvelope(POINT, POINT) has not been implemented for geographic spatial reference systems.

How can I work around this issue?

Additionally, how would I change this so that instead of hard-coding my bounding box, I can select a row based on a place_id and then find all records that its location falls within the envelope of?

I'm trying to work with some data from Google Maps and have a few locations along with their bounding boxs (northeast, southwest) data stored.

Using that data, I have the following query...

SELECT
    * 
FROM
    `address_components` 
WHERE
    MBRContains (
        ST_MakeEnvelope (
            ST_GeomFromText ( 'POINT(39.643950680292 -79.981536819708)', 4326 ),
            ST_GeomFromText ( 'POINT(39.641252719708 -79.984234780292)', 4326 )
        ),
        `location`
    );

The problem I'm running into with this though is that it's saying:

3618 - st_makeenvelope(POINT, POINT) has not been implemented for geographic spatial reference systems.

How can I work around this issue?

Additionally, how would I change this so that instead of hard-coding my bounding box, I can select a row based on a place_id and then find all records that its location falls within the envelope of?

edited title
Link

MySQL 8 Geospatial Queries, MakeEnvelope Workaround?

Source Link

MySQL 8 Geospatial Queries

I'm trying to work with some data from Google Maps and have a few locations along with their bounding boxs (northeast, southwest) data stored.

Using that data, I have the following query...

SELECT
    * 
FROM
    `address_components` 
WHERE
    MBRContains (
        ST_MakeEnvelope (
            ST_GeomFromText ( 'POINT(39.643950680292 -79.981536819708)', 4326 ),
            ST_GeomFromText ( 'POINT(39.641252719708 -79.984234780292)', 4326 )
        ),
        `location`
    );

The problem I'm running into with this though is that it's saying:

3618 - st_makeenvelope(POINT, POINT) has not been implemented for geographic spatial reference systems.

How can I work around this issue?

Additionally, how would I change this so that instead of hard-coding my bounding box, I can select a row based on a place_id and then find all records that its location falls within the envelope of?