ngageoint / geopackage-js

GeoPackage JavaScript Library
http://ngageoint.github.io/geopackage-js/
MIT License
304 stars 78 forks source link

Query Builder #104

Closed taviroquai closed 6 years ago

taviroquai commented 6 years ago

Hello,

I'm using GeoPackage now and found that it uses it's own query builder...

Is it too much trouble to use a well stablished query builder like http://knexjs.org ?

It would leave this package to focus on GeoPackage format and leave all the SQL API to KnexJS.

BTW, there is also TurfJS which can deal with geospatial operations.

Don't get me wrong, I'm just trying to figure out the best way to deal with GeoPackage format in Javascript.

Thanks!

danielbarela commented 6 years ago

One of the driving goals of this project was to be able to use it in the browser as well as in Node. I tried to stay away from dependencies wherever I could to reduce the size of the library. I felt that knex provided too much functionality that was unnecessary since GeoPackage is only a sqlite database. In addition, I could not find a way that knex would support sql.js which is how I get the in browser support.

That being said, if there is a way to use it in the browser and in Node, that does not significantly add to the size of the package, I would be willing to look into it.

As far as TurfJS goes, if you see places in the geopackage-js code that can be replaced by turf functions, I think that would be good.

If you see places that can be improved, please submit a pull request and we can talk about it. Any help is appreciated.