我正在尝试运行需要以下版本的ogr2ogr命令 使用足够新的SpatiaLite构建的GDAL具有ST_MakeValid 功能---从discussion groups看来,to be 4.0+
但是,ubuntugis中的gdal版本看起来像gdal的现代版本
$ gdalinfo --version
GDAL 2.2.4, released 2018/03/19
我有一个现代的太空人:
$ sudo apt-get install libspatialite-dev spatialite-bin libspatialite7
... already installed
$ spatialite
SpatiaLite version ..: 4.3.0a Supported Extensions:
,但是ogr2ogr
命令似乎并未与回购中的spacespaceite版本一起编译为独立的二进制文件,而是更旧的版本。 (我不能告诉您如何检查它使用哪个版本,仅this command that succeeds when it is up to date, fails就可以了)
这是我的Dockerfile:
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y software-properties-common \
&& add-apt-repository ppa:ubuntugis/ubuntugis-unstable -y && apt-get update \
&& apt-get install --yes gdal-bin curl \
&& curl -LKS 'https://github.com/OpenDataDE/State-zip-code-GeoJSON/raw/master/ks_kansas_zip_codes_geo.min.json' -o ks_kansas_zip_codes_geo.min.json \
&& ogrinfo --version \
&& ogr2ogr -f GeoJSON -dialect sqlite -sql "select ST_MakeValid(geometry),STATEFP10,ZCTA5CE10,GEOID10,CLASSFP10,MTFCC10,FUNCSTAT10,ALAND10,AWATER10,INTPTLAT10,INTPTLON10,PARTFLG10 from \"ks_kansas_zip_codes_geo.min\"" clean.json ks_kansas_zip_codes_geo.min.json
我可以在存储库中进行哪些更改,或者如何手动编译gdal
以使其具有包含ST_MakeValid
函数的spacespaceite版本?
收集可能相关的搜索结果:
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y software-properties-common \
&& add-apt-repository ppa:ubuntugis/ubuntugis-unstable -y \
# # INSTALLING GRASS DOES NOT SEEM HELPFUL
# && add-apt-repository ppa:grass/grass-devel -y \
&& apt-get update \
&& apt-get install --yes curl git autoconf libtool \
# # TRIED RTTOPO FROM HERE:
# # http://postgis.17.x6.nabble.com/Why-can-t-PostGIS-configure-find-libgeos-c-td3552982.html
# # AND HERE:
# # https://gitlab.com/rttopo/rttopo
# # DOES NOT SEEM FRUITFUL
# apt-get install --yes libgeos-dev \
# && git clone https://gitlab.com/rttopo/rttopo.git \
# && cd rttopo && ./autogen.sh && ./configure --enable-rttopo=yes --with-geosconfig=/usr/bin/geos-config && make && make install \
# && cd \
&& apt-get install --yes gdal-bin \
&& curl -LKS 'https://github.com/OpenDataDE/State-zip-code-GeoJSON/raw/master/ks_kansas_zip_codes_geo.min.json' -o ks_kansas_zip_codes_geo.min.json \
&& ogrinfo --version \
&& ogr2ogr -f GeoJSON -dialect sqlite -sql "select ST_MakeValid(geometry),STATEFP10,ZCTA5CE10,GEOID10,CLASSFP10,MTFCC10,FUNCSTAT10,ALAND10,AWATER10,INTPTLAT10,INTPTLON10,PARTFLG10 from \"ks_kansas_zip_codes_geo.min\"" clean.json ks_kansas_zip_codes_geo.min.json