-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No such function: X #1
Comments
I tested it and the X() function works for me. Are you calling the Example: var sqlite = require('spatialite');
var db = new sqlite.Database(':memory:');
var query = "SELECT X(Centroid(GeomFromText('POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))'))) AS x;";
db.spatialite(function(err) {
db.each(query, function(err, row) {
console.log(row.x);
});
}); |
Ah. My bad. I don't suppose it's possible to do it with prepared statements somehow? On Tue, Mar 19, 2013 at 5:32 PM, Zac McCormick notifications@github.comwrote:
|
I think it should be possible. This library just returns you a handle this library. So anything in their docs you should be able to do (with spatialite functions available). |
Right, the problem I'm seeing there is how to properly create the On Tue, Mar 19, 2013 at 6:03 PM, Zac McCormick notifications@github.comwrote:
|
Let's nevermind that for a moment. Following is the backtrace! /home/deepy/locals/bin/node fingaltrees.js > out.txt 2> err.txt On Tue, Mar 19, 2013 at 6:08 PM, Alex Nordlund deep.alexander@gmail.comwrote:
|
Whoa, what version of node are you using? I was able to get it work with prepared statements using the following pattern: var query = "SELECT X(Centroid(GeomFromText($point))) AS x;";
db.spatialite(function(err) {
var stmt = db.prepare(query);
stmt.all({ $point: 'POINT(27 -82)' }, function(err, row) {
console.log(row);
});
stmt.finalize(function(err, row) {
console.log('Done');
});
}); |
I'm on v0.10.0, but it seems to me to be a SQLite/spatialite related. The following database with the following code produces the crash: var qry = 'SELECT name, ((X(Geometry)-X(loc))(X(Geometry)-X(loc))) + On Tue, Mar 19, 2013 at 6:27 PM, Zac McCormick notifications@github.comwrote:
|
Is X() and Y() not included?
The text was updated successfully, but these errors were encountered: