Skip to content

Help performing mass insert with Eloquent #118

Open
@dbarrow

Description

@dbarrow

I would like to do a mass insert, using eloquent, of thousands of points. I have tried the following with out success.

$points is an array of [n, e] coordinates.

      $piles_array = array();
      foreach($points as $point)
      {
         $pile = new Pile();
         $pile->location = new Point($point[0], $point[1]);
         $pile->elevation = $point[2];
         $pile->desc = 'desc';
         $pile->name = 'name';
         array_push($piles_array, $pile->toArray());
       }
       Pile::insert($piles_array);

The code gives an error:

SQLSTATE[22003]: Numeric value out of range: 1416 Cannot get geometry object from data you send to the GEOMETRY field (SQL: insert into piles (desc, elevation, location, name) values (desc, 32.64733630635054, 411649.09109895 1797113.9031335, name))

Any help would be appreciated.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions