Skip to content

Instantly share code, notes, and snippets.

View tormi's full-sized avatar
🇪🇪
Working from home

Tormi Tabor tormi

🇪🇪
Working from home
View GitHub Profile
@tormi
tormi / overpass.geojson
Created November 27, 2013 10:36 — forked from anonymous/overpass.geojson
data exported by overpass turbo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tormi
tormi / overpass.geojson
Created November 27, 2013 10:36 — forked from anonymous/overpass.geojson
data exported by overpass turbo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tormi
tormi / overpass.geojson
Created November 27, 2013 10:41 — forked from anonymous/overpass.geojson
data exported by overpass turbo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tormi
tormi / overpass.geojson
Created November 27, 2013 10:41 — forked from anonymous/overpass.geojson
data exported by overpass turbo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tormi
tormi / Koidu_hooned.geojson
Last active December 29, 2015 12:58 — forked from anonymous/overpass.geojson
Koidu küla hooned. Data exported by overpass turbo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tormi
tormi / ehitised_saue_vald.geojson
Last active December 29, 2015 12:59 — forked from anonymous/overpass.geojson
Saue valla ehitised, www.openstreetmap.org, 2013-11-27
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>OpenLayers MBTiles Example</title>
<link rel="stylesheet" href="http://openlayers.org/dev/theme/default/style.css" type="text/css">
<link rel="stylesheet" href="http://openlayers.org/dev/examples/style.css" type="text/css">
<style>
<?php
/**
* Read a CSV file.
*/
public function readCSV($file) {
$data = array();
if (file_exists($file)) {
$file_handle = fopen($file, 'r');
while (!feof($file_handle)) {
<?php
/**
* Write JSON encoded data to disk.
*/
protected function writeJson($filename, $data) {
if (!file_exists($this->getJsonDirectory())) {
if (!drush_mkdir($this->getJsonDirectory())) {
return drush_set_error('NO_JSON_DIR', dt('Unable to create JSON directory at !file', array('!file' => $this->getJsonDirectory())));
}
}
<?php
$headers = array();
foreach ($xml->ROW->children() as $field) {
$headers[] = $field->getName();
}
$csv_filename = str_replace('xml', 'csv', $filename);
$file = $this->getCsvDirectory() . '/' . $csv_filename;
if (file_exists($file)) {