TimSC / microcosm

OSM API v0.6 implemented in PHP
Other
8 stars 3 forks source link

no such module: rtree #7

Closed h4ck3rm1k3 closed 12 years ago

h4ck3rm1k3 commented 12 years ago

in my branch : 1) test::testMapQuery Exception: SELECT id FROM position WHERE minLat > 0 and maxLat < 0 and maxLon < 0 and minLon > 0;,no such module: rtree

/home/mdupont/experiments/fosm/microcosm/model-sqlite-opt.php:509 /home/mdupont/experiments/fosm/microcosm/model-sqlite.php:387 /home/mdupont/experiments/fosm/microcosm/modelfactory.php:124 /home/mdupont/experiments/fosm/microcosm/model-common.php:76 /home/mdupont/experiments/fosm/microcosm/modelfactory.php:148 /home/mdupont/experiments/fosm/microcosm/messagepump.php:130 /home/mdupont/experiments/fosm/microcosm/messagepump.php:141 /home/mdupont/experiments/fosm/microcosm/messagepump.php:162 /home/mdupont/experiments/fosm/microcosm/querymap.php:28 /home/mdupont/experiments/fosm/microcosm/test/001_microcosm.php:23 /usr/local/bin/phpunit:46

I guess sqlite/spatialite is not setup properly. any ideas?

TimSC commented 12 years ago

I wrote the code based on sqlite with rtree. I thought you were running ubuntu or some other debian based distro(?) and that usually has rtree enabled at compile time. SpatiaLite looks very interesting. I am not sure at this stage what benefit it will have but it might be worth forking the sqlite code to better use SpatiaLite functions.

Can you try to run checkrtree.php ? This will probably have the same "no such modile: rtree" error...

It seems that apache needs to be configured to use SpatiaLite. It would be better if it worked without configuration, which is the whole point of sqlite based approaches!

h4ck3rm1k3 commented 12 years ago

I am not running in apache, but on the command line. I am running ubuntu precise.

On Sun, Sep 30, 2012 at 7:48 PM, Tim Sheerman-Chase < notifications@github.com> wrote:

I wrote the code based on sqlite with rtree. I thought you were running ubuntu or some other debian based distro(?) and that usually has rtree enabled at compile time. SpatiaLite looks very interesting. I am not sure at this stage what benefit it will have but it might be worth forking the sqlite code to better use SpatiaLite functions.

Can you try to run checkrtree.php ? This will probably have the same "no such modile: rtree" error...

It seems that apache needs to be configured to use SpatiaLite. It would be better if it worked without configuration, which is the whole point of sqlite based approaches!

— Reply to this email directly or view it on GitHubhttps://github.com/TimSC/microcosm/issues/7#issuecomment-9015999.

James Michael DuPont Member of Free Libre Open Source Software Kosova http://flossk.org Saving wikipedia(tm) articles from deletion http://SpeedyDeletion.wikia.com Contributor FOSM, the CC-BY-SA map of the world http://fosm.org Mozilla Rep https://reps.mozilla.org/u/h4ck3rm1k3 Free Software Foundation Europe Fellow http://fsfe.org/support/?h4ck3rm1k3

h4ck3rm1k3 commented 12 years ago

ok it looks like this was an issue with /usr/local/bin/php, i will remove that and check it all again.

TimSC commented 12 years ago

Ah yes, I keep forgetting you are using the console. checkrtree.php should have some SQL that will verify if rtree is working. I assume you fixed it somehow, since you closed the issue!

buffon commented 11 years ago

When I insert data to a rtree table in sqlite using java code,I get the same error: no such module:rtree, any ideas to fix that?

TimSC commented 11 years ago

@buffon The most likely scenario is that sqlite has not been compiled with the RTREE module enabled. It is included as part of the sqlite "amalgamation" but is disabled by default. Try to recompile the library or get a copy which has this enabled. FYI see section 2 of https://www.sqlite.org/rtree.html

Tim

buffon commented 11 years ago

Tim,I get another problem here. As I use Rtree in sqlite,there is a requirement: while I have a center point,I want to find the points in the given distance from the center point and the points found out is by the order of distance from the center point. Is there any method to achive that? Thanks.

TimSC commented 11 years ago

@buffon As far as I know, R*Tree only provides a spatial index but no other functions like distance sorting. You might try SpatiaLite which as more spatial features. I have not used it though.

https://www.gaia-gis.it/fossil/libspatialite/index

buffon commented 11 years ago

Yes,I have searched SpatiaLite from this morning,but there seems no enough document on line,I am trying my best to look into it .

Anyway,thanks for your suggestion.