Last active
June 12, 2020 14:29
-
-
Save ajsb85/9b06ca61edd44a82c126cd7f1b81e301 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* If you are going to connect to the live API server to run a quick | |
* test that adds new data, such as POIs, with test/imaginary values | |
* please be responsible and delete them afterwards. | |
*/ | |
require_once 'Services/OpenStreetMap.php'; | |
$config = array( | |
// A password file, is a colon delimited file. | |
// Eg. [email protected]:yabbadabbado | |
'passwordfile' => './credentials', | |
// The live API server is api.openstreetmap.org | |
'server' => 'https://api06.dev.openstreetmap.org/', | |
); | |
$osm = new Services_OpenStreetMap($config); | |
$changeset = $osm->createChangeset(); | |
$changeset->begin("Added traffic signals Barceloneta."); | |
// The latitude and longitude values here are intentionally invalid, see | |
// note above. | |
$lat = 41.3874572; | |
$lon = 2.1962599; | |
$node = $osm->createNode($lat, $lon, array( | |
'highway' => 'traffic_signals' | |
); | |
$changeset->add($node); | |
$changeset->commit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment