]> rtime.felk.cvut.cz Git - hubacji1/simple-stage.git/commitdiff
Update readme, add spatialite deps add/spatialite
authorJiri Vlasak <jiri.vlasak.2@cvut.cz>
Thu, 17 Jun 2021 11:32:52 +0000 (13:32 +0200)
committerJiri Vlasak <jiri.vlasak.2@cvut.cz>
Wed, 28 Jul 2021 06:40:44 +0000 (08:40 +0200)
README.md
meson.build

index d10e6f481b4e459e30c023cde5fa967e118c0371..95e419157350a06bfa1584803b518449b61d22b3 100644 (file)
--- a/README.md
+++ b/README.md
@@ -19,6 +19,7 @@ Prerequisities
 
 - You need to have the [Stage][1] simulator.
 - You must set proper paths in the `meson.build` file.
+- When using `wo.db`, you need `sqlite3` and `spatialite`.
 
 Building
 --------
@@ -43,6 +44,28 @@ And run the `stage.sh` from the `build` directory:
 
     stage.sh ../worlds/test_track.world
 
+Spatialite
+----------
+
+[Spatialite][3] is GIS extension to SQLite. When everything is installed,
+preparing the database looks like:
+
+    sqlite3 wo.db
+    select load_extension('mod_spatialite');
+    select InitSpatialMetadata(1);
+
+Create table:
+
+    create table if not exists 'paths' ('id' integer primary key autoincrement not null);
+    select AddGeometryColumn('paths', 'geom', 4326, 'MULTIPOINT', 'XY', 1);
+    select CreateSpatialIndex('paths', 'geom');
+
+Add path for `test_track.world`:
+
+    insert into paths values (null, GeomFromText('MULTIPOINT(3.5 -8.5, 5 -6, 3 -4, -4 -3.5, -5.5 -0.5, -4 1.5, -1 1, 6 -2, 8.5 3, 6 4.5, 3 5.5, 0 8, -6 8, -8 0, -8 -6, -7 -8, -5 -8.5)', 4326));
+
+[3]: https://www.gaia-gis.it/fossil/libspatialite/index
+
 
 Simple situations
 =================
index e814d818d5d862c32ff86f214f6ae575f3a14b74..036064bbd78cc85088ac3d70663517f9184c8207 100644 (file)
@@ -3,6 +3,10 @@ stginc = include_directories('/path/to/Stage/libstage')
 stgdep = meson.get_compiler('cpp').find_library(
        'stage', dirs: ['/path/to/stg/lib'],
 )
+sqldep = [
+       meson.get_compiler('cpp').find_library('spatialite'),
+       meson.get_compiler('cpp').find_library('sqlite3'),
+]
 
 library('goforward',
        'ctrl/goforward.cc',