Skip to content

Commit

Permalink
Merge pull request #7 from Someware-fr/feat/spatialite
Browse files Browse the repository at this point in the history
Add SpatiaLite support
  • Loading branch information
jthiard authored Jun 16, 2022
2 parents 542fa1b + 70ab16c commit ae3918d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
45 changes: 44 additions & 1 deletion Dockerfile.wheels
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf \
&& sed -i 's/mirrorlist/#mirrorlist/' /etc/yum.repos.d/CentOS-Base.repo \
&& sed -i 's|#baseurl=http://mirror.centos.org/centos/$releasever|baseurl=http://vault.centos.org/5.11|' /etc/yum.repos.d/CentOS-Base.repo

RUN yum update -y && yum install -y curl-devel json-c-devel zlib-devel libtiff-devel krb5-devel pam-devel cyrus-sasl-devel
RUN yum update -y && yum install -y curl-devel json-c-devel zlib-devel libtiff-devel krb5-devel pam-devel cyrus-sasl-devel libxml2-devel


# Install openssl
Expand Down Expand Up @@ -134,6 +134,48 @@ ADD build_pg.sh /tmp/build_pg.sh
RUN cd /usr/local/src \
&& bash -x /tmp/build_pg.sh


## libspatialite need some dependencies....
# freexl
RUN cd /usr/local/src \
&& curl -f -L -O https://www.gaia-gis.it/gaia-sins/freexl-sources/freexl-1.0.6.tar.gz \
&& tar xzf freexl-1.0.6.tar.gz \
&& cd freexl-1.0.6 \
&& CFLAGS="-O2 -Wl,-S" ./configure --prefix=/usr/local \
&& make -j 8 \
&& make install

# librttopo
RUN cd /usr/local/src \
&& curl -f -L -O https://git.osgeo.org/gitea/rttopo/librttopo/archive/librttopo-1.1.0.tar.gz \
&& tar xzf librttopo-1.1.0.tar.gz \
&& cd librttopo \
&& ./autogen.sh \
&& CFLAGS="-O2 -Wl,-S" ./configure --prefix=/usr/local \
&& make -j 8 \
&& make install

# minizip 1.1
RUN cd /usr/local/src \
&& curl -f -L -O https://github.com/F2I-Consulting/Minizip/archive/refs/tags/v1.1_cmake0.1.tar.gz \
&& tar xzf v1.1_cmake0.1.tar.gz \
&& cd Minizip-1.1_cmake0.1 \
&& mkdir -p build \
&& cd build \
&& /usr/local/cmake/bin/cmake .. -DCMAKE_C_FLAGS="-DNOCRYPT" -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_INCLUDEDIR=/usr/local/include/minizip \
&& make -j8 \
&& make install

# libspatialite 5 itself
RUN cd /usr/local/src \
&& curl -f -L -O https://www.gaia-gis.it/gaia-sins/libspatialite-5.0.1.tar.gz \
&& tar xzf libspatialite-5.0.1.tar.gz \
&& cd libspatialite-5.0.1 \
&& CFLAGS="-std=c99" ./configure --prefix=/usr/local \
&& make -j 8 \
&& make install


# gdal
RUN mkdir -p /src \
&& cd /src \
Expand Down Expand Up @@ -170,6 +212,7 @@ RUN mkdir -p /src \
--with-openjpeg \
--with-jasper=/usr/local \
--with-pg \
--with-spatialite \
--without-python \
--without-hdf5 \
--without-hdf4 \
Expand Down
3 changes: 3 additions & 0 deletions test_wheels.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ def test_osm_driver():
'/vsicurl/http://download.openstreetmap.fr/extracts/europe/france/bretagne/ille_et_vilaine.osm.pbf'
)

def test_spatialite_driver():
driver = ogr.GetDriverByName('SQLite')
data_source = driver.CreateDataSource(":memory:", options=['SPATIALITE=YES'])

0 comments on commit ae3918d

Please sign in to comment.