/* ================================================================================ Pivot example with variable number of columns in the output. ================================================================================ example data is straight forward, imagine a table with a customer identifier, an invoice date and an amount. */ DROP TABLE IF EXISTS invoice;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| <!DOCTYPE qgis_style> | |
| <qgis_style version="2"> | |
| <symbols> | |
| <symbol clip_to_extent="1" name="qlimt" force_rhr="0" type="fill" alpha="1"> | |
| <layer enabled="1" pass="0" locked="0" class="GeometryGenerator"> | |
| <prop v="Fill" k="SymbolType"/> | |
| <prop v="with_variable('my_geom',
CASE WHEN 
 num_geometries( $geometry)>1
 THEN 
 geometry_n( $geometry, @geometry_part_num)
 ELSE
 $geometry
 END,
 with_variable('shape',rand(1,4),
 CASE WHEN 
 @shape =1
 THEN 
 minimal_circle( @my_geom )
 WHEN
 @shape =2
 THEN
 oriented_bbox( @my_geom )
 WHEN
 @shape =3
 THEN
 oriented_bbox( @my_geom )
 WHEN
 @shape =4
 THEN
 simplify(@my_geom, rand(1,20))
 END))
 " k="geometryModifier"/> | |
| <data_defined_properties> | |
| <Option type="Map"> | |
This file contains hidden or 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
| /** | |
| * Sort array of objects based on another array | |
| */ | |
| function mapOrder (array, order, key) { | |
| array.sort( function (a, b) { | |
| var A = a[key], B = b[key]; | |
This file contains hidden or 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
| /** | |
| * To get started install | |
| * express bodyparser jsonwebtoken express-jwt | |
| * via npm | |
| * command :- | |
| * npm install express bodyparser jsonwebtoken express-jwt --save | |
| */ | |
| // Bringing all the dependencies in | |
| const express = require('express'); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| export const ensureMutationId: Plugin = builder => { | |
| builder.hook('GraphQLObjectType:fields:field', (field, build, context) => { | |
| const {pgSql: sql} = build | |
| const { | |
| scope: { | |
| isPgUpdateMutationField, | |
| isPgCreateMutationField, | |
| isPgDeleteMutationField, | |
| }, | |
| } = context |
This file contains hidden or 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
| const express = require("express") | |
| const app = express() | |
| const { Pool } = require("pg") | |
| const SphericalMercator = require("sphericalmercator") | |
| const pool = new Pool({ | |
| host: "localhost", | |
| port: 15432, | |
| user: "postgres", | |
| database: "postgres" | |
| }) |
This file contains hidden or 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
| const fs = require("fs"); | |
| const geobuf = require("geobuf"); | |
| const Protobuf = require("pbf"); | |
| const pgp = require("pg-promise")(); | |
| const vt = require("vector-tile"); | |
| const db = pgp(process.env.DATABASE_URL); | |
| const tile_with_properties_as_jsonb = `WITH data AS ( | |
| SELECT * FROM (VALUES |