-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(spatialite5): upgrade to spatialite version 5 and ensure RTTOPO …
- Loading branch information
1 parent
b25482e
commit 7e43a6b
Showing
7 changed files
with
184 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ Dockerfile | |
.dockerignore | ||
node_modules | ||
tmp | ||
build/tmp | ||
package-lock.json | ||
*.md | ||
*.db | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
node_modules | ||
tmp | ||
build/tmp | ||
package-lock.json | ||
*.db | ||
*.db-journal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
REPO='https://git.osgeo.org/gitea/rttopo/librttopo.git' | ||
BRANCH='master' | ||
|
||
mkdir -p tmp | ||
cd tmp | ||
|
||
[[ -d "${RELEASE}" ]] || git clone "${REPO}" | ||
|
||
cd 'librttopo' | ||
git checkout "${BRANCH}" | ||
|
||
make clean | ||
./autogen.sh | ||
./configure | ||
make -j8 | ||
make check | ||
make install | ||
|
||
# /usr/local/include/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
HOST='http://www.gaia-gis.it/gaia-sins' | ||
RELEASE='spatialite-tools-4.4.0-RC0' | ||
|
||
mkdir -p tmp | ||
cd tmp | ||
|
||
[[ -f "${RELEASE}.tar.gz" ]] || curl -LO "${HOST}/${RELEASE}.tar.gz" | ||
[[ -d "${RELEASE}" ]] || tar xvzf "${RELEASE}.tar.gz" | ||
|
||
cd "${RELEASE}" | ||
make clean | ||
|
||
# build flags | ||
export CPPFLAGS="" | ||
export LDFLAGS="" | ||
|
||
# location of spatialite | ||
export LDFLAGS="${LDFLAGS} -L/usr/local/lib" | ||
|
||
# location of sqlite | ||
SQLITE3='/usr/local/opt/sqlite' | ||
export CPPFLAGS="${CPPFLAGS} -I${SQLITE3}/include" | ||
export LDFLAGS="${LDFLAGS} -L${SQLITE3}/lib" | ||
|
||
# location of spatialite | ||
SPATIALITE="$(pwd)/libspatialite-5.0.0-beta0" | ||
export CPPFLAGS="${CPPFLAGS} -I${SQLITE3}/include" | ||
export LDFLAGS="${LDFLAGS} -L${SQLITE3}/lib" | ||
|
||
# # location of proj | ||
# PROJ6='/usr/local/Cellar/proj/6.1.0' | ||
# export CPPFLAGS="${CPPFLAGS} -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" # required flag to use proj6 | ||
# export CPPFLAGS="${CPPFLAGS} -I${PROJ6}/include" | ||
# export LDFLAGS="-L${PROJ6}/lib" | ||
|
||
# location of libxml2 | ||
LIBXML2='/usr/local/Cellar/libxml2/2.9.9_2' | ||
export CPPFLAGS="${CPPFLAGS} -I${LIBXML2}/include/libxml2" | ||
export LDFLAGS="${LDFLAGS} -L${LIBXML2}/lib" | ||
|
||
./configure --disable-dependency-tracking | ||
make -j8 | ||
|
||
./spatialite -silent :memory: <<SQL | ||
SELECT 'sqlite_version', sqlite_version(); | ||
SELECT 'spatialite_version', spatialite_version(); | ||
SQL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/bash | ||
HOST='http://www.gaia-gis.it/gaia-sins/libspatialite-sources' | ||
RELEASE='libspatialite-5.0.0-beta0' | ||
|
||
mkdir -p tmp | ||
cd tmp | ||
|
||
[[ -f "${RELEASE}.tar.gz" ]] || curl -LO "${HOST}/${RELEASE}.tar.gz" | ||
[[ -d "${RELEASE}" ]] || tar xvzf "${RELEASE}.tar.gz" | ||
|
||
cd "${RELEASE}" | ||
make clean | ||
|
||
# build flags | ||
export CPPFLAGS="" | ||
export LDFLAGS="" | ||
|
||
# location of sqlite | ||
SQLITE3='/usr/local/opt/sqlite' | ||
export CPPFLAGS="${CPPFLAGS} -I${SQLITE3}/include" | ||
export LDFLAGS="${LDFLAGS} -L${SQLITE3}/lib" | ||
|
||
# check sqlite was compiled with 'ENABLE_RTREE' | ||
"${SQLITE3}/bin/sqlite3" :memory: 'PRAGMA compile_options' | grep -q ENABLE_RTREE | ||
if [[ $? != 0 ]]; then | ||
2>&1 echo 'sqlite3 was not compiled with the ENABLE_RTREE extension' | ||
exit 1 | ||
fi | ||
|
||
# check sqlite was compiled with 'ENABLE_COLUMN_METADATA' | ||
"${SQLITE3}/bin/sqlite3" :memory: 'PRAGMA compile_options' | grep -q ENABLE_COLUMN_METADATA | ||
if [[ $? != 0 ]]; then | ||
2>&1 echo 'sqlite3 was not compiled with the ENABLE_COLUMN_METADATA extension' | ||
exit 1 | ||
fi | ||
|
||
# location of proj | ||
PROJ6='/usr/local/Cellar/proj/6.1.0' | ||
export CPPFLAGS="${CPPFLAGS} -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" # required flag to use proj6 | ||
export CPPFLAGS="${CPPFLAGS} -I${PROJ6}/include" | ||
export LDFLAGS="-L${PROJ6}/lib" | ||
|
||
# location of libxml2 | ||
LIBXML2='/usr/local/Cellar/libxml2/2.9.9_2' | ||
export CPPFLAGS="${CPPFLAGS} -I${LIBXML2}/include/libxml2" | ||
export LDFLAGS="${LDFLAGS} -L${LIBXML2}/lib" | ||
|
||
# # location of rttopo | ||
# RTTOPO="$(pwd)/librttopo" | ||
# export CPPFLAGS="${CPPFLAGS} -DGEOS_USE_ONLY_R_API" # required flag to use rttopo? | ||
# export CPPFLAGS="${CPPFLAGS} -I${RTTOPO}/headers" | ||
# export LDFLAGS="${LDFLAGS} -L${RTTOPO}/src" | ||
|
||
./configure \ | ||
--disable-dependency-tracking \ | ||
--enable-rttopo=yes \ | ||
--enable-proj=yes \ | ||
--enable-geos=yes \ | ||
--enable-gcp=yes \ | ||
--enable-libxml2=yes | ||
|
||
make -j8 | ||
make install | ||
|
||
"${SQLITE3}/bin/sqlite3" :memory: <<SQL | ||
SELECT 'sqlite_version', sqlite_version(); | ||
SELECT load_extension('./src/.libs/mod_spatialite.so'); | ||
SELECT 'spatialite_version', spatialite_version(); | ||
SELECT 'rttopo_version', rttopo_version(); | ||
SQL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters