Coder Social home page Coder Social logo

mobilitydb / mobilitydb Goto Github PK

View Code? Open in Web Editor NEW
495.0 29.0 64.0 537.45 MB

MobilityDB is a geospatial trajectory data management & analysis platform, built on PostgreSQL and PostGIS.

Home Page: https://mobilitydb.com

License: Other

CMake 0.98% C 85.02% PLpgSQL 6.70% PLSQL 6.87% Shell 0.04% Makefile 0.11% Lex 0.03% Yacc 0.23% Dockerfile 0.02%
postgresql postgis spatiotemporal sql

mobilitydb's Introduction

Build Status Coverage Status Codacy Badge Gitter

MobilityDB

An open source geospatial trajectory data management & analysis platform

MobilityDB Logo

MobilityDB is a database management system for moving object geospatial trajectories, such as GPS traces. It adds support for temporal and spatio-temporal objects to the PostgreSQL database and its spatial extension PostGIS.

MobilityDB is developed by the Computer & Decision Engineering Department of the Université libre de Bruxelles (ULB) under the direction of Prof. Esteban Zimányi. ULB is an OGC Associate Member and member of the OGC Moving Feature Standard Working Group (MF-SWG).

OGC Associate Member Logo

The MobilityDB project is managed by a steering committee.

More information about MobilityDB, including publications, presentations, etc., can be found in the MobilityDB website.

Documentation

The pregenerated user and developer documentation can be found here.

To generate the documentation locally, refer to our documentation generation section

Benefits

Experimental Projects

These projects push the boundaries of MobilityDB and connect it with the PostgreSQL/PostGIS ecosystem.

Cloud

Visualization

Public Transport

Mailing Lists

There are two mailing lists for MobilityDB hosted on OSGeo mailing list server:

For general questions and topics about how to use MobilityDB, please write to the user mailing list.

Branches

  • The master branch has the development of the next release.
  • The stable-major.minor branches have the patch releases of the correspong major.minor release.

The complete list of releases is available here

Requirements

  • Linux (other UNIX-like systems may work, but remain untested)
  • CMake >= 3.7
  • PostgreSQL >= 12
  • PostGIS >= 3.0
  • GEOS >= 3.8
  • PROJ4 >= 6.1
  • JSON-C
  • GNU Scientific Library (GSL)
  • Development files for PostgreSQL, PostGIS, GEOS, PROJ4, JSON-C, GSL

For example, you can build the following command to install all MobilityDB build dependencies for Debian-based systems using PostgreSQL 16 and PostGIS 3:

apt install build-essential cmake postgresql-server-dev-16 libgeos-dev libproj-dev libjson-c-dev libgsl-dev

Building & Installation

Here is the gist:

git clone https://github.com/MobilityDB/MobilityDB
mkdir MobilityDB/build
cd MobilityDB/build
cmake ..
make
sudo make install

You should also set the following in postgresql.conf depending on the version of PostGIS you have installed (below we use PostGIS 3):

shared_preload_libraries = 'postgis-3'
max_locks_per_transaction = 128

If you do not preload the PostGIS library you will not be able to load the MobilityDB library and will get an error message such as the following one

ERROR:  could not load library "/usr/local/pgsql/lib/libMobilityDB-1.0.so": undefined symbol: ST_Distance

Notice that you can find the location of the postgresql.conf file as given next:

$ which postgres
/usr/local/pgsql/bin/postgres
$ ls /usr/local/pgsql/data/postgresql.conf
/usr/local/pgsql/data/postgresql.conf

As can be seen, the PostgreSQL binaries are in the bin subdirectory while the postgresql.conf file is in the data subdirectory.

Once MobilityDB is installed, it needs to be enabled in each database you want to use it in. In the example below we use a database named mobility.

createdb mobility
psql mobility -c "CREATE EXTENSION PostGIS"
psql mobility -c "CREATE EXTENSION MobilityDB"

Docker Container

Docker images with MobilityDB and all its dependencies are available here. These images are based on the official Postgres and Postgis docker images, please refer to them for more information.

If you have docker installed in your system you can run:

docker pull mobilitydb/mobilitydb
docker volume create mobilitydb_data
docker run --name mobilitydb -e POSTGRES_PASSWORD=mysecretpassword \
  -p 25432:5432 -v mobilitydb_data:/var/lib/postgresql -d mobilitydb/mobilitydb
psql -h localhost -p 25432 -U postgres

The first command is to download the latest most up-to-date image of MobilityDB. The second command creates a volume container on the host, that we will use to persist the PostgreSQL database files outside of the MobilityDB container. The third command executes this binary image of PostgreSQL, PostGIS, and MobilityDB with the TCP port 5432 in the container mapped to port 25432 on the Docker host (user = postgres, db = postgres, pw=mysecretpassword). The fourth command is to connect to the database using psql.

Note that you can define the environment variable PGPASSWORD to avoid an interactive pw prompt.

PGPASSWORD=mysecretpassword psql -h localhost -p 25432 -U postgres

Issues

Please report any issues you may have.

Generating the Documentation

Pregenerated versions of the user and developer documentation can be found here.

User's Manual

You can generate the user's manual in HTML, PDF, and EPUB formats. The manual is generated in English and in other available languages (currently only Spanish). For this, it is necessary to specify appropriate options in the cmake command as follows:

  • DOC_ALL: Generate in HTML, PDF, and EPUB formats
  • DOC_HTML: Generate in HTML format
  • DOC_PDF: Generate in PDF format
  • DOC_EPUB: Generate in EPUB format
  • LANG_ALL: Generate in all available languages
  • ES: Generate the Spanish documentation

For example, the following command generates the documentation in all formats and in all languages.

cmake -D DOC_ALL=true -D LANG_ALL=true ..
make doc

As another example, the following command generates the English documentation in PDF.

cmake -D DOC_PDF=true ..
make doc

The resulting documentation will be generated in the doc directory of the build directory.

Developer's Documentation

You can generate the English developer's documentation in HTML format. For this, it is necessary to the option DOC_DEV in the cmake command as follows:

cmake -D DOC_DEV=true ..
make doc_dev

The resulting HTML documentation will be generated in the doxygen directory of the build directory.

Licenses

mobilitydb's People

Contributors

alesuiss avatar chaitan94 avatar cvvergara avatar dionisiusmayr avatar diviloper avatar estebanzimanyi avatar flobaudry avatar mahmsakr avatar marianagarcez avatar mbakli avatar mohammadreza99a avatar mschoema avatar rchoquet42 avatar sswirydo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mobilitydb's Issues

Compiling for windows (under mingw64) - src/time_gist.c:497:44: error: incompatible type for argument 2 of 'period_cmp_bounds'

I'm making some progress getting a windows build after fiddling with the CMakeLists.txt file a bit. I got this far and not sure what is causing these errors
I tried with both PG 11 and PG 12 and got stuck at the same spot.

Any thoughts on how to fix -

