2017 © Pedro Peláez
 

library osm

OpenStreetMap API Integration

image

kage-no-neko/osm

OpenStreetMap API Integration

  • Wednesday, October 25, 2017
  • by KageNoNeko
  • Repository
  • 2 Watchers
  • 2 Stars
  • 98 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 36 % Grown

The README.md

osm

OpenStreetMap API Integration, (*1)

Basic Usage

Find nodes in Germany bounding box: NE 55.05814, 15.04205 SW 47.27021, 5.86624, (*2)

$south = 47.27021;
$west = 5.86624;
$north = 55.05814;
$east = 15.04205;

// create bounding box
$bBox = new \KageNoNeko\OSM\BoundingBox($south, $west, $north, $east);

// slice to lesser boxes to reduce memory usage
$slices = $bBox->slices(4, 4);

// create connection to Overpass API source
$osm = new \KageNoNeko\OSM\OverpassConnection(['interpreter' => 'http://overpass-api.de/api/interpreter']);

// build query, like we usually do with Database queries
$q = $osm->element('node')
    ->whereTag('aeroway', 'aerodrome')
    ->verbosity('meta')
    ->asJson();

$nodes = [];
foreach ($slices as $slice) {
    //add constraint by boundary box of each slice and get result
    $response = $q->whereInBBox($slice)->get();
    $data = json_decode($response->getBody()->getContents());
    $nodes = array_merge($nodes, $data->elements);
}

The Versions

25/10 2017

dev-develop

dev-develop https://github.com/KageNoNeko/osm

OpenStreetMap API Integration

  Sources   Download

MIT

The Requires

 

The Development Requires

api osm open street map

25/10 2016

dev-master

9999999-dev https://github.com/KageNoNeko/osm

OpenStreetMap API Integration

  Sources   Download

MIT

The Requires

 

The Development Requires

api osm open street map

25/10 2016

0.2.5

0.2.5.0 https://github.com/KageNoNeko/osm

OpenStreetMap API Integration

  Sources   Download

MIT

The Requires

 

The Development Requires

api osm open street map

20/09 2016

0.2.4

0.2.4.0 https://github.com/KageNoNeko/osm

OpenStreetMap API Integration

  Sources   Download

MIT

The Requires

 

The Development Requires

api osm open street map

09/02 2016

0.2.3

0.2.3.0 https://github.com/KageNoNeko/osm

OpenStreetMap API Integration

  Sources   Download

MIT

The Requires

 

The Development Requires

api osm open street map

29/01 2016

0.2.1

0.2.1.0 https://github.com/KageNoNeko/osm

OpenStreetMap API Integration

  Sources   Download

MIT

The Requires

 

The Development Requires

api osm open street map

29/01 2016

0.2.0

0.2.0.0 https://github.com/KageNoNeko/osm

OpenStreetMap API Integration

  Sources   Download

MIT

The Requires

 

The Development Requires

api osm open street map