Skip to content
Snippets Groups Projects
Select Git revision
  • 0.1.0
  • master default protected
  • 0.1.1
3 results

spatialTools

Nate Hilker's avatar
Nate Hilker authored
cbeb0b30
History

TODO: proper readme

Long Story Short

Includes SpatialTools, a static class for generating Geometry from various sources / formats along with utility methods.

$geometry = SpatialTools::load($geojson);

Also includes SpatialTrait for Eloquent models.

class Office extends Model {
	
	use IANRMedia\SpatialTrait;

	public $spatialFields = ['location'];

}

// ...

$point = new IANRMedia\Geometry\Point(-96.668522, 40.828983);
$area = IANRMedia\SpatialTools::pointToCircle($point, 1000);

$offices = Office::within('location', $area)->get();