Giter Site home page Giter Site logo

Comments (4)

grimzy avatar grimzy commented on August 20, 2024

Controller.php

use Grimzy\LaravelMysqlSpatial\Types\Point;

from laravel-mysql-spatial.

keithgulbro avatar keithgulbro commented on August 20, 2024

@grimzy Hi, thanks that fixed my error but now I am noticing that the record inserted into my database looks like this:

POINT(-43.76543 -40.1134343)

but I expected it to become a JSON object inside the database. The reason I'm asking this is because for the project that I'm implementing this in, I'm trying to implement https://www.algolia.com/doc/guides/searching/geo-search/ which requires a database column _geoloc that has coordinates in JSON format.

I figured this package would help me out since my current MySQL version (5.6) doesn't allow JSON datatypes.

from laravel-mysql-spatial.

grimzy avatar grimzy commented on August 20, 2024

Unfortunately, when using Spatial Types, MySQL doesn't store the the data in a JSON string:
https://dev.mysql.com/doc/refman/5.7/en/gis-data-formats.html

You'll have to upgrade your MySQL version and use the JSON type or use some kind of String type.

from laravel-mysql-spatial.

keithgulbro avatar keithgulbro commented on August 20, 2024

@grimzy Thanks for the quick response and feedback, I really appreciate it!

from laravel-mysql-spatial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.