Christian Mayer und Marc Jansen
FOSSGIS 2015, Münster, 12.03.2015
A platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.Quelle: https://www.openshift.com/products/technologies
A platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.Quelle: https://www.openshift.com/products/technologies
console.log("Hello, World");
>> node hello-world.js
>> Hello, World
Einfache HTTP-Schnittstelle (Port 8888)
// native dep
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {
'Content-Type': 'text/html'
});
res.write('Hallo FOSSGIS 2015');
res.end();
}).listen(8888);
>> nvm ls-remote # Welche Versionen gibt es?
>> nvm use v0.12.0 # Verwende nun v0.12.0
mapping, map,gis,geo,osm
(Anfang März 2015)
>> npm install package_name # installiert lokal
>> npm install ol-app-setup -g # installiert global
>> npm install # liest package.json aus
weitere Informationen...
>> npm install turf
// create a geojson point object by turf wrapper ...
var point1 = turf.point([7.8, 51.8]);
// ... and buffer it
var buffered = turf.buffer(point1, 100);
>> npm install shapefile
// 3rd party deps
var shapefile = require('shapefile');
// create a shapefile reader
var reader = shapefile.reader(
'data/shapefile/bands.shp',
{encoding: 'UTF-8'}
);
// read the features
reader.readHeader(function(error, header) {
if (error) throw error;
readFeature(reader);
});
/**
* Reads a geojson representation of the shp features
*/
function readFeature(reader) {
reader.readRecord(function(error, record) {
if(record != shapefile.end) {
console.log(record);
readFeature(reader);
}
});
}
>> npm install proj4
// 3rd party deps
var proj4 = require('proj4');
// reproject a point
var projected = proj4('EPSG:4326', 'EPSG:900913', [2,5]);
console.log(projected);
>> node proj4.js
>> [ 222638.98158654713, 557305.2572745753 ]
openlayers
leaflet
+ Pluginsd3
+ Pluginsol-app-setup
>> npm install ol-app-setup -g
>> ol-app-setup -t /tmp/foo -v ol3 -s
Diese Folien sind unter CC BY-SA veröffentlicht.