sevar83 / android-spatialite

Spatialite database JNI wrapper for Android
99 stars 49 forks source link

How to use Spatialite Virtual Routing Network #9

Open phprad opened 5 years ago

phprad commented 5 years ago

Hi, Thanks for great library. Am using the library to run spatialite queries which works perfects.

But when i tried to run Spatialite virtual routing query based on this link

Am getting this error

*no such module: VirtualRouting (code 1): , while compiling: SELECT FROM roads_net WHERE NodeFrom=? AND NodeTo=?**

on Android but when i run it on the Spatialite_GUI and Spatialite CLI everything works perfect.

Thanks for your support Best regards.

retsef commented 5 years ago

The repository contains an android binary of spatialite 4.3.0a. The module VirtualRouting is available in spatialite 5.0.0 and not in 4.3.0a. On your side works because you have tested on a Spatialite_GUI with built-in 5.0.0 version.

phprad commented 5 years ago

Please anyway to upgrade the spatialite binary in the android repository to use the spatialite 5.0.0.

The repository contains an android binary of spatialite 4.3.0a. The module VirtualRouting is available in spatialite 5.0.0 and not in 4.3.0a. On your side works because you have tested on a Spatialite_GUI with built-in 5.0.0 version.

retsef commented 5 years ago

At this time the 5.0.0 is currently in beta. If you want you can do it your self and make a pull request.

phprad commented 5 years ago

At this time the 5.0.0 is currently in beta. If you want you can do it your self and make a pull request.

I wish I know how to do this. I searched the internet to the best of my knowledge on how I can use the spatialite 5.0.0 along with your library but couldn't find anything.

Please kindly help me in any way. Regards.

emman-ok commented 5 years ago

Any luck with this I have been trying to do the same but couldn't figure it out. Any help appreciated. Thanks

sevar83 commented 5 years ago

Hi, as far as I remember this wrapper is not configured to compile with the virtualrouting module. I could check but at earliest this weekend.

On Tue, Aug 13, 2019, 21:22 emman_ok notifications@github.com wrote:

Any luck with this I have been trying to do the same but couldn't figure it out. Any help appreciated. Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sevar83/android-spatialite/issues/9?email_source=notifications&email_token=AAA5FVOCA6KEV33STPOLPYDQEL3VBA5CNFSM4IJYDNJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4GRC6I#issuecomment-520950137, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA5FVP6CVQMDWSIIE37YWTQEL3VBANCNFSM4IJYDNJA .

phprad commented 5 years ago

Please any luck with the new update.

Thanks

sevar83 commented 5 years ago

I'll take a look today.

On Mon, Aug 19, 2019, 05:41 phprad notifications@github.com wrote:

Please any luck with the new update.

Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sevar83/android-spatialite/issues/9?email_source=notifications&email_token=AAA5FVIA4STTQKCW2GKXFOTQFIB6NA5CNFSM4IJYDNJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4RQ2PY#issuecomment-522390847, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA5FVKXBKTP3LTICSFGNCDQFIB6NANCNFSM4IJYDNJA .

emman-ok commented 5 years ago

I'll take a look today. …

Hi Svetlozar, How's it going... Any update yet.

sevar83 commented 5 years ago

Hey, I did some maintenance work, migrated to AndroidX and trying to address any crashes first. I'll try to put Spatialite 5.0.0-beta0 in a separate branch but honestly - not sure if I'll have enough time.

On Wed, Aug 21, 2019 at 2:00 PM emman_ok notifications@github.com wrote:

I'll take a look today. …

Hi Svetlozar, How's it going... Any update yet.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sevar83/android-spatialite/issues/9?email_source=notifications&email_token=AAA5FVMVW34OZVKM4JR6EYLQFUN3JA5CNFSM4IJYDNJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4ZJCDY#issuecomment-523407631, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA5FVNOENSGYGTOPJ2IJFTQFUN3JANCNFSM4IJYDNJA .

dsaved commented 5 years ago

hello @sevar83 any update on the library, i also need to make use of the VirtualRouting module.

by the way grate library thanks for that.

sevar83 commented 5 years ago

Hi @dsaved @emman-ok @phprad, I'm currently updating the build configuration to update to Spatialite-5.0.0-beta0. Is this the exact version you need? Also are there some specific requirements for newer GEOS, Proj (and other dependencies) versions? Because I'll first try if it works with the currently set versions (GEOS 3.4.2 and Proj 4.8.0) and if I have time I'll be updating those too.