-- Found PostgreSQL: C:/ming64gcc81/projects/postgresql/rel/pg11w64gcc81/lib/libpq.dll (found version "11.2")
Found 110000
-- WIN32=1
Found compatible 110000 include C:/ming64gcc81/projects/postgresql/rel/pg11w64gcc81/include;C:/ming64gcc81/projects/postgresql/rel/pg11w64gcc81/include/server
Found compatible 11.2
Found share C:/MING64~1/projects/POSTGR~1/rel/PG11W6~1/share lib C:/MING64~1/projects/POSTGR~1/rel/PG11W6~1/lib
-- Found LWGEOM at C:/ming64gcc81/projects/postgis/liblwgeom-2.5w64gcc81/lib/liblwgeom.dll.a include C:/ming64gcc81/projects/postgis/liblwgeom-2.5w64gcc81/include - compiling with PostGIS support
-- Found GSL at C:/ming64gcc81/projects/gsl/rel-gsl-2.6/lib/libgsl.dll.a, Found GSLCBLAS at C:/ming64gcc81/projects/gsl/rel-gsl-2.6/lib/libgslcblas.dll.a
-- Configuring done
-- Generating done
-- Build files have been written to: C:/ming64gcc81/projects/mobility/MobilityDB/build
Scanning dependencies of target sqlscript
[  1%] Generating mobilitydb--1.0-alpha1.sql.c
[  3%] Generating mobilitydb--1.0-alpha1.sql
[  3%] Built target sqlscript
Scanning dependencies of target control
[  5%] Generating mobilitydb.control
[  5%] Built target control
Scanning dependencies of target MobilityDB
[  6%] Building C object CMakeFiles/MobilityDB.dir/src/doublen.c.obj
[  8%] Building C object CMakeFiles/MobilityDB.dir/src/debug/indexesstat.c.obj
[ 10%] Building C object CMakeFiles/MobilityDB.dir/src/lifting.c.obj
[ 11%] Building C object CMakeFiles/MobilityDB.dir/src/oidcache.c.obj
C:/ming64gcc81/projects/mobility/MobilityDB/src/oidcache.c: In function 'populate_oidcache':
C:/ming64gcc81/projects/mobility/MobilityDB/src/oidcache.c:155:3: warning: implicit declaration of function 'bzero' [-Wimplicit-function-declaration]
   bzero(_op_oids, sizeof(_op_oids));
   ^~~~~
C:/ming64gcc81/projects/mobility/MobilityDB/src/oidcache.c:155:3: warning: incompatible implicit declaration of built-in function 'bzero'
[ 13%] Building C object CMakeFiles/MobilityDB.dir/src/period.c.obj
[ 15%] Building C object CMakeFiles/MobilityDB.dir/src/periodset.c.obj
[ 16%] Building C object CMakeFiles/MobilityDB.dir/src/rangetypes_ext.c.obj
[ 18%] Building C object CMakeFiles/MobilityDB.dir/src/tbox.c.obj
[ 20%] Building C object CMakeFiles/MobilityDB.dir/src/temporal.c.obj
[ 22%] Building C object CMakeFiles/MobilityDB.dir/src/temporali.c.obj
[ 23%] Building C object CMakeFiles/MobilityDB.dir/src/temporalinst.c.obj
[ 25%] Building C object CMakeFiles/MobilityDB.dir/src/temporals.c.obj
[ 27%] Building C object CMakeFiles/MobilityDB.dir/src/temporalseq.c.obj
[ 28%] Building C object CMakeFiles/MobilityDB.dir/src/temporal_aggfuncs.c.obj
C:/ming64gcc81/projects/mobility/MobilityDB/src/temporal_aggfuncs.c: In function 'random_level':
C:/ming64gcc81/projects/mobility/MobilityDB/src/temporal_aggfuncs.c:201:9: warning: implicit declaration of function 'ffsl' [-Wimplicit-function-declaration]
  return ffsl(~(random() & ((1l << SKIPLIST_MAXLEVEL) - 1)));
         ^~~~
C:/ming64gcc81/projects/mobility/MobilityDB/src/temporal_aggfuncs.c:201:32: warning: left shift count >= width of type [-Wshift-count-overflow]
  return ffsl(~(random() & ((1l << SKIPLIST_MAXLEVEL) - 1)));
                                ^~
[ 30%] Building C object CMakeFiles/MobilityDB.dir/src/temporal_analyze.c.obj
[ 32%] Building C object CMakeFiles/MobilityDB.dir/src/temporal_boolops.c.obj
[ 33%] Building C object CMakeFiles/MobilityDB.dir/src/temporal_boxops.c.obj
[ 35%] Building C object CMakeFiles/MobilityDB.dir/src/temporal_compops.c.obj
[ 37%] Building C object CMakeFiles/MobilityDB.dir/src/temporal_gist.c.obj
[ 38%] Building C object CMakeFiles/MobilityDB.dir/src/tnumber_mathfuncs.c.obj
[ 40%] Building C object CMakeFiles/MobilityDB.dir/src/temporal_parser.c.obj
[ 42%] Building C object CMakeFiles/MobilityDB.dir/src/temporal_posops.c.obj
[ 44%] Building C object CMakeFiles/MobilityDB.dir/src/temporal_selfuncs.c.obj
[ 45%] Building C object CMakeFiles/MobilityDB.dir/src/temporal_spgist.c.obj
[ 47%] Building C object CMakeFiles/MobilityDB.dir/src/temporal_textfuncs.c.obj
[ 49%] Building C object CMakeFiles/MobilityDB.dir/src/temporal_util.c.obj
[ 50%] Building C object CMakeFiles/MobilityDB.dir/src/temporal_waggfuncs.c.obj
[ 52%] Building C object CMakeFiles/MobilityDB.dir/src/timeops.c.obj
[ 54%] Building C object CMakeFiles/MobilityDB.dir/src/timestampset.c.obj
[ 55%] Building C object CMakeFiles/MobilityDB.dir/src/time_analyze.c.obj
[ 57%] Building C object CMakeFiles/MobilityDB.dir/src/time_gist.c.obj
In file included from C:/ming64gcc81/projects/postgresql/rel/pg11w64gcc81/include/server/postgres.h:46,
                 from C:/ming64gcc81/projects/mobility/MobilityDB/include/time_gist.h:16,
                 from C:/ming64gcc81/projects/mobility/MobilityDB/src/time_gist.c:14:
C:/ming64gcc81/projects/mobility/MobilityDB/src/time_gist.c: In function 'gist_period_double_sorting_split':
C:/ming64gcc81/projects/mobility/MobilityDB/src/time_gist.c:497:44: error: incompatible type for argument 2 of 'period_cmp_bounds'
    Assert(period_cmp_bounds(&lower, context.right_lower) >= 0);
                                     ~~~~~~~^~~~~~~~~~~~
C:/ming64gcc81/projects/postgresql/rel/pg11w64gcc81/include/server/c.h:724:7: note: in definition of macro 'Trap'
   if (condition) \
       ^~~~~~~~~
C:/ming64gcc81/projects/mobility/MobilityDB/src/time_gist.c:497:4: note: in expansion of macro 'Assert'
    Assert(period_cmp_bounds(&lower, context.right_lower) >= 0);
    ^~~~~~
In file included from C:/ming64gcc81/projects/mobility/MobilityDB/src/time_gist.c:21:
C:/ming64gcc81/projects/mobility/MobilityDB/include/period.h:83:75: note: expected 'const PeriodBound *' {aka 'const struct <anonymous> *'} but argument is of type 'PeriodBound' {aka 'struct <anonymous>'}
 extern int period_cmp_bounds(const PeriodBound *lower, const PeriodBound *upper);
                                                        ~~~~~~~~~~~~~~~~~~~^~~~~
make[2]: *** [CMakeFiles/MobilityDB.dir/build.make:484: CMakeFiles/MobilityDB.dir/src/time_gist.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:954: CMakeFiles/MobilityDB.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
[  3%] Built target sqlscript
[  5%] Built target control
[  6%] Building C object CMakeFiles/MobilityDB.dir/src/time_gist.c.obj
In file included from C:/ming64gcc81/projects/postgresql/rel/pg11w64gcc81/include/server/postgres.h:46,
                 from C:/ming64gcc81/projects/mobility/MobilityDB/include/time_gist.h:16,
                 from C:/ming64gcc81/projects/mobility/MobilityDB/src/time_gist.c:14:
C:/ming64gcc81/projects/mobility/MobilityDB/src/time_gist.c: In function 'gist_period_double_sorting_split':
C:/ming64gcc81/projects/mobility/MobilityDB/src/time_gist.c:497:44: error: incompatible type for argument 2 of 'period_cmp_bounds'
    Assert(period_cmp_bounds(&lower, context.right_lower) >= 0);
                                     ~~~~~~~^~~~~~~~~~~~
C:/ming64gcc81/projects/postgresql/rel/pg11w64gcc81/include/server/c.h:724:7: note: in definition of macro 'Trap'
   if (condition) \
       ^~~~~~~~~
C:/ming64gcc81/projects/mobility/MobilityDB/src/time_gist.c:497:4: note: in expansion of macro 'Assert'
    Assert(period_cmp_bounds(&lower, context.right_lower) >= 0);
    ^~~~~~
In file included from C:/ming64gcc81/projects/mobility/MobilityDB/src/time_gist.c:21:
C:/ming64gcc81/projects/mobility/MobilityDB/include/period.h:83:75: note: expected 'const PeriodBound *' {aka 'const struct <anonymous> *'} but argument is of type 'PeriodBound' {aka 'struct <anonymous>'}
 extern int period_cmp_bounds(const PeriodBound *lower, const PeriodBound *upper);
                                                        ~~~~~~~~~~~~~~~~~~~^~~~~
make[2]: *** [CMakeFiles/MobilityDB.dir/build.make:484: CMakeFiles/MobilityDB.dir/src/time_gist.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:954: CMakeFiles/MobilityDB.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

test.sh problems

Copied from here: #129 (comment) but only mentions what are the intended task, without mentioning what is the problem.

Three changes are needed in the test/scripts/test.sh file.
1- To make MobilityDB used by the test files, we need to set the shared_preload_libraries configuration parameter to Postgis-2.5.so.
2- To load the prerequisites tables, we need to get the load.sql.xz file from the source of the project. The change is in the following three files: test/general/CMakeLists.txt, test/point/CMakeLists.txt, test/npoint/CMakeLists.txt.
3- To start Postgres, the parameter run_ctl needs to be replaced with $PGCTL to get the complete command parameters and to print a message in the log file that is used to indicate whether PostgreSQL has started or not.

Test_shell is only processing one file

git ls-files | grep '\.sh'
doc/genpotfiles.sh
doc/genxmlfiles.sh
doc/install.sh
test/scripts/print_fail.sh
test/scripts/test.sh
tools/scripts/test_license.sh
tools/scripts/test_shell.sh

is processing only doc/genpotfiles.sh

Naming convention for temporal types

Overview

Right now there are two ways of naming being followed for temporal types.

After a small discussion with @estebanzimanyi and @mahmsakr, we felt it might be a good idea to get a more external perspective on this before making the final call.

Approach 1

This approach is followed currently by MobilityDB's main database codebase

Temporal Duration Name Base Type Specific Examples
Temporal temporal tint, tgeompoint
Instant temporalinst tintinst, tgeompointinst
Instant Set temporali tinti, tgeompointi
Sequence temporalseq tintseq, tgeompointseq
Sequence Set temporals tints, tgeompoints

This approach is also followed currently by MobilityDB's python driver codebase

(Although a slight change in terms of case sensitivity - which I think is fine considering C vs Python)

Temporal Duration Class Name Base Type Specific Examples
Temporal Temporal TInt, TGeomPoint
Instant TemporalInst TIntInst, TGeomPointInst
Instant Set TemporalI TIntI, TGeomPointI
Sequence TemporalSeq TIntSeq, TGeomPointSeq
Sequence Set TemporalS TIntS, TGeomPointS

Approach 2

This approach is followed currently by MEOS's codebase

Temporal Duration Class Name Base Type Specific Examples
Temporal Temporal Temporal<int>, Temporal<Geometry>
Instant TInstant TInstant<int>, TInstant<Geometry>
Instant Set TInstantSet TInstantSet<int>, TInstantSet<Geometry>
Sequence TSequence TSequence<int>, TSequence<Geometry>
Sequence Set TSequenceSet TSequenceSet<int>, TSequenceSet<Geometry>

This approach is also followed currently by PyMEOS

(Although a slight change being the base type being included within the class name itself as Python doesn't support template parameters)

Temporal Duration Class Name Base Type Specific Examples
Temporal Temporal TemporalInt, TemporalGeom
Instant TInstant TInstantInt, TInstantGeom
Instant Set TInstantSet TInstantSetInt, TInstantSetGeom
Sequence TSequence TSequenceInt, TSequenceGeom
Sequence Set TSequenceSet TSequenceSetInt, TSequenceSetGeom

Comparision

The case for Approach 1

  • Has already been used/mentioned in a few papers and other media, and might need them to change accordingly
  • Is less technical (not using terms like Set), more close to English and hence sounds more natural

The case for Approach 2

  • Readability - More explicit on the type of duration currently being dealt with.
  • Reduces ease of errors - There has also been a point raised about this approach being a bit resilient against accidental typos (compared in Approach 1 where it is easy to accidentally use temporals instead of temporal)
  • It is more technical and hence is always a bit unambiguous while communicating

One other point to note is that in Approach 1, base type comes before the temporal duration, while it is the reverse in Approach 2. Example: TIntInst vs TInstantInt. I cannot objectively say which is better here. But the rationale behind these were:

Base Type before Temporal Duration

  • It was natural choice on postgres extension side, as the publicly exposed types were tint, and tgeompoint
  • It is also natural to say "integer sequence" rather than "sequence (of) integer"

Temporal Duration before Base Type

  • It was a natural choice for using template classes in C++. Example: TInstant<int>
  • In terms of Python, I felt in future this suffix can be dropped altogether if we are able to add dtype like inference similar to how numpy functions, leaving TInstantInt to become something like TInstant with a dtype on the object representing the base type

Conclusion

I hope the above gives more context and insight to make the right decision. We can use this issue to collect community feedback and decide accordingly.

Plans for PostGIS 3

Thanks for the awesome project. Quick question are we compatible with PostGIS 3 yet? If not are there plans?

Problem with operator

Dear Esteban

last month, i installed MobilityDB using docker in my Ubuntu platform
this database was working fine..

Until i have try to using the temporal operators like &=, #<, etc
This operator not working in my Ubuntu installation, but it did well when i used
the demo version, in demo.mobilitydb.eu

Do you have some explanation ?

regards
Irya Wisnubhadra

Winnie build and packaging

The build that @robe2 is doing on winnie are based on the CMakeLists.txt is

https://github.com/cvvergara/MobilityDB/blob/add-winnie/CMakeLists.txt

this branch that is the one that @robe2 is using:
https://github.com/cvvergara/MobilityDB/tree/add-winnie

And the work is done in:
https://winnie.postgis.net:444/view/MobilityDb/

I am in constant communication with @robe2, to make adjustments to the scripts & cmake files (CMakeLists.txt)

A commit that will revert changes that happened on 3ee2c52 is in the PR #131

Do not distub the build while we work on this

Some useful cmake files

Locate the issue if applicable
As a first step to make the CMakeLists build for more OS, add some cmake files that are know to work on other projects specifically on pgRouting.

"temporal values cannot overlap on time" after atGeometry

Hello again,

I would like some help with another intersection issue. I have a MobilityDB trajectory stored in PostGIS. The process of storing enforces the the trajectory validity checks, so the temporal values are increasing (and there are no duplicates).

However, I've encountered an issue where taking the intersection (using atGeometry) results in the error "The temporal values cannot overlap on time: 2020-08-05 14:25:10.325721+00, 2020-08-05 14:19:30+00".

How does this happen? I would think that each intersecting segment would be its own temporal Period, separate (and forward in time) from the other intersecting segments.

The trajectory exits and re-enters the polygon several times, but how does that make the time periods overlap?

Thank you,
Wendell
overlap.zip
image

Travis & Coveralls

From the comment #85 (comment)

Is the file travis.yml still needed ? I think it is redundant with the new workflow.

Travis is used in the coverage/coveralls CI
tasks:

  • add an action for the coverage/calls
  • link coverage/calls to the action
  • remove travis

Minor errors in the test.sh file

In the log file that can be found in /MobilityDB/build/Testing/Temporary/LastTest.log there may be a minor problem in the definition of the function run_ctl since a 3 times we can find this output

pg_ctl: no operation specified
Try "pg_ctl --help" for more information.

After changing the definition of the function as follows

run_ctl () {
  "${BIN_DIR}/pg_ctl" -w -D "$DBDIR" "$@"
  return $?
}

and the call of the function as follows

	if ! run_ctl start -l "$WORKDIR/log/postgres.log" -o "$WORKDIR/lock" 2>&1 | tee "$WORKDIR/log/pg_start.log"; then

some of the problems have been solved.

function AtMin

Dear Esteban

MobilityDB is a good extension for MOs objects..
I have executed the following query

select d.id,twavg(speed(trip)) ,
startValue(atMax (speed(trip)*3.6))
from delivery d, truck t
where d.truckid = t.truckid

and the server did it well...

but when I added the AtMin function

select atMin (speed(trip)*3.6)
from delivery d, truck t
where d.truckid = t.truckid

it becomes failed, SQL Error [57P03]: FATAL: the database system is in recovery mode
I am using DBeaver 6.3.4 Community edition

regards
Irya Wisnubhadra

Restriction Functions on tgeompoint vs tgeogpoint

So I have tried two similar queries using atValue, but with different results:

mobilitydb=# SELECT asText(atValue(tgeompoint '[Point(0 0 0)@2012-01-01, Point(2 2 2)@2012-01-03)', 'Point(1 1 1)'));
                   astext                   
--------------------------------------------
 {[POINT Z (1 1 1)@2012-01-02 00:00:00+00]}
(1 row)

mobilitydb=# SELECT asText(atValue(tgeogpoint '[Point(0 0 0)@2012-01-01, Point(2 2 2)@2012-01-03)', 'Point(1 1 1)'));
 astext 
--------
 
(1 row)

Is this expected behavior?

Using Postigis 3

First problem:

  • PostGIS 3 does not have getSRSbySRID see this commit postgis/postgis@b38079d
    • was moved to the now non exposed liblwgeom which is no longer available on version 3
mobtest=# CREATE FUNCTION period_in(cstring)
mobtest-#   RETURNS period
mobtest-#   AS '/home/vicky/mobilitydb/mobilitydb/cvvergara/build/libMobilityDB-1.0.so'
mobtest-#   LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
NOTICE:  return type period is only a shell
ERROR:  could not load library "/home/vicky/mobilitydb/mobilitydb/cvvergara/build/libMobilityDB-1.0.so": /home/vicky/mobilitydb/mobilitydb/cvvergara/build/libMobilityDB-1.0.so: undefined symbol: getSRSbySRID

Op.class CREATE EXTENSION MobilityDB CASCADE;

On command CREATE EXTENSION MobilityDB CASCADE I got error:
"operator class "gist_time_ops" for access method "gist" already exists".

The same operator class was in the extension btree_gist.

What is the TB-tree mentioned in the document?

"GiST and SP-GiST indexes can be created for table columns of temporal types. The GiST index implements an R-tree for temporal alphanumeric types and a TB-tree for temporal point types."

I'm not quite sure about what does this TB-Tree refers to. Is that the trajectory-bundle tree?

Action using clang

Some OS use clang as main compiler.
Good to have an action that at least make one test with clang on ubuntu.

Warnings on doc/genxmlfiles.sh

In doc/genxmlfiles.sh line 29:
  xmlfilename="$filename.xml"
  ^---------^ SC2034: xmlfilename appears unused. Verify use (or export if used externally).

cpplint

In pgRouting we use this: https://google.github.io/styleguide/cppguide.html
Its for c++, but we also use it on our c files
The secondary reason is to make the Google Summer of Code students, because they are in a Google program to use Google's standards
The main reason is the TAB: (https://google.github.io/styleguide/cppguide.html#Spaces_vs._Tabs)
There is a lint checker program: https://github.com/google/styleguide It does not check everything, but it checks the basics
We have it as a tool here: https://github.com/pgRouting/pgrouting/blob/master/tools/scripts/code_checker.sh

src/debug/indexesstat.c:27:  Tab found; better to use spaces  [whitespace/tab] [1]
src/debug/indexesstat.c:35:  { should almost always be at the end of the previous line  [whitespace/braces] [4]
src/debug/indexesstat.c:36:  Tab found; better to use spaces  [whitespace/tab] [1]
src/debug/indexesstat.c:37:  Tab found; better to use spaces  [whitespace/tab] [1]
src/debug/indexesstat.c:38:  Tab found; better to use spaces  [whitespace/tab] [1]
src/debug/indexesstat.c:39:  Tab found; better to use spaces  [whitespace/tab] [1]
src/debug/indexesstat.c:40:  Tab found; better to use spaces  [whitespace/tab] [1]
src/debug/indexesstat.c:46:  { should almost always be at the end of the previous line  [whitespace/braces] [4]
src/debug/indexesstat.c:47:  Tab found; better to use spaces  [whitespace/tab] [1]
src/debug/indexesstat.c:48:  Tab found; better to use spaces  [whitespace/tab] [1]
src/debug/indexesstat.c:49:  Tab found; better to use spaces  [whitespace/tab] [1]
src/debug/indexesstat.c:50:  Tab found; better to use spaces  [whitespace/tab] [1]
src/debug/indexesstat.c:51:  Tab found; better to use spaces  [whitespace/tab] [1]
src/debug/indexesstat.c:52:  Tab found; better to use spaces  [whitespace/tab] [1]

There is always a debate about tabs vs spaces. https://thenewstack.io/spaces-vs-tabs-a-20-year-debate-and-now-this-what-the-hell-is-wrong-with-go/ maany more if you look around.
Because tabs can be set up on editors to be rendered 2 spaces, or 8 spaces then:

editor set up to TAB be rendered to 2 spaces, suppose A made the original code with tab and B's editor renders tabs with 2 spaces

void foo() {
  int i;  // tab here (A)
  ++i;  // there are 2 spaces here (B visually sees 2 spaces on the other lines)
  // more code here with tab ( A)
}

So far so good, visually things look ok

editor set up to TAB be rendered to 8 spaces, A checks the modification with an editor set up to render tabs with 8 spaces

int foo() {
      int i;  // tab here (A)
  ++i;  // there are 2 spaces here
      // more code here with tab ( A)
}

The code does not look aligned

I don't know if you would like to have that cpplinter processing also
Parsing the C files I get:
Total errors found: 37431
most of the "errors" are because of the use of TAB

PS. I use vim and I have it configured to use spaces :-)
That is one reason to of #24 so consider this also as part of discussion of #25

Mobility DB with Docker Installation Issue

Hi

I was try to install and configure Mobility DB. I have done following steps successfully
$ docker pull codewit/mobilitydb
$ docker volume create mobilitydb_data
$ docker run --name "mobilitydb" -d -p 25432:5432 -v mobilitydb_data:/var/lib/postgresql codewit/mobilitydb

But was unable to verify if my mobility db is install. I have tried to connect mobilitydb database through postgres but no luck. When i try the command "create extension mobilitydb" in postgres it does not work. There occurs a following message:

image

Also when i try to run following command "docker exec -t -i mobilitydb psql -h localhost -p 5432 -d mobilitydb -U docker" it does not work and following message displays
image

what is trajectory()?

Esteban and others,

I see references in the manual and in the workbook to the "trajectory()" function. How is it used?

I've created a field in postgis using "my_traj tgeogpoint" and populated it with "insert into ... tgeogpointseq(array_agg(tgeogpointinst(...)))" and that seems to work fine. Using that, functions such as "tintersects(my_traj, a_poly)" seem to produce the appropriate results (and it is really fast!).

Does "trajectory()" convert a tgeogpointseq structure into a PostGIS geometry so that functions such as ST_Distance can be used? What is the difference in MobilityDB's nearestApproachDistance() and PostGIS's ST_Distance()? Is a "trajectory()" item something that can be imported into QGIS or MovingPandas?

As I mentioned, everything seems to be working great. Am I missing something by not using "trajectory()"?

Thank you,
Wendell

Warnings on test/scripts/test.sh

In test/scripts/test.sh line 13:
SOFILE="$BUILDDIR/lib@[email protected]"
^----^ SC2034: SOFILE appears unused. Verify use (or export if used externally).


In test/scripts/test.sh line 15:
FAILPSQL="${BIN_DIR}/psql -h $WORKDIR/lock -e --set ON_ERROR_STOP=1 postgres"
^------^ SC2034: FAILPSQL appears unused. Verify use (or export if used externally).


In test/scripts/test.sh line 18:
PGCTL="${BIN_DIR}/pg_ctl -w -D $DBDIR -l $WORKDIR/log/postgres.log -o -k -o $WORKDIR/lock -o -h -o ''"
                                                                                    ^---------------^ SC2089: Quotes/backslashes will be treated literally. Use an array.


In test/scripts/test.sh line 21:
PGSODIR="@POSTGRESQL_DYNLIB_DIR@"
^-----^ SC2034: PGSODIR appears unused. Verify use (or export if used externally).


In test/scripts/test.sh line 44:
  $PGCTL start 2>&1 | tee "$WORKDIR"/log/pg_start.log
  ^----^ SC2090: Quotes/backslashes in this variable will not be respected.


In test/scripts/test.sh line 45:
  if [ "$?" != "0" ]; then
       ^--^ SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.


In test/scripts/test.sh line 48:
    $PGCTL status >> "$WORKDIR"/log/pg_start.log
    ^----^ SC2090: Quotes/backslashes in this variable will not be respected.


In test/scripts/test.sh line 49:
    if [ "$?" != "0" ]; then
         ^--^ SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.


In test/scripts/test.sh line 61:
  $PGCTL status || $PGCTL start
  ^----^ SC2090: Quotes/backslashes in this variable will not be respected.
                   ^----^ SC2090: Quotes/backslashes in this variable will not be respected.


In test/scripts/test.sh line 72:
    echo "CREATE EXTENSION postgis WITH VERSION '@POSTGIS_VERSION@';" | $PSQL 2>&1 >> "$WORKDIR"/log/create_ext.log
                                                                              ^--^ SC2069: To redirect stdout+stderr, 2>&1 must be last (or use '{ cmd > file; } 2>&1' to clarify).


In test/scripts/test.sh line 74:
  $PSQL -c "SELECT postgis_full_version()" 2>&1 >> "$WORKDIR"/log/create_ext.log
                                           ^--^ SC2069: To redirect stdout+stderr, 2>&1 must be last (or use '{ cmd > file; } 2>&1' to clarify).


In test/scripts/test.sh line 85:
  $PSQL -c "SELECT mobilitydb_full_version()" 2>&1 >> "$WORKDIR"/log/create_ext.log
                                              ^--^ SC2069: To redirect stdout+stderr, 2>&1 must be last (or use '{ cmd > file; } 2>&1' to clarify).


In test/scripts/test.sh line 93:
  $PGCTL stop || true
  ^----^ SC2090: Quotes/backslashes in this variable will not be respected.


In test/scripts/test.sh line 101:
  $PGCTL status || $PGCTL start
  ^----^ SC2090: Quotes/backslashes in this variable will not be respected.
                   ^----^ SC2090: Quotes/backslashes in this variable will not be respected.


In test/scripts/test.sh line 115:
    cat "$WORKDIR"/out/"$TESTNAME".out > $(dirname "$TESTFILE")/../expected/$(basename "$TESTFILE" .sql).out
                                         ^--------------------^ SC2046: Quote this to prevent word splitting.
                                                                            ^--------------------------^ SC2046: Quote this to prevent word splitting.


In test/scripts/test.sh line 121:
    sed -e's/^ERROR:.*/ERROR/' $(dirname "$TESTFILE")/../expected/$(basename "$TESTFILE" .sql).out >> "$tmpexpected"
                               ^--------------------^ SC2046: Quote this to prevent word splitting.
                                                                  ^--------------------------^ SC2046: Quote this to prevent word splitting.


In test/scripts/test.sh line 135:
  $PGCTL status || $PGCTL start
  ^----^ SC2090: Quotes/backslashes in this variable will not be respected.
                   ^----^ SC2090: Quotes/backslashes in this variable will not be respected.


In test/scripts/test.sh line 145:
    @UNCOMPRESS@ "$TESTFILE" | $PSQL 2>&1 >> "$WORKDIR"/out/"$TESTNAME".out
                                     ^--^ SC2069: To redirect stdout+stderr, 2>&1 must be last (or use '{ cmd > file; } 2>&1' to clarify).

problem with autovacuum and insert

Sirs,

First, thank you for creating this extension. It works great, but I've run into an issue with inserts.

I use R, and within a loop it issues a dbWriteTable to create a temporary table of the data, then it uses SQL to insert that table into the MobilityDB table via:

INSERT INTO tz_2019_09_02 SELECT acid, fid, tgeompointseq(array_agg(tgeompointinst( ST_SetSRID(ST_MakePoint(lng,lat),4326), times) ORDER BY times)) FROM tz_2019_09_02_inputs GROUP BY acid, fid;

The insert seems to succeed, but after the loop runs for a few hundred inserts, PostgreSQL crashes with:
could not connect ... on dbname "mobile": FATAL: the database system is in recovery mode
and the pgsql logfile shows:
Failed process was running: autovacuum: ANALYZE public.tz_2019_09_02
It seems that I can get around the problem by first issuing:
ALTER TABLE tz_2019_09_02 SET (autovacuum_enabled = false, toast.autovacuum_enabled = false);
After issuing this ALTER statement the INSERT loop works fine with no errors.

Is this an issue with my underlying data? Or have I mis-configured PostGIS or MobilityDB?

Thank you,
Wendell

Do not allow in-source builds

Is your feature request related to a problem? Please describe.
https://hsf-training.github.io/hsf-training-cmake-webpage/02-building/index.html

Never do an “in-source” build - that is, run cmake . from the source directory. It will pollute your source directory with build outputs, CMake configuration files, and will disable out-of-source builds. A few packages do not allow the source directory to even sit inside the build directory; if that is the case, you need to change the relative path .. accordingly.

Just to clarify, you can point CMake at either the source directory from the build directory, or at an existing build directory from anywhere.

Currently it allows in source builds:

cmake .
-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
...

the source directory gets polluted

git status
...
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        CMakeCache.txt
        CMakeFiles/
        CTestTestfile.cmake
        DartConfiguration.tcl
        Makefile
        cmake_install.cmake

Describe the solution you'd like

cmake .
CMake Error at CMakeLists.txt:4 (message):
  In-source builds not allowed.

          Please make a new directory (called a build directory) and run CMake from there.
          You may need to remove 'CMakeCache.txt' and 'CMakeFiles/'.


-- Configuring incomplete, errors occurred!

Working on the build

(Cleaned up the original message to have the tasks clear
tasks

  • make it work locally
  • Wait for approval & merge #90
  • organize SQL
  • Wait for approval & merge #97
  • organize SRC
  • Wait for approval & merge #105
  • organize datagen
  • Wait for approval & merge #100
  • Cleanup Build
  • Wait for approval & merge #103

Warnings on test/scripts/print_fail.sh

In test/scripts/print_fail.sh line 3:
for file in $(find tmptest/log -type f); do
            ^-------------------------^ SC2044: For loops over find output are fragile. Use find -exec or a while read loop.


In test/scripts/print_fail.sh line 12:
for file in $(find tmptest/out -name '*.diff' -type f -not -size 0); do
            ^-- SC2044: For loops over find output are fragile. Use find -exec or a while read loop.

atGeometry error

Sometimes function atGeometry(tgeompoint, geometry) gives a strange error.

I have got an example:

SELECT
atGeometry(
setSRID('
[POINT(37.6109116 55.7524866)@2021-04-30 14:14:52+03,
POINT(37.6072666 55.7527341)@2021-04-30 14:16:09+03,
POINT(37.604815 55.7528991)@2021-04-30 14:16:24+03,
POINT(37.6023283 55.7529933)@2021-04-30 14:16:38+03,
POINT(37.6012958 55.7530291)@2021-04-30 14:16:46+03,
POINT(37.59868 55.7530708)@2021-04-30 14:17:46+03,
POINT(37.5927591 55.75277)@2021-04-30 14:19:28+03,
POINT(37.5777408 55.7527208)@2021-04-30 14:22:07+03,
POINT(37.5768466 55.7527333)@2021-04-30 14:22:14+03,
POINT(37.5757233 55.752685)@2021-04-30 14:23:14+03,
POINT(37.57569 55.7526866)@2021-04-30 14:23:42+03,
POINT(37.5731566 55.7524683)@2021-04-30 14:24:08+03,
POINT(37.5661958 55.7505391)@2021-04-30 14:24:47+03,
POINT(37.5625416 55.7494758)@2021-04-30 14:25:42+03,
POINT(37.5602883 55.7488466)@2021-04-30 14:25:58+03,
POINT(37.55975 55.7486883)@2021-04-30 14:26:20+03,
POINT(37.5575416 55.748055)@2021-04-30 14:26:43+03,
POINT(37.5531508 55.7468758)@2021-04-30 14:27:12+03,
POINT(37.5506733 55.7461358)@2021-04-30 14:27:54+03,
POINT(37.5486208 55.7454125)@2021-04-30 14:28:10+03,
POINT(37.5469041 55.7447941)@2021-04-30 14:28:24+03,
POINT(37.5439333 55.74372)@2021-04-30 14:29:12+03,
POINT(37.5407925 55.7424575)@2021-04-30 14:29:33+03,
POINT(37.5387766 55.74168)@2021-04-30 14:29:46+03,
POINT(37.5376375 55.7412708)@2021-04-30 14:29:55+03,
POINT(37.5355008 55.7405)@2021-04-30 14:30:36+03,
POINT(37.5315541 55.7395375)@2021-04-30 14:31:34+03,
POINT(37.5293125 55.7390408)@2021-04-30 14:31:51+03,
POINT(37.5291749 55.7389933)@2021-04-30 14:32:15+03,
POINT(37.5275816 55.7385983)@2021-04-30 14:33:15+03,
POINT(37.5254541 55.7381625)@2021-04-30 14:34:11+03,
POINT(37.522525 55.7375383)@2021-04-30 14:35:02+03,
POINT(37.5218966 55.73743)@2021-04-30 14:35:12+03,
POINT(37.5195041 55.7370241)@2021-04-30 14:35:34+03,
POINT(37.5181116 55.736785)@2021-04-30 14:36:05+03,
POINT(37.5163808 55.73657)@2021-04-30 14:36:41+03,
POINT(37.514935 55.73686)@2021-04-30 14:37:05+03,
POINT(37.5141466 55.7369316)@2021-04-30 14:37:26+03,
POINT(37.5138258 55.7370458)@2021-04-30 14:37:31+03,
POINT(37.5135683 55.7372058)@2021-04-30 14:37:39+03,
POINT(37.5129983 55.7372758)@2021-04-30 14:39:15+03,
POINT(37.5124533 55.7373708)@2021-04-30 14:39:43+03,
POINT(37.5119325 55.737335)@2021-04-30 14:40:42+03,
POINT(37.5117583 55.7372975)@2021-04-30 14:40:50+03,
POINT(37.5110625 55.7374091)@2021-04-30 14:41:04+03,
POINT(37.5110116 55.7374183)@2021-04-30 14:41:51+03,
POINT(37.5104241 55.7374275)@2021-04-30 14:42:08+03,
POINT(37.5101466 55.737295)@2021-04-30 14:42:11+03,
POINT(37.5096133 55.7365758)@2021-04-30 14:42:20+03,
POINT(37.5098925 55.735985)@2021-04-30 14:42:26+03,
POINT(37.5118591 55.7351158)@2021-04-30 14:42:39+03,
POINT(37.5126575 55.7352208)@2021-04-30 14:42:43+03,
POINT(37.5140583 55.735465)@2021-04-30 14:42:51+03,
POINT(37.515695 55.7357275)@2021-04-30 14:43:01+03,
POINT(37.5187516 55.7362266)@2021-04-30 14:44:01+03,
POINT(37.5216066 55.7368925)@2021-04-30 14:44:50+03,
POINT(37.5239258 55.7374325)@2021-04-30 14:45:05+03,
POINT(37.5262158 55.7378916)@2021-04-30 14:45:20+03,
POINT(37.5304716 55.7388633)@2021-04-30 14:46:31+03,
POINT(37.5306908 55.73893)@2021-04-30 14:46:49+03,
POINT(37.5329883 55.7395341)@2021-04-30 14:47:17+03,
POINT(37.5342866 55.7397616)@2021-04-30 14:47:44+03,
POINT(37.5366175 55.7403141)@2021-04-30 14:48:13+03,
POINT(37.537705 55.7406433)@2021-04-30 14:48:45+03,
POINT(37.5397125 55.7414675)@2021-04-30 14:49:22+03,
POINT(37.5424641 55.7426475)@2021-04-30 14:49:50+03,
POINT(37.5429883 55.7428633)@2021-04-30 14:49:56+03,
POINT(37.5460458 55.7439925)@2021-04-30 14:50:55+03,
POINT(37.5479733 55.744855)@2021-04-30 14:51:15+03,
POINT(37.5522725 55.746375)@2021-04-30 14:51:45+03,
POINT(37.5558708 55.7473258)@2021-04-30 14:52:32+03,
POINT(37.558045 55.7479341)@2021-04-30 14:52:51+03,
POINT(37.5584258 55.748045)@2021-04-30 14:52:54+03,
POINT(37.5598616 55.74845)@2021-04-30 14:53:25+03,
POINT(37.5615533 55.7489391)@2021-04-30 14:54:25+03,
POINT(37.5668216 55.7504333)@2021-04-30 14:55:59+03,
POINT(37.5669283 55.7504766)@2021-04-30 14:56:20+03,
POINT(37.5682533 55.75084)@2021-04-30 14:57:21+03,
POINT(37.5693741 55.7511608)@2021-04-30 14:58:02+03,
POINT(37.5715416 55.75177)@2021-04-30 14:58:33+03,
POINT(37.5724716 55.7520291)@2021-04-30 14:58:46+03,
POINT(37.5738066 55.75244)@2021-04-30 15:00:59+03,
POINT(37.5744358 55.752555)@2021-04-30 15:01:52+03,
POINT(37.574515 55.7525491)@2021-04-30 15:02:00+03,
POINT(37.5754874 55.7525366)@2021-04-30 15:02:41+03,
POINT(37.5769625 55.7525733)@2021-04-30 15:03:44+03,
POINT(37.5794358 55.7525933)@2021-04-30 15:04:16+03,
POINT(37.5839408 55.7525925)@2021-04-30 15:05:02+03,
POINT(37.5858233 55.7525841)@2021-04-30 15:05:40+03,
POINT(37.5882858 55.75258)@2021-04-30 15:05:59+03,
POINT(37.58988 55.7525733)@2021-04-30 15:06:30+03,
POINT(37.5923258 55.7526141)@2021-04-30 15:06:54+03,
POINT(37.5947808 55.7527)@2021-04-30 15:07:11+03,
POINT(37.596235 55.7527733)@2021-04-30 15:07:33+03,
POINT(37.5986091 55.7529783)@2021-04-30 15:08:09+03,
POINT(37.60251 55.7529566)@2021-04-30 15:08:33+03,
POINT(37.6074866 55.7527175)@2021-04-30 15:09:48+03,
POINT(37.6079008 55.7526625)@2021-04-30 15:09:52+03,
POINT(37.6089791 55.7526033)@2021-04-30 15:10:01+03]
'::tgeompoint,4326),
ST_SetSRID(ST_Buffer('LINESTRING(37.6052679 55.7527227,37.61025844 55.75229041)'::geography,20,'endcap=flat')::geometry,4326)
)

ERROR: The temporal values cannot overlap on time: 2021-04-30 15:09:55.665248+03, 2021-04-30 14:16:07.189221+03
SQL state: XX000

How can it be?

Add a preprint for the TODS paper

In readme.md, it would help to add a link for a preprint of the TODS paper, since it is the most complete scientific reference about the system so far.

linestring instead of point?

Sirs,

Would it be possible to use 'linestring' instead of 'point' in the tgeompoint column? Would it be advisable?

I would like to describe a path using linestrings, and then perform ST_Contains() or ST_Intersects() to identify intersections with a polygon. The PostGIS ST_Intersect() works on a linestring geometry and that is what I'm currently using. I would like to use of MobileDB to analyze this. The addition of timestamps seems very interesting.

I suppose an issue would be the temporal aspect of the intersect. Would I assume the timestamp of the linestring is that of the starting point or the ending point?

If there are lots of points (such as from a GPS device), then it would be likely that one of the points was within the polygon. I don't have all of those individual points, only a linestring between points along a route.

An alternative would be to use st_geod_segmentize() (one of R's spatial features functions) to create points along each linestring that would be 'smaller' than the polygon size. Would that be a better solution?

(The problem: given an aircraft's planned route from departure to point A to point B to arrival, would it fly through a weather cell described by a polygon? What time would it enter and leave the cell?)

Thank you,
Wendell

Error on " Create extension mobilitydb cascade"

Hi
I have installed Postgres 10 and Docker. I also successfully installed MobilityDB and got got access to the mobilitydb.
My issue is when i try to create extension for the mobilitydb in the database., i come across the error given in below screenshot. Can anyone pl guide

image

read set of tgeogpointseq in python?

How do I read a set of tgeogpointseq into Python?

I use a select statement to read mdb trajectories from a table, crop them using atGeometry, and store the result in a pandas dataframe:

SELECT fid,
tgeogpointseq(atGeometry(flown_path::tgeompoint, geometry 'SRID=4326;POLYGON ((-95.46386763453484 32.87958717306631, -96.67236372828484 31.39115752282473, -96.03515669703484 30.14512718337609, -93.55224654078484 30.58117925738698, -93.06884810328484 33.26624989076275, -95.46386763453484 32.87958717306631))')::tgeompoint)
    FROM table_with_trajectories
    WHERE fid = 20200805523356 ;

Most of the time this works fine (when the result is one tgeogpointseq). However, if the trajectory exits the polygon and re-enters, the results of the atGeometry() is now a list (or set?) of tgeogpointseq segments. Mobilitydb returns 'Cannot transform input to a temporal sequence', which is correct since it is not one temporal sequence but several.

How to I tell Python/PostGis/MobilityDB that this is a set of trajectories? Will it be the MobilityDB version of a MultiLineString?

Thanks,
Wendell
example.zip

Syncronize with transifex

Automatically syncronize with transifex

To be able to continue, as I do not know docbook,
I need to know how the pot files in transifex are currently generated.

This I already tried xml2po is not available any more on focal fossa because the package gnome-doc-utils is written with python2 and focal uses python 3. So its no longer compatible.

Can't Compile develop on mingw64 - SYNCHRONIZE reserved keyword?

I'm still having issues compiling develop branch under mingw. It's better, now it detects my PostgreSQL version and passes the configure step, but breaks at compile:

C:/ming64gcc81/projects/mobility/MobilityDB/include/temporal.h:113:3: error: expected identifier before '(' token
   SYNCHRONIZE,
   ^~~~~~~~~~~
make[2]: *** [CMakeFiles/MobilityDB.dir/build.make:97: CMakeFiles/MobilityDB.dir/src/doublen.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:1066: CMakeFiles/MobilityDB.dir/all] Error 2
make: *** [Makefile:160: all] Error 2
make: *** No rule to make target 'installcheck'.  Stop.

My Cmake configure looks like this:

	cmake  -G "MSYS Makefiles" \
		-DLWGEOM_ROOT:PATH=${LIBLWGEOM_PATH} -DPROJ_INCLUDE_DIR:PATH=${PROJ_PATH}/include \
		-DJSONC_INCLUDE_DIR:PATH=${JSON_PATH}/include \
		-DLIBPROTOBUF_INCLUDE_DIR:PATH=${PROTOBUF_PATH}/include \
		 ..

Where the various variables are just paths to my compiled versions of things

Editor Config

Is your feature request related to a problem? Please describe.
EditorConfig, which is a file wherein one may define and then maintain a consistent coding style.
https://editorconfig.org/

Describe the solution you'd like
Have an editor config file that allows my editor to follow your coding style

Describe alternatives you've considered
https://editorconfig.org/

Additional context
Many files might need to be reconfigured based on the editor config specification

undefined symbol: LWGEOM_setpoint_linestring

I'm trying to use the plugin but am having an "undefined symbol" problem.

I have PostgreSQL, PostGIS, and MobileDB all compiled from sources and installed (I don't have root access on the machine). All of the compiles and installs seemed to go ok.
I'm following the examples in section 3.1, and the CREATE works fine:

mobile=# CREATE TABLE Department(DeptNo integer, DeptName varchar(25), NoEmps tint);
CREATE TABLE

However, the INSERT does not work:

mobile=# INSERT INTO Temperature VALUES
(1001, tfloat '{18.5@2012-01-01 08:00:00, 20.0@2012-01-01 08:10:00}'),
(2001, tfloat '{19.0@2012-01-01 08:00:00, 22.5@2012-01-01 08:10:00}');
ERROR:  could not load library "/home/data/local/lib/postgresql/libMobilityDB.so": /home/data/local/lib/postgresql/libMobilityDB.so: undefined symbol: LWGEOM_setpoint_linestring

The library seems to be in the right place:

[wturner@rserver ciws]$ ls -l /home/data/local/lib/postgresql/libMobilityDB.so
-rwxr-xr-x. 1 wturner wturner 1193288 Nov 26 11:00 /home/data/local/lib/postgresql/libMobilityDB.so

And it seems to have the right stuff:

[wturner@rserver ~]$ strings /home/data/local/lib/postgresql/libMobilityDB.so | grep setpoint_linestring
LWGEOM_setpoint_linestring
LWGEOM_setpoint_linestring

Also, the LD_LIBRARY_PATH is set to that directory.

Do you have any suggestions about what could be wrong?
Thank you,
Wendell

speed along single axis

would like to see derivations of:
speed(tpoint): tfloats

for the individual components (speed per axis)
e.g.:
speed_x()
speed_y()
speed_z()

e.g:
SELECT speed_z(tgeompoint 'Interp=Stepwise;[Point(0 0 0)@2000-01-01, Point(1 1 1)@2000-01-02,
Point(1 0)@2000-01-03]') * 3600 * 24;

Change of terminology and consequently of API

Overview

Currently, MobilityDB uses the term duration to refer to the "temporal type", which can be 'Instant', 'InstantSet', 'Sequence', 'SequenceSet'. This is not in accordance with the equivalent functionality in PostGIS which provides the function GeometryType to determine the type of a geometry as text, such as 'POINT', 'LINESTRING', etc. This prevents the use of "duration" for the usual meaning, e.g., as defined by the Cambridge dictionary:

the length of time that something lasts. He planned a stay of two years’ duration.

For this reason, currently MobilityDB provides a function timespan which correspond to the duration in the dictionary sense described above. Examples of usage are as follows

select timespan('{[2000-01-01 08:00, 2000-01-01 08:20], [2000-01-01 08:30, 2000-01-01 08:40]}'::periodset);
-- 00:30:00
select timespan('{[1@2000-01-01 08:00, 5@2000-01-01 08:20], [5@2000-01-01 08:30, 1@2000-01-01 08:40]}'::tfloat);
-- 00:30:00

However, there are two possible interpretations of such a function depending on whether the time gaps are included or not in the calculation.

Proposed solution

The proposed solution would be as follows

  • Use the function temporalType for obtaining the temporal type, which is one of 'Instant', 'InstantSet', 'Sequence', 'SequenceSet'.
  • Use the function duration for obtaining the duration without taking time gaps into consideration
  • Use the function timespan for obtaining the duration taking time gaps into consideration

The proposed change in API would then be as follows

select temporalType('{[1@2000-01-01 08:00, 5@2000-01-01 08:20], [5@2000-01-01 08:30, 1@2000-01-01 08:40]}'::tfloat);
-- 'SequenceSet'

select duration('{[2000-01-01 08:00, 2000-01-01 08:20], [2000-01-01 08:30, 2000-01-01 08:40]}'::periodset);
-- 00:30:00
select duration('{[1@2000-01-01 08:00, 5@2000-01-01 08:20], [5@2000-01-01 08:30, 1@2000-01-01 08:40]}'::tfloat);
-- 00:30:00

select timespan('{[2000-01-01 08:00, 2000-01-01 08:20], [2000-01-01 08:30, 2000-01-01 08:40]}'::periodset);
-- 00:40:00
select timespan('{[1@2000-01-01 08:00, 5@2000-01-01 08:20], [5@2000-01-01 08:30, 1@2000-01-01 08:40]}'::tfloat);
-- 00:40:00

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.