Memasang SpatiaLiteLink to this heading

SpatiaLite menambah dukungan spasial untuk SQLite, merubah itu menjadi basisdata spasial penuh-fitur.

Pertama, periksa jika anda dapat memasang SpatiaLite dari paket-paket sistem atau biner.

For example, on Debian-based distributions that package SpatiaLite 4.3+, try to install the libsqlite3-mod-spatialite package. For older releases install spatialite-bin.

Untuk macOS, ikuti instructions below1.

Untuk Windows, anda mungkin menemukan biner pada halaman rumah Gaia-SINS.

Dalam kasus apapun, anda harus selalu dapat untuk install from source 1.

Memasang dari sumberLink to this heading

GEOS and PROJ should be installed prior to building SpatiaLite.

SQLiteLink to this heading

Periksa pertama jika SQLLite disusun dengan R*Tree module. Jalankan antarmuka baris perintah sqlite3 dan masukkan permintaan berikut:

Code
sqlite> CREATE VIRTUAL TABLE testrtree USING rtree(id,minX,maxX,minY,maxY);

If you obtain an error, you will have to recompile SQLite from source. Otherwise, skip this section.

Untuk memasang dari sumber, unduh arsip sumber penggabungan terakhir dari SQLite download page, dan ekstrak:

Code
$ wget https://www.sqlite.org/YYYY/sqlite-amalgamation-XXX0000.zip
$ unzip sqlite-amalgamation-XXX0000.zip
$ cd sqlite-amalgamation-XXX0000

Selanjutnya, jalankan tulisan configure -- bagaimanapun variabel lingkungan CFLAGS butuh disesuaikan sehingga SQLite mengetahui membangun modul R*Tree:

Code
$ CFLAGS="-DSQLITE_ENABLE_RTREE=1" ./configure
$ make
$ sudo make install
$ cd ..

Pustaka SpatiaLite (libspatialite)Link to this heading

Dapatkan buntalan sumber pustaka SpatiaLite terakhir dari download page:

Code
$ wget https://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-X.Y.Z.tar.gz
$ tar xaf libspatialite-X.Y.Z.tar.gz
$ cd libspatialite-X.Y.Z
$ ./configure
$ make
$ sudo make install

Petunjuk-petunjuk khusus-macOSLink to this heading

Untuk memasang pustaka SpatiaLite dan alat-alat, pengguna macOS dapat memilih diantara Paket KyngChaos dan Homebrew.

KyngChaosLink to this heading

Pertama, ikuti perintah dalam bagian Paket KyngChaos.

When creating a SpatiaLite database, the spatialite program is required. However, instead of attempting to compile the SpatiaLite tools from source, download the SpatiaLite Tools package for macOS, and install spatialite in a location available in your PATH. For example:

Code
$ curl -O https://www.kyngchaos.com/files/software/frameworks/Spatialite_Tools-4.3.zip
$ unzip Spatialite_Tools-4.3.zip
$ cd Spatialite\ Tools/tools
$ sudo cp spatialite /Library/Frameworks/SQLite3.framework/Programs

Akhirnya, untuk GeoDjango untukd apat menemukan pustaka KyngChaos SpatiaLite, tambah berikut ke settings.py anda

Code
SPATIALITE_LIBRARY_PATH='/Library/Frameworks/SQLite3.framework/SQLite3'

HomebrewLink to this heading

Homebrew menangani semua paket-paket terkair SpatiaLite atas nama anda, termasuk SQLite, SpatiaLite, PROJ, dan GEOS. Memasang mereka seperti ini:

Code
$ brew update
$ brew install spatialite-tools
$ brew install gdal

Akhirnya, untuk GeoDjango untukd apat menemukan pustaka SpatiaLite, tambah berikut ke settings.py anda

Code
SPATIALITE_LIBRARY_PATH='/usr/local/lib/mod_spatialite.dylib'