Deprecated - please use dbgeo instead.
A Node.js module for returning MySQL query results as usable GeoJSON or TopoJSON objects. Ideally paired with node-mysql.
npm install mysql2geojson
var mysql2geojson = require("mysql2geojson");
// MySQL query...
mysql2geojson.parse({
"data": data,
"format": "geojson",
"callback": function(error, result) {
if (error) {
console.log(error);
}
// This will log a valid GeoJSON object
console.log(result)
}
});
params is an object that contains the following keys:
- data (required) - Results from a MySQL query. Geometry must be selected AsWKT.
- format - can be either "geojson" or "topojson". Default is "geojson".
- geometry - name of column that contains geometry. Default is "geometry".
- callback(error, result) (required) - a function with two parameters: an error, and a result object
CC0