dsaved commented 5 years ago

Yes Spatialite-5.0.0-beta. I believe the other module works well with the Spatialite-5.0.0-beta version

sevar83 commented 5 years ago

Looks like Spatialite 5 requires GEOS 3.6+. So I updated GEOS to 3.7.2. But there are other exotic compiler issues with some files. I'm working on them.

On Fri, Aug 30, 2019 at 7:41 PM Daniel Johnson notifications@github.com wrote:

Yes Spatialite-5.0.0-beta. I believe the other module works well with the Spatialite-5.0.0-beta version

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sevar83/android-spatialite/issues/9?email_source=notifications&email_token=AAA5FVPCLX2ZFD6QVJRJUTTQHFESDA5CNFSM4IJYDNJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5SFIMY#issuecomment-526668851, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA5FVNBHR3FM3J2RS7GS6TQHFESDANCNFSM4IJYDNJA .

sevar83 commented 5 years ago

Ok, on the spatialite5 branch we have:

The spatialite5 branch may be merged with master when Spatialite 5 final gets released. Before that use:

implementation 'com.github.sevar83:android-spatialite:spatialite5-SNAPSHOT'

(hopefully JitPack will manage to build it as their server seems down at the moment)

If you have any issues or requests please let me know. Cheers guys, tomorrow I'm going in a tent in the wild for the weekend. :)

phprad commented 5 years ago

Am so happy about this. Thanks very much for your time. Will test and give you feedback.

Thanks for your great support. Have a wonderful weekend.

sevar83 commented 5 years ago

IMPORTANT LICENSING CHANGES:

Unfortunately the spatialite5 branch licensing policy must be reduced to the more restrictive GPL than the license for the master branch (which is Apache License 2.0). This is necessary because the VirtualRouting functionality is based on the code from RtTopo library and GCP. Those 2 things are released under GPL and GPL dictates that any redistributable software that is built against GPL libraries should be also licensed under GPL.

TL;DR:

phprad commented 5 years ago

Hello Sevar,

I have tried to include the plugin, But getting this error

ERROR: Failed to resolve: com.github.sevar83:android-spatialite:spatialite5-SNAPSHOT Show in Project Structure dialog Affected Modules: app

I don't know if the Jit Server is still down. Kindly advice.

Thanks.

sevar83 commented 5 years ago

Hi, jitpack.io returns a white page at the moment. As a workaround you may clone the repo, checkout the spatialite5 branch, build it yourself and then use maven install command to install it in your local maven repository.

On Tue, Sep 3, 2019, 14:57 phprad notifications@github.com wrote:

Hello Sevar,

I have tried to include the plugin, But getting this error

ERROR: Failed to resolve: com.github.sevar83:android-spatialite:spatialite5-SNAPSHOT Show in Project Structure dialog Affected Modules: app

I don't know if the Jit Server is still down. Kindly advice.

Thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sevar83/android-spatialite/issues/9?email_source=notifications&email_token=AAA5FVKHQSIB2F76FZVOZULQHZGLXA5CNFSM4IJYDNJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5X6MDA#issuecomment-527427084, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA5FVO7S46EEQU52GO4LITQHZGLXANCNFSM4IJYDNJA .

jamesingham commented 4 years ago

Hi, jitpack.io returns a white page at the moment. As a workaround you may clone the repo, checkout the spatialite5 branch, build it yourself and then use maven install command to install it in your local maven repository.

I can confirm that this works to build it locally, however when doing this I came across an issue which is the same reason that the jitpack build is failing:

ndk-modules/librttopo/librttopo-1.1.0/headers/librttopo.h:30:10: fatal error: 'librttopo_geom.h' file not found
#include "librttopo_geom.h"
         ^~~~~~~~~~~~~~~~~~
1 error generated.

(See: https://jitpack.io/com/github/sevar83/android-spatialite/spatialite5-dac0cc1652-1/build.log)

To fix this you need to run the autoconf script which will generate the missing header files for librttopo:

cd projectdir/android-spatialite/lib/src/main/jni/ndk-modules/librttopo/librttopo-1.1.0 ./autogen.sh ./configure

However I have no idea how to configure jitpack to do this.