2.12.1. General Information¶
The following extensions are available to increase the functionality of the software:
- Basemaps (nextgisweb_basemap) - support for default basemap selection and a list view of available basemaps, an option to select from pre-prepared list of services.
- Exporter - support for additional vector layer exporters to different formats (ESRI shapefile, MapInfo tab etc.)
- File buckets (nextgisweb_filebucket) - support for file sets, ability to upload any files, including non-geospatial files.
- Filtering - support for filtering by attribute and spatial extent.
- Mapnik - support for Mapnik map renderer.
- QGIS - support for QGIS map renderer.
- MapServer - support for MapServer map renderer.
- Logging - support for writing of various messages to a log.
- Mobile debug - support for receiving and categorizing debug information from NextGIS Mobile SDK.
- Data editing - ability to edit geometries right in the browser.
- Vector tiles - support for MVT and associated styles.
2.12.2. Adding an extension¶
Example: adding nextgisweb_filebucket extension. Here are steps to add an extension:
- Execute command to download extension source code to server where NextGIS Web is installed:
git clone https://github.com/nextgis/nextgisweb_filebucket.git
- Install extension in NextGIS Web:
env/bin/pip install -e ./nextgisweb_filebucket
- Create nessesary directories (optional):
- Make changes to configuration file (optional):
Example: changes to configuration file:
[file_bucket] path = /home/username/ngw/file_bucket
- Reinitialize NextGIS Web database:
env/bin/nextgisweb --config config.ini initialize_db
- Restart NextGIS Web to apply changes.
2.12.3. Adding NextGIS Web QGIS extension¶
This extension adds support for rending with QGIS. To operate it needs QGIS 2.8 or higher already installed on the system.
cd ~/ngw git clone email@example.com:nextgis/nextgisweb_qgis.git source env/bin/activate pip install -e nextgisweb_qgis/
QGIS and PyQT4 dependencies are not listed in
setup.py because it is hard to install it in virtualenv. So lets copy these libraries from system packages to virtualenv. On Ubuntu these libraries are located in
# DST should point to virtualenv site-packages directory. # If it is point to another place you have to modify DST definition. # For example: DST=`python -c "import sys; print sys.path[-2]"` DST=`python -c "import sys; print sys.path[-1]"` echo $DST cp `/usr/bin/python -c "import sip; print sip.__file__"` $DST cp -r `/usr/bin/python -c "import PyQt4, os.path; print os.path.split(PyQt4.__file__)"` $DST cp -r `/usr/bin/python -c "import qgis, os.path; print os.path.split(qgis.__file__)"` $DST
For QGIS 2.16 and higher:
# Only for latest QGIS version (2.16 and higher) export PYTHONPATH=$PYTHONPATH:/usr/share/qgis/python cp -r `/usr/bin/python -c "import PyQt, os.path; print os.path.split(PyQt.__file__)"` $DST
126.96.36.199. uWSGI Deployment Notes¶
You have to add –lazy-apps to the command line, in this way application will be loaded after master’s fork, so each worker will get its thread.
[uwsgi] lazy-apps = True
Beware as there is an older options named lazy that is way more invasive and highly discouraged (it is still here only for backward compatibility).
If you get an error message ERROR: Auth db directory path could not be created then you have to specify directory where an existing qgis-auth.db is located or created if not present. This directory needs to be writeable by uwsgi process user. For example:
[uwsgi] env = QGIS_AUTH_DB_DIR_PATH=/var/www
If you don’t see cyrillic labels add the following environment variable:
environment = LC_ALL="en_US.UTF-8"