Go driver for libspatialite
First you must install both sqlite3 and libspatialite C libraries.
Then
go get -u github.com/briansorahan/spatialite
db, err := sql.Open("spatialite", "my.db")
Check out the tests to see more example code.
database/sql driver for libspatialite
License: MIT License
Go driver for libspatialite
First you must install both sqlite3 and libspatialite C libraries.
Then
go get -u github.com/briansorahan/spatialite
db, err := sql.Open("spatialite", "my.db")
Check out the tests to see more example code.
I think the err InitSpatiaMetaData() error:"table spatial_ref_sys already exists"
should be ignored here, users will get the error when opening the same database every time
stmt, err := conn.Prepare(`SELECT InitSpatialMetaData(1)`)
if err != nil {
return nil, err
}
The dependence to mattn/go-sqlite3 require the v2 but this version is incompatible and should be reversed to v1.14.16.
Cf mod.go :
require github.com/mattn/go-sqlite3 v2.0.3+incompatible
Test seem to be failing
% go test;
--- FAIL: TestBufferGeoJSON (0.06s)
driver_test.go:42: expected {"type":"Polygon","coordinates":[[[2,0],[1.997259069509148,-0.104671912485888],[1.989043790736547,-0.209056926535307],[1.975376681190276,-0.312868930080461],[1.956295201467611,-0.415823381635518],[1.931851652578137,-0.517638090205041],[1.902113032590307,-0.618033988749894],[1.867160852994404,-0.7167358990906],[1.827090915285202,-0.8134732861516],[1.782013048376736,-0.907980999479093],[1.732050807568878,-0.999999999999999],[1.677341135890849,-1.089278070030053],[1.618033988749896,-1.175570504584945],[1.554291922913942,-1.258640782099674],[1.486289650954789,-1.338261212717715],[1.414213562373096,-1.414213562373094],[1.338261212717718,-1.486289650954787],[1.258640782099676,-1.554291922913941],[1.175570504584948,-1.618033988749894],[1.089278070030056,-1.677341135890847],[1.000000000000002,-1.732050807568876],[0.907980999479096,-1.782013048376735],[0.813473286151603,-1.827090915285201],[0.716735899090603,-1.867160852994402],[0.618033988749898,-1.902113032590306],[0.517638090205045,-1.931851652578136],[0.415823381635522,-1.95629520146761],[0.312868930080466,-1.975376681190275],[0.209056926535311,-1.989043790736546],[0.104671912485892,-1.997259069509147],[0.000000000000005,-2],[-0.104671912485882,-1.997259069509148],[-0.209056926535301,-1.989043790736547],[-0.312868930080456,-1.975376681190276],[-0.415823381635513,-1.956295201467612],[-0.517638090205035,-1.931851652578138],[-0.618033988749888,-1.902113032590309],[-0.716735899090594,-1.867160852994406],[-0.813473286151594,-1.827090915285205],[-0.907980999479087,-1.782013048376739],[-0.999999999999993,-1.732050807568881],[-1.089278070030048,-1.677341135890852],[-1.17557050458494,-1.6180339887499],[-1.258640782099668,-1.554291922913947],[-1.33826121271771,-1.486289650954794],[-1.414213562373089,-1.414213562373101],[-1.486289650954782,-1.338261212717723],[-1.554291922913936,-1.258640782099682],[-1.618033988749889,-1.175570504584954],[-1.677341135890843,-1.089278070030063],[-1.732050807568872,-1.000000000000009],[-1.782013048376731,-0.907980999479103],[-1.827090915285197,-0.813473286151611],[-1.867160852994399,-0.716735899090611],[-1.902113032590304,-0.618033988749906],[-1.931851652578134,-0.517638090205053],[-1.956295201467609,-0.415823381635531],[-1.975376681190274,-0.312868930080474],[-1.989043790736545,-0.20905692653532],[-1.997259069509147,-0.104671912485901],[-2,-0.000000000000014],[-1.997259069509149,0.104671912485874],[-1.989043790736548,0.209056926535293],[-1.975376681190278,0.312868930080447],[-1.956295201467614,0.415823381635504],[-1.93185165257814,0.517638090205027],[-1.902113032590312,0.61803398874988],[-1.867160852994409,0.716735899090586],[-1.827090915285208,0.813473286151586],[-1.782013048376743,0.907980999479079],[-1.732050807568886,0.999999999999986],[-1.677341135890857,1.08927807003004],[-1.618033988749905,1.175570504584932],[-1.554291922913953,1.258640782099661],[-1.4862896509548,1.338261212717703],[-1.414213562373108,1.414213562373082],[-1.33826121271773,1.486289650954776],[-1.258640782099689,1.55429192291393],[-1.175570504584961,1.618033988749884],[-1.089278070030069,1.677341135890839],[-1.000000000000015,1.732050807568869],[-0.907980999479108,1.782013048376728],[-0.813473286151615,1.827090915285195],[-0.716735899090615,1.867160852994398],[-0.618033988749909,1.902113032590303],[-0.517638090205055,1.931851652578133],[-0.415823381635532,1.956295201467608],[-0.312868930080474,1.975376681190274],[-0.209056926535319,1.989043790736545],[-0.104671912485899,1.997259069509147],[-0.000000000000011,2],[0.104671912485877,1.997259069509148],[0.209056926535297,1.989043790736548],[0.312868930080453,1.975376681190277],[0.41582338163551,1.956295201467613],[0.517638090205034,1.931851652578139],[0.618033988749888,1.90211303259031],[0.716735899090594,1.867160852994406],[0.813473286151595,1.827090915285204],[0.907980999479089,1.782013048376738],[0.999999999999996,1.73205080756888],[1.08927807003005,1.677341135890851],[1.175570504584943,1.618033988749897],[1.258640782099672,1.554291922913944],[1.338261212717714,1.48628965095479],[1.414213562373094,1.414213562373097],[1.486289650954787,1.338261212717718],[1.554291922913941,1.258640782099676],[1.618033988749895,1.175570504584947],[1.677341135890848,1.089278070030054],[1.732050807568878,0.999999999999999],[1.782013048376736,0.907980999479092],[1.827090915285203,0.813473286151599],[1.867160852994404,0.716735899090598],[1.902113032590308,0.618033988749892],[1.931851652578138,0.517638090205038],[1.956295201467612,0.415823381635515],[1.975376681190276,0.312868930080457],[1.989043790736547,0.209056926535302],[1.997259069509148,0.104671912485882],[2,0]]]}, got {"type":"Polygon","coordinates":[[[2,0],[1.997259069509148,-0.104671912485888],[1.989043790736547,-0.209056926535307],[1.975376681190276,-0.312868930080461],[1.956295201467611,-0.415823381635518],[1.931851652578137,-0.517638090205041],[1.902113032590307,-0.618033988749894],[1.867160852994404,-0.7167358990906],[1.827090915285202,-0.8134732861516],[1.782013048376736,-0.907980999479093],[1.732050807568878,-0.999999999999999],[1.677341135890849,-1.089278070030053],[1.618033988749896,-1.175570504584945],[1.554291922913943,-1.258640782099674],[1.486289650954789,-1.338261212717716],[1.414213562373096,-1.414213562373094],[1.338261212717718,-1.486289650954787],[1.258640782099676,-1.554291922913941],[1.175570504584948,-1.618033988749894],[1.089278070030056,-1.677341135890847],[1.000000000000002,-1.732050807568876],[0.907980999479096,-1.782013048376735],[0.813473286151603,-1.827090915285201],[0.716735899090603,-1.867160852994402],[0.618033988749898,-1.902113032590306],[0.517638090205045,-1.931851652578136],[0.415823381635522,-1.95629520146761],[0.312868930080466,-1.975376681190275],[0.209056926535311,-1.989043790736546],[0.104671912485892,-1.997259069509147],[0.000000000000005,-2],[-0.104671912485882,-1.997259069509148],[-0.209056926535301,-1.989043790736547],[-0.312868930080456,-1.975376681190276],[-0.415823381635513,-1.956295201467612],[-0.517638090205035,-1.931851652578138],[-0.618033988749888,-1.902113032590309],[-0.716735899090594,-1.867160852994406],[-0.813473286151594,-1.827090915285205],[-0.907980999479087,-1.782013048376739],[-0.999999999999993,-1.732050807568881],[-1.089278070030048,-1.677341135890853],[-1.17557050458494,-1.6180339887499],[-1.258640782099668,-1.554291922913947],[-1.33826121271771,-1.486289650954794],[-1.414213562373088,-1.414213562373102],[-1.486289650954782,-1.338261212717723],[-1.554291922913936,-1.258640782099682],[-1.618033988749889,-1.175570504584954],[-1.677341135890843,-1.089278070030063],[-1.732050807568872,-1.000000000000009],[-1.782013048376731,-0.907980999479103],[-1.827090915285197,-0.813473286151611],[-1.867160852994399,-0.716735899090611],[-1.902113032590304,-0.618033988749906],[-1.931851652578134,-0.517638090205053],[-1.956295201467609,-0.415823381635531],[-1.975376681190274,-0.312868930080474],[-1.989043790736545,-0.20905692653532],[-1.997259069509147,-0.104671912485901],[-2,-0.000000000000014],[-1.997259069509149,0.104671912485874],[-1.989043790736548,0.209056926535293],[-1.975376681190278,0.312868930080447],[-1.956295201467614,0.415823381635504],[-1.93185165257814,0.517638090205027],[-1.902113032590312,0.61803398874988],[-1.867160852994409,0.716735899090586],[-1.827090915285208,0.813473286151586],[-1.782013048376743,0.907980999479079],[-1.732050807568886,0.999999999999986],[-1.677341135890857,1.08927807003004],[-1.618033988749905,1.175570504584932],[-1.554291922913953,1.258640782099661],[-1.4862896509548,1.338261212717703],[-1.414213562373108,1.414213562373082],[-1.33826121271773,1.486289650954776],[-1.258640782099689,1.55429192291393],[-1.175570504584961,1.618033988749884],[-1.089278070030069,1.677341135890839],[-1.000000000000015,1.732050807568869],[-0.907980999479108,1.782013048376728],[-0.813473286151615,1.827090915285195],[-0.716735899090615,1.867160852994398],[-0.618033988749909,1.902113032590303],[-0.517638090205055,1.931851652578133],[-0.415823381635532,1.956295201467608],[-0.312868930080474,1.975376681190274],[-0.209056926535319,1.989043790736545],[-0.104671912485899,1.997259069509147],[-0.000000000000011,2],[0.104671912485877,1.997259069509148],[0.209056926535297,1.989043790736548],[0.312868930080453,1.975376681190277],[0.41582338163551,1.956295201467613],[0.517638090205034,1.931851652578139],[0.618033988749888,1.90211303259031],[0.716735899090594,1.867160852994406],[0.813473286151595,1.827090915285204],[0.907980999479089,1.782013048376738],[0.999999999999995,1.73205080756888],[1.08927807003005,1.677341135890851],[1.175570504584943,1.618033988749897],[1.258640782099672,1.554291922913944],[1.338261212717714,1.48628965095479],[1.414213562373093,1.414213562373097],[1.486289650954787,1.338261212717718],[1.554291922913941,1.258640782099676],[1.618033988749895,1.175570504584946],[1.677341135890848,1.089278070030054],[1.732050807568878,0.999999999999999],[1.782013048376736,0.907980999479092],[1.827090915285203,0.813473286151599],[1.867160852994404,0.716735899090598],[1.902113032590308,0.618033988749892],[1.931851652578138,0.517638090205038],[1.956295201467612,0.415823381635515],[1.975376681190276,0.312868930080457],[1.989043790736547,0.209056926535302],[1.997259069509148,0.104671912485882],[2,0]]]}
FAIL
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.