jancelin / docker-lizmap

docker lizmap
GNU Affero General Public License v3.0
27 stars 21 forks source link

Editing with spatialite ? #28

Open luckgentilpiron opened 7 years ago

luckgentilpiron commented 7 years ago

Hi !

I want to incorporate spatialite layer for editing but it's possible with this docker ?

Thank for all !

jancelin commented 7 years ago

I do not use spatialite, I prefer postgresql. The container is not optimized for that. However here is the procedure to set it up: To enter the container:

docker exec -it container_name bash

then:

apt-get install libspatialite-dev
nano /etc/php5/apache2/php.ini 

edit: ";sqlite3.extension_dir =" to "sqlite3.extension_dir = /var/www/sqlite3_ext"

mkdir /var/www/sqlite3_ext
cp ./usr/lib/x86_64-linux-gnu/libspatialite.so /var/www/sqlite3_ext

and create a webpage for test install:

nano /var/www/websig/lizmap/www/sqlite_test.php

Copy the example of this site: http://www.gaia-gis.it/spatialite-2.4.0-4/splite-php.html

close and restart container:

exit
docker restart container_name

test exemple if it's work. For me: http://demo.sig.inra.fr/websig/lizmap/www/sqlite_test.php

Then save the container in image to be able to replay it:

docker commit container_name new_image_name

Now you can launch new containers from this new image.

jancelin commented 7 years ago

This is a temporary solution, I will add it in the next version. tell me if it works on your side

luckgentilpiron commented 7 years ago

Thank you !

It's work but when i want to save a modification, i have this message "An error has been raised when saving the form", the same whene i create entity.

jancelin commented 7 years ago

try to do a

chown www-data:www-data /your.sqlite

I think apache can not write to the database

jancelin commented 7 years ago

https://docs.3liz.com/fr/publish/advanced_lizmap_config.html?highlight=spatialite

luckgentilpiron commented 7 years ago

Indeed apache can't write but now yes, he can !

Really thank you, for the docker and for "the spatialite demonstration"!

jancelin commented 7 years ago

de rien....

lionelbargeot commented 6 years ago

Hi since php7 I had to copy mod_spatialite.so to sqlite extension directory. cp ./usr/lib/x86_64-linux-gnu/mod_spatialite.so /var/www/sqlite3_ext

tzanetti commented 5 years ago

Quelqu'un a-t-il déjà eu le même problème sous windows et trouvé une solution ?