Merge 5ec1b6f10768be0a392fa806ef5800d66ec37714 into 66d17625d85aa144e82702dbd1cf31aadf3d094d
This commit is contained in:
commit
6f781293f5
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
env
|
@ -1,4 +1,4 @@
|
||||
FROM python:3.4
|
||||
FROM python:3.7.2
|
||||
RUN mkdir -p /usr/src/app
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
tornado==4.4.2
|
||||
sqlalchemy==1.1.5
|
||||
mercantile==0.9.0
|
||||
pyproj==1.9.5.1
|
||||
pyyaml==3.12
|
||||
psycopg2==2.6.2
|
||||
mercantile==1.0.4
|
||||
psycopg2-binary==2.7.7
|
||||
pyproj==1.9.6
|
||||
PyYAML==3.13
|
||||
SQLAlchemy==1.2.18
|
||||
tornado==5.1.1
|
||||
|
@ -29,7 +29,7 @@ def GeneratePrepared(layers):
|
||||
layer_query = layer['Datasource']['table'].lstrip().rstrip() # Remove lead and trailing whitespace
|
||||
layer_query = layer_query[1:len(layer_query)-6] # Remove enough characters to remove first and last () and "AS t"
|
||||
layer_query = layer_query.replace("geometry", "ST_AsMVTGeom(geometry,!bbox!,4096,0,true) AS mvtgeometry")
|
||||
base_query = "SELECT ST_ASMVT('"+layer['id']+"', 4096, 'mvtgeometry', tile) FROM ("+layer_query+" WHERE ST_AsMVTGeom(geometry, !bbox!,4096,0,true) IS NOT NULL) AS tile"
|
||||
base_query = "SELECT ST_ASMVT(tile, '"+layer['id']+"', 4096, 'mvtgeometry') FROM ("+layer_query+" WHERE ST_AsMVTGeom(geometry, !bbox!,4096,0,true) IS NOT NULL) AS tile"
|
||||
queries.append(base_query.replace("!bbox!","$1").replace("!scale_denominator!","$2").replace("!pixel_width!","$3").replace("!pixel_height!","$4"))
|
||||
prepared = prepared + " UNION ALL ".join(queries) + ";"
|
||||
print(prepared)
|
||||
|
Loading…
x
Reference in New Issue
Block a user