Commit ad378d98 authored by Michael Auer's avatar Michael Auer
Browse files

[WIP] refactored project to use typescript

parent 26f4bc9e
declare module 'pg-async/lib/sql' {
import {QueryConfig} from 'pg';
export class SqlFragment implements QueryConfig {
name?: string;
text: string;
values: any[];
constructor(templateParts: string[], templateValues: any[]);
toString(): string;
}
namespace SQL {
type Transformer = (value: any) => any;
const _transforms: {[key: string]: Transformer};
function registerTransform(name1: string, transform: Transformer): undefined;
function registerTransform(name1: string, name2: string, transform: Transformer): undefined;
}
function SQL(parts: TemplateStringsArray | SqlFragment, ...values: any[]): SqlFragment;
export default SQL;
}
declare module 'pg-async/lib/index' {
import {PoolConfig} from 'pg';
class PgAsync {
constructor(connectionOptions: PoolConfig, driver?: string);
value(sql:string): Promise<any>
query(sql:string): Promise<any>
closeConnections(): Promise<void>
}
export default PgAsync;
}
declare module 'pg-async' {
import SQL from 'pg-async/lib/sql';
import PgAsync from 'pg-async/lib/index';
export default PgAsync;
export {SQL};
}
import {GeoJSONObject} from '@turf/helpers';
import {InterfaceProjection, ProjectionDefinition} from 'proj4';
export function detectCrs(geojson: GeoJSONObject, projs: {[name:string]: ProjectionDefinition }): InterfaceProjection;
export function reproject(geojson: GeoJSONObject, from: any, to: any , projs?:any):GeoJSONObject; //{[name:string]: ProjectionDefinition }): GeoJSONObject;
export function reverse(geojson: GeoJSONObject): GeoJSONObject;
export function toWgs84(geojson: GeoJSONObject, from: string | String, projs: {[name:string]: ProjectionDefinition }): GeoJSONObject;
// const PgAsync = require('pg-async').default;
//const SQL = require('pg-async').SQL;
// const axios = require('axios');
// const querystring = require('querystring');
// const turfHelpers = require('@turf/helpers');
// const PgFeatureType = require('./PgFeatureType.js');
//abstract class and factory for postgis, GeoJSON, ...
class FeatureType {
constructor(config) {
this.config = config;
}
/**
* @returns GeoJSON<FeatureCollection>
**/
async getFeatures(){}
async writeFeatures(featureCollection){}
async writeOhsomeFeatures(ohsomeGroupByBoundaryResponseJSON, horizontalTimestampColumns){}
/**
* physically deletes the feature type from the store (e.g. file from disk or table from database)
**/
async delete(){}
async finalize(){}
}
module.exports = FeatureType;
const path = require('path');
const fs = require('fs');
const Ohsome2X = require('../ohsome2x/Ohsome2X.js');
const Ohsome2X = require('../dist/Ohsome2X.js');
const argv = require('minimist')(process.argv.slice(2));
var inquirer = require('inquirer');
const argv_ = process.argv.slice(2);
......
{
"name": "ohsome2x",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@turf/area": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/@turf/area/-/area-6.0.1.tgz",
"integrity": "sha512-Zv+3N1ep9P5JvR0YOYagLANyapGWQBh8atdeR3bKpWcigVXFsEKNUw03U/5xnh+cKzm7yozHD6MFJkqQv55y0g==",
"requires": {
"@turf/helpers": "6.x",
"@turf/meta": "6.x"
}
},
"@turf/helpers": {
"version": "6.1.4",
"resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.1.4.tgz",
"integrity": "sha512-vJvrdOZy1ngC7r3MDA7zIGSoIgyrkWcGnNIEaqn/APmw+bVLF2gAW7HIsdTxd12s5wQMqEpqIQrmrbRRZ0xC7g=="
},
"@turf/invariant": {
"version": "6.1.2",
"resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.1.2.tgz",
"integrity": "sha512-WU08Ph8j0J2jVGlQCKChXoCtI50BB3yEH21V++V0T4cR1T27HKCxkehV2sYMwTierfMBgjwSwDIsxnR4/2mWXg==",
"requires": {
"@turf/helpers": "6.x"
}
},
"@turf/meta": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/@turf/meta/-/meta-6.0.2.tgz",
"integrity": "sha512-VA7HJkx7qF1l3+GNGkDVn2oXy4+QoLP6LktXAaZKjuT1JI0YESat7quUkbCMy4zP9lAUuvS4YMslLyTtr919FA==",
"requires": {
"@turf/helpers": "6.x"
}
},
"@types/node": {
"version": "12.6.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.6.2.tgz",
"integrity": "sha512-gojym4tX0FWeV2gsW4Xmzo5wxGjXGm550oVUII7f7G5o4BV6c7DBdiG1RRQd+y1bvqRyYtPfMK85UM95vsapqQ==",
"dev": true
},
"@types/papaparse": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@types/papaparse/-/papaparse-5.0.0.tgz",
"integrity": "sha512-JxYinxHA59+Vk3H61fjrPp1v0tjeT+WcyL/TGYDzmiig8125ndlbI5c6ZKVEaXQbsU8RF3TyCvH7tWsG2bI/Nw==",
"dev": true,
"requires": {
"@types/node": "*"
}
},
"@types/pg": {
"version": "7.4.14",
"resolved": "https://registry.npmjs.org/@types/pg/-/pg-7.4.14.tgz",
"integrity": "sha512-2e4XapP9V/X42IGByC5IHzCzHqLLCNJid8iZBbkk6lkaDMvli8Rk62YE9wjGcLD5Qr5Zaw1ShkQyXy91PI8C0Q==",
"dev": true,
"requires": {
"@types/node": "*",
"@types/pg-types": "*"
}
},
"@types/pg-types": {
"version": "1.11.4",
"resolved": "https://registry.npmjs.org/@types/pg-types/-/pg-types-1.11.4.tgz",
"integrity": "sha512-WdIiQmE347LGc1Vq3Ki8sk3iyCuLgnccqVzgxek6gEHp2H0p3MQ3jniIHt+bRODXKju4kNQ+mp53lmP5+/9moQ==",
"dev": true,
"requires": {
"moment": ">=2.14.0"
}
},
"@types/proj4": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/@types/proj4/-/proj4-2.5.0.tgz",
"integrity": "sha512-9bR9qvg4wZE6UiIlmhodCOZ2r38SeN8T35SsmMDuIMfACxxaMvIwiwoTJnEA9f/KEhL+BQSuD+arbZucUzYu7w==",
"dev": true
},
"JSONStream": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz",
"integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==",
"requires": {
"jsonparse": "^1.2.0",
"through": ">=2.2.7 <3"
}
},
"axios": {
"version": "0.19.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.19.0.tgz",
"integrity": "sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==",
"requires": {
"follow-redirects": "1.5.10",
"is-buffer": "^2.0.2"
}
},
"bluebird": {
"version": "3.5.5",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz",
"integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w=="
},
"buffer-from": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
},
"buffer-writer": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz",
"integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw=="
},
"concat-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz",
"integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==",
"requires": {
"buffer-from": "^1.0.0",
"inherits": "^2.0.3",
"readable-stream": "^3.0.2",
"typedarray": "^0.0.6"
}
},
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"requires": {
"ms": "2.0.0"
}
},
"duplexer": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz",
"integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E="
},
"event-stream": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/event-stream/-/event-stream-4.0.1.tgz",
"integrity": "sha512-qACXdu/9VHPBzcyhdOWR5/IahhGMf0roTeZJfzz077GwylcDd90yOHLouhmv7GJ5XzPi6ekaQWd8AvPP2nOvpA==",
"requires": {
"duplexer": "^0.1.1",
"from": "^0.1.7",
"map-stream": "0.0.7",
"pause-stream": "^0.0.11",
"split": "^1.0.1",
"stream-combiner": "^0.2.2",
"through": "^2.3.8"
}
},
"follow-redirects": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
"integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
"requires": {
"debug": "=3.1.0"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
}
}
},
"from": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz",
"integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4="
},
"geojson-stream": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/geojson-stream/-/geojson-stream-0.1.0.tgz",
"integrity": "sha512-svSg5fFXPaTiqzEBGXScA+nISaeC9rLvku2PH+wM5LToATUw2bLIrvls43ymnT9Xnp51nBPVyK9m4Af40KpJ7w==",
"requires": {
"JSONStream": "^1.0.0",
"through": "^2.3.4"
}
},
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"is-buffer": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz",
"integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw=="
},
"jsonparse": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz",
"integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA="
},
"map-stream": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz",
"integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg="
},
"mgrs": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/mgrs/-/mgrs-1.0.0.tgz",
"integrity": "sha1-+5FYjnjJACVnI5XLQLJffNatGCk="
},
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
},
"moment": {
"version": "2.24.0",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"normalize-url": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.3.0.tgz",
"integrity": "sha512-0NLtR71o4k6GLP+mr6Ty34c5GA6CMoEsncKJxvQd8NzPxaHRJNnb5gZE8R1XF4CPIS7QPHLJ74IFszwtNVAHVQ=="
},
"packet-reader": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz",
"integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ=="
},
"papaparse": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.0.0.tgz",
"integrity": "sha512-gCqNseOMB5RInYXR051oWfCIZZI9ldhijkeMj0kNYLpE/hSRLHaW8ctoK4h3IuS1v8l+PovsV96LjXtgmzHRxA=="
},
"pause-stream": {
"version": "0.0.11",
"resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz",
"integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=",
"requires": {
"through": "~2.3"
}
},
"pg": {
"version": "7.11.0",
"resolved": "https://registry.npmjs.org/pg/-/pg-7.11.0.tgz",
"integrity": "sha512-YO4V7vCmEMGoF390LJaFaohWNKaA2ayoQOEZmiHVcAUF+YsRThpf/TaKCgSvsSE7cDm37Q/Cy3Gz41xiX/XjTw==",
"requires": {
"buffer-writer": "2.0.0",
"packet-reader": "1.0.0",
"pg-connection-string": "0.1.3",
"pg-pool": "^2.0.4",
"pg-types": "~2.0.0",
"pgpass": "1.x",
"semver": "4.3.2"
}
},
"pg-async": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/pg-async/-/pg-async-3.1.0.tgz",
"integrity": "sha512-GwxE/NkOCAgM6K0r1VoMEO61x+ze1KxdzFQitmOLZe6MmqKmP7iQLdXV7ZBHji10tz52sl+64EN7NqqtVJJaIA==",
"requires": {
"bluebird": "^3.5.0",
"debug": "^2.6.3",
"pg": "^7.0.2"
}
},
"pg-connection-string": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-0.1.3.tgz",
"integrity": "sha1-2hhHsglA5C7hSSvq9l1J2RskXfc="
},
"pg-int8": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz",
"integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw=="
},
"pg-pool": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-2.0.6.tgz",
"integrity": "sha512-hod2zYQxM8Gt482q+qONGTYcg/qVcV32VHVPtktbBJs0us3Dj7xibISw0BAAXVMCzt8A/jhfJvpZaxUlqtqs0g=="
},
"pg-types": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.0.1.tgz",
"integrity": "sha512-b7y6QM1VF5nOeX9ukMQ0h8a9z89mojrBHXfJeSug4mhL0YpxNBm83ot2TROyoAmX/ZOX3UbwVO4EbH7i1ZZNiw==",
"requires": {
"pg-int8": "1.0.1",
"postgres-array": "~2.0.0",
"postgres-bytea": "~1.0.0",
"postgres-date": "~1.0.4",
"postgres-interval": "^1.1.0"
}
},
"pgpass": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.2.tgz",
"integrity": "sha1-Knu0G2BltnkH6R2hsHwYR8h3swY=",
"requires": {
"split": "^1.0.0"
}
},
"postgres-array": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
"integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA=="
},
"postgres-bytea": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz",
"integrity": "sha1-AntTPAqokOJtFy1Hz5zOzFIazTU="
},
"postgres-date": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.4.tgz",
"integrity": "sha512-bESRvKVuTrjoBluEcpv2346+6kgB7UlnqWZsnbnCccTNq/pqfj1j6oBaN5+b/NrDXepYUT/HKadqv3iS9lJuVA=="
},
"postgres-interval": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz",
"integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==",
"requires": {
"xtend": "^4.0.0"
}
},
"proj4": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/proj4/-/proj4-2.5.0.tgz",
"integrity": "sha512-XZTRT7OPdLzgvtTqL8DG2cEj8lYdovztOwiwpwRSYayOty5Ipf3H68dh/fiL+HKDEyetmQSMhkkMGiJoyziz3w==",
"requires": {
"mgrs": "1.0.0",
"wkt-parser": "^1.2.0"
}
},
"querystring": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz",
"integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA="
},
"readable-stream": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz",
"integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==",
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
},
"reproject": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/reproject/-/reproject-1.2.4.tgz",
"integrity": "sha512-ubW3LUSsWVTRMv40mcDZG7jZCpMybEDIbhddwXmq7MSh11pJo2omBf9k4fwe6fAfe3l1O4FCl53uV5fYv5XtRw==",
"requires": {
"concat-stream": "^2.0.0",
"event-stream": "^4.0.0",
"geojson-stream": "0.1.0",
"minimist": "^1.2.0",
"proj4": "^2.4.4"
}
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"semver": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-4.3.2.tgz",
"integrity": "sha1-x6BxWKgL7dBSNVt3DYLWZA+AO+c="
},
"split": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz",
"integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==",
"requires": {
"through": "2"
}
},
"stream-combiner": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz",
"integrity": "sha1-rsjLrBd7Vrb0+kec7YwZEs7lKFg=",
"requires": {
"duplexer": "~0.1.1",
"through": "~2.3.4"
}
},
"string_decoder": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz",
"integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==",
"requires": {
"safe-buffer": "~5.1.0"
}
},
"through": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
},
"tslib": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ=="
},
"typedarray": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
},
"typescript": {
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz",
"integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==",
"dev": true
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"wkt-parser": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/wkt-parser/-/wkt-parser-1.2.3.tgz",
"integrity": "sha512-s7zrOedGuHbbzMaQOuf8HacuCYp3LmmrHjkkN//7UEAzsYz7xJ6J+j/84ZWZkQcrRqi3xXyuc4odPHj7PEB0bw=="
},
"xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
}
}
}
{
"name": "ohsome2x",
"version": "1.0.0",
"description": "convenience library to query ohsome-api using nodejs",
"main": "Ohsome2X.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc --build ./tsconfig.json"
},
"repository": {
"type": "git",
"url": "ssh://git@gitlab.gistools.geog.uni-heidelberg.de:2022/giscience/big-data/ohsome/libs/ohsome2x.git"
},
"keywords": [
"ohsome"
],
"author": "M. Auer (HeiGIT)",
"license": "MIT",
"dependencies": {
"@turf/area": "^6.0.1",
"@turf/helpers": "^6.1.4",
"@turf/invariant": "^6.1.2",
"axios": "^0.19.0",
"moment": "^2.24.0",
"normalize-url": "^4.3.0",
"papaparse": "^5.0.0",
"pg-async": "^3.1.0",
"proj4": "^2.5.0",
"querystring": "^0.2.0",
"reproject": "^1.2.4",
"tslib": "^1.10.0"
},
"devDependencies": {
"@types/node": "^12.6.2",
"@types/papaparse": "^5.0.0",
"@types/pg": "^7.4.14",
"@types/proj4": "^2.5.0",
"typescript": "^3.5.3"
}
}
import {FeatureTypeConfig} from './config_types_interfaces';
import {FeatureCollection} from '@turf/helpers';
//abstract class and factory for postgis, GeoJSON, ...
export abstract class FeatureType {
private config: FeatureTypeConfig;
constructor(config: FeatureTypeConfig) {
this.config = config;
}
/**
* @returns GeoJSON<FeatureCollection>
**/
abstract async getFeatures(): Promise<FeatureCollection>;
abstract async writeFeatures(featureCollection: FeatureCollection): Promise<void>;
abstract async writeOhsomeFeatures(ohsomeGroupByBoundaryResponseJSON: any, horizontalTimestampColumns: boolean): Promise<void>;
/**
* physically deletes the feature type from the store (e.g. file from disk or table from database)
**/
abstract async delete(): Promise<void>;