Add date-year style
This commit is contained in:
parent
717c07595a
commit
974a29ed6a
tileserver
@ -114,4 +114,32 @@ app.get('/highlight/:z/:x/:y.png', function(req, res) {
|
||||
})
|
||||
});
|
||||
|
||||
// date_year choropleth
|
||||
app.get('/date_year/:z/:x/:y.png', function(req, res) {
|
||||
const bbox = get_bbox(req.params)
|
||||
// const table_def = 'geometries'
|
||||
const table_def = `(
|
||||
SELECT
|
||||
cast(
|
||||
b.building_doc->>'date_year'
|
||||
as integer
|
||||
) as date_year,
|
||||
g.geometry_geom
|
||||
FROM
|
||||
geometries as g,
|
||||
buildings as b
|
||||
WHERE
|
||||
g.geometry_id = b.geometry_id
|
||||
AND
|
||||
b.building_doc ? 'date_year'
|
||||
) as outline`
|
||||
const style_def = ['date_year']
|
||||
render_tile(bbox, table_def, style_def, function(err, im) {
|
||||
if (err) throw err
|
||||
|
||||
res.writeHead(200, {'Content-Type': 'image/png'})
|
||||
res.end(im.encodeSync('png'))
|
||||
})
|
||||
});
|
||||
|
||||
app.listen(8082, () => console.log('Tile server listening on port 8082'))
|
||||
|
@ -11,4 +11,106 @@
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
</Style>
|
||||
<Style name="date_year">
|
||||
<Rule>
|
||||
<Filter>[date_year] >= 2000</Filter>
|
||||
<PolygonSymbolizer fill="#fcfcb8" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<ElseFilter />
|
||||
<PolygonSymbolizer fill="#ffffff33" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[date_year] >= 1980 and [date_year] < 2000</Filter>
|
||||
<PolygonSymbolizer fill="#fee9a5" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[date_year] >= 1960 and [date_year] < 1980</Filter>
|
||||
<PolygonSymbolizer fill="#fec580" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[date_year] >= 1940 and [date_year] < 1960</Filter>
|
||||
<PolygonSymbolizer fill="#ffb63c" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[date_year] >= 1920 and [date_year] < 1940</Filter>
|
||||
<PolygonSymbolizer fill="#ff7e3e" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[date_year] >= 1900 and [date_year] < 1920</Filter>
|
||||
<PolygonSymbolizer fill="#ff5353" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[date_year] >= 1880 and [date_year] < 1900</Filter>
|
||||
<PolygonSymbolizer fill="#df73ff" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[date_year] >= 1860 and [date_year] < 1880</Filter>
|
||||
<PolygonSymbolizer fill="#b81ae7" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[date_year] >= 1840 and [date_year] < 1860</Filter>
|
||||
<PolygonSymbolizer fill="#8400a8" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[date_year] >= 1820 and [date_year] < 1840</Filter>
|
||||
<PolygonSymbolizer fill="#73ffdf" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[date_year] >= 1800 and [date_year] < 1820</Filter>
|
||||
<PolygonSymbolizer fill="#00ffc5" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[date_year] >= 1780 and [date_year] < 1800</Filter>
|
||||
<PolygonSymbolizer fill="#00c5ff" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[date_year] >= 1760 and [date_year] < 1780</Filter>
|
||||
<PolygonSymbolizer fill="#73b2ff" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[date_year] >= 1740 and [date_year] < 1760</Filter>
|
||||
<PolygonSymbolizer fill="#00a9e6" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[date_year] >= 1720 and [date_year] < 1740</Filter>
|
||||
<PolygonSymbolizer fill="#0070ff" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[date_year] >= 1700 and [date_year] < 1720</Filter>
|
||||
<PolygonSymbolizer fill="#004da8" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[date_year] >= 1680 and [date_year] < 1700</Filter>
|
||||
<PolygonSymbolizer fill="#897044" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[date_year] >= 1660 and [date_year] < 1680</Filter>
|
||||
<PolygonSymbolizer fill="#894444" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[date_year] < 1660</Filter>
|
||||
<PolygonSymbolizer fill="#4c0073" />
|
||||
<LineSymbolizer stroke="white" stroke-width="0.3" />
|
||||
</Rule>
|
||||
</Style>
|
||||
</Map>
|
||||
|
Loading…
Reference in New Issue
Block a user