Commit b760ffcd authored by Hanadi's avatar Hanadi
Browse files

Initial Commit

parents
# Created by https://www.gitignore.io
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
*.iml
## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:
# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries
# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml
# Gradle:
# .idea/gradle.xml
# .idea/libraries
# Mongo Explorer plugin:
# .idea/mongoSettings.xml
## File-based project format:
*.ipr
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
### Node ###
# Logs
logs
*.log
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
This project is a TypeScript Library for the entities used in the OGC 3D container (AKA GeoVolume API)
export declare class BoundingVolume {
box?: number[];
region?: number[];
sphere?: number[];
static fromJson(jsonObj: any): BoundingVolume;
}
import { _3DContainer } from "./_3DContainer";
import { Link } from "./Link";
export declare class Collections {
links?: Link[];
collections?: _3DContainer[];
static fromJson(jsonObj: any): Collections;
}
export declare class Conformance {
conformsTo: string[];
static fromJson(jsonObj: any): Conformance;
}
import { ExceptionCode } from "./ExceptionCode";
export declare class Exception extends Error {
code: ExceptionCode;
description?: string;
name: string;
constructor(code: ExceptionCode, description: string | undefined);
}
export declare enum ExceptionCode {
MISSING_REQUIRED_FIELD = "MISSING_REQUIRED_FIELD"
}
import { SpatialExtent } from "./SpatialExtent";
import { TemporalExtent } from "./TemporalExtent";
export declare class Extent {
spatial: SpatialExtent;
temporal?: TemporalExtent;
static fromJson(jsonObj: any): Extent;
}
export declare function validateRequiredFields(obj: any, fields: string[], className?: string): void;
import { Link } from "./Link";
export declare class LandingPage {
title?: string;
description?: string;
links: Link[];
static fromJson(jsonObj: any): LandingPage;
}
import { RelationshipLink } from "./RelationshipLink";
import { Type } from "./Type";
export declare class Link {
title?: string;
href: string;
rel: RelationshipLink;
type?: Type;
hreflang?: string;
static fromJson(jsonObj: any): Link;
}
export declare enum RelationshipLink {
affinemap = 0,
alternate = 1,
collection = 2,
conformance = 3,
data = 4,
dataset = 5,
describedBy = 6,
distribution = 7,
item = 8,
items = 9,
original = 10,
parent = 11,
root = 12,
scheme = 13,
self = 14,
service = 15,
'service-desc' = 16
}
import { Link } from "./Link";
export declare class Root {
links: Link[];
}
export declare class SpatialExtent {
crs?: string[];
bbox: number[];
static fromJson(jsonObj: any): SpatialExtent;
}
export declare class TemporalExtent {
trs?: string[];
interval?: string[];
static fromJson(jsonObj: any): TemporalExtent;
}
export declare type Type = "application/json" | "application/json-3dtiles" | "application/json-i3s" | "text/html";
import { Extent } from "./Extent";
import { BoundingVolume } from "./BoundingVolume";
import { Link } from "./Link";
export declare class _3DContainer {
id: string;
title?: string;
description?: string;
collectionType?: string;
itemType?: string;
extent: Extent;
contentExtent?: BoundingVolume;
crs?: string[];
links: Link[];
children?: _3DContainer[];
content?: Link[];
static fromJson(jsonObj: any): _3DContainer;
}
import { _3DContainer } from "./_3DContainer";
import { BoundingVolume } from "./BoundingVolume";
import { Collections } from "./Collections";
import { Conformance } from "./Conformance";
import { Extent } from "./Extent";
import { LandingPage } from "./LandingPage";
import { Link } from "./Link";
import { RelationshipLink } from "./RelationshipLink";
import { Root } from "./Root";
import { SpatialExtent } from "./SpatialExtent";
import { TemporalExtent } from "./TemporalExtent";
import type { Type } from "./Type";
import { ExceptionCode } from "./ExceptionCode";
import { Exception } from "./Exception";
export { _3DContainer, BoundingVolume, Collections, Conformance, Extent, LandingPage, Link, RelationshipLink, Root, SpatialExtent, TemporalExtent, Type, ExceptionCode, Exception };
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var Exception = /** @class */ (function (_super) {
__extends(Exception, _super);
function Exception(code, description) {
var _this = _super.call(this, description) || this;
_this.name = "OGC_Exception";
_this.code = code;
_this.description = description;
return _this;
}
return Exception;
}(Error));
var ExceptionCode;
(function (ExceptionCode) {
ExceptionCode["MISSING_REQUIRED_FIELD"] = "MISSING_REQUIRED_FIELD";
})(ExceptionCode || (ExceptionCode = {}));
function validateRequiredFields(obj, fields, className) {
fields.forEach(function (field) {
if (!obj.hasOwnProperty(field))
throw new Exception(ExceptionCode.MISSING_REQUIRED_FIELD, "Missing field " + field + (className ? " from " + className : ''));
});
}
var SpatialExtent = /** @class */ (function () {
function SpatialExtent() {
}
SpatialExtent.fromJson = function (jsonObj) {
validateRequiredFields(jsonObj, ["bbox"], SpatialExtent.name);
var spatialExtent = new SpatialExtent();
spatialExtent.crs = jsonObj["crs"];
spatialExtent.bbox = jsonObj["bbox"];
return spatialExtent;
};
return SpatialExtent;
}());
var TemporalExtent = /** @class */ (function () {
function TemporalExtent() {
}
TemporalExtent.fromJson = function (jsonObj) {
var temporalExtent = new TemporalExtent();
temporalExtent.trs = jsonObj["trs"];
temporalExtent.interval = jsonObj["interval"];
return temporalExtent;
};
return TemporalExtent;
}());
var Extent = /** @class */ (function () {
function Extent() {
}
Extent.fromJson = function (jsonObj) {
validateRequiredFields(jsonObj, ["spatial"], Extent.name);
var extent = new Extent();
extent.spatial = SpatialExtent.fromJson(jsonObj["spatial"]);
if (jsonObj.hasOwnProperty("temporal"))
extent.temporal = TemporalExtent.fromJson(jsonObj["temporal"]);
return extent;
};
return Extent;
}());
var BoundingVolume = /** @class */ (function () {
function BoundingVolume() {
}
BoundingVolume.fromJson = function (jsonObj) {
var boundingVolume = new BoundingVolume();
boundingVolume.box = jsonObj["box"];
boundingVolume.region = jsonObj["region"];
boundingVolume.sphere = jsonObj["sphere"];
return boundingVolume;
};
return BoundingVolume;
}());
var Link = /** @class */ (function () {
function Link() {
}
Link.fromJson = function (jsonObj) {
validateRequiredFields(jsonObj, ["href", "rel"], Link.name);
var link = new Link();
link.href = jsonObj["href"];
link.rel = jsonObj["rel"];
if ("title" in jsonObj)
link.title = jsonObj["title"];
if ("type" in jsonObj)
link.type = jsonObj["type"];
if ("hreflang" in jsonObj)
link.hreflang = jsonObj["hreflang"];
return link;
};
return Link;
}());
var _3DContainer = /** @class */ (function () {
function _3DContainer() {
}
_3DContainer.fromJson = function (jsonObj) {
var _a;
validateRequiredFields(jsonObj, ["id", "extent", "links"], _3DContainer.name);
var container = new _3DContainer();
container.id = jsonObj["id"];
container.title = jsonObj["title"];
container.description = jsonObj["description"];
container.collectionType = jsonObj["collectionType"];
container.itemType = jsonObj["itemType"];
container.extent = Extent.fromJson(jsonObj["extent"]);
if (jsonObj.hasOwnProperty("contentExtent"))
container.contentExtent = BoundingVolume.fromJson(jsonObj["contentExtent"]);
container.crs = jsonObj["crs"];
container.links = jsonObj["links"].map(Link.fromJson);
container.children = (_a = jsonObj["children"]) === null || _a === void 0 ? void 0 : _a.map(_3DContainer.fromJson);
container.content = jsonObj["content"].map(Link.fromJson);
return container;
};
return _3DContainer;
}());
var Collections = /** @class */ (function () {
function Collections() {
}
Collections.fromJson = function (jsonObj) {
var _a, _b;
var collections = new Collections();
collections.links = (_a = jsonObj["links"]) === null || _a === void 0 ? void 0 : _a.map(Link.fromJson);
collections.collections = (_b = jsonObj["collections"]) === null || _b === void 0 ? void 0 : _b.map(_3DContainer.fromJson);
return collections;
};
return Collections;
}());
var Conformance = /** @class */ (function () {
function Conformance() {
}
Conformance.fromJson = function (jsonObj) {
validateRequiredFields(jsonObj, ["conformsTo"], Conformance.name);
var conformance = new Conformance();
conformance.conformsTo = jsonObj["conformsTo"];
return conformance;
};
return Conformance;
}());
var LandingPage = /** @class */ (function () {
function LandingPage() {
}
LandingPage.fromJson = function (jsonObj) {
validateRequiredFields(jsonObj, ["links"], LandingPage.name);
var landingPage = new LandingPage();
landingPage.title = jsonObj["title"];
landingPage.description = jsonObj["description"];
landingPage.links = jsonObj["links"].map(Link.fromJson);
return landingPage;
};
return LandingPage;
}());
var RelationshipLink;
(function (RelationshipLink) {
RelationshipLink[RelationshipLink["affinemap"] = 0] = "affinemap";
RelationshipLink[RelationshipLink["alternate"] = 1] = "alternate";
RelationshipLink[RelationshipLink["collection"] = 2] = "collection";
RelationshipLink[RelationshipLink["conformance"] = 3] = "conformance";
RelationshipLink[RelationshipLink["data"] = 4] = "data";
RelationshipLink[RelationshipLink["dataset"] = 5] = "dataset";
RelationshipLink[RelationshipLink["describedBy"] = 6] = "describedBy";
RelationshipLink[RelationshipLink["distribution"] = 7] = "distribution";
RelationshipLink[RelationshipLink["item"] = 8] = "item";
RelationshipLink[RelationshipLink["items"] = 9] = "items";
RelationshipLink[RelationshipLink["original"] = 10] = "original";
RelationshipLink[RelationshipLink["parent"] = 11] = "parent";
RelationshipLink[RelationshipLink["root"] = 12] = "root";
RelationshipLink[RelationshipLink["scheme"] = 13] = "scheme";
RelationshipLink[RelationshipLink["self"] = 14] = "self";
RelationshipLink[RelationshipLink["service"] = 15] = "service";
RelationshipLink[RelationshipLink["service-desc"] = 16] = "service-desc";
})(RelationshipLink || (RelationshipLink = {}));
var Root = /** @class */ (function () {
function Root() {
}
return Root;
}());
export { BoundingVolume, Collections, Conformance, Exception, ExceptionCode, Extent, LandingPage, Link, RelationshipLink, Root, SpatialExtent, TemporalExtent, _3DContainer };
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var Exception = /** @class */ (function (_super) {
__extends(Exception, _super);
function Exception(code, description) {
var _this = _super.call(this, description) || this;
_this.name = "OGC_Exception";
_this.code = code;
_this.description = description;
return _this;
}
return Exception;
}(Error));
(function (ExceptionCode) {
ExceptionCode["MISSING_REQUIRED_FIELD"] = "MISSING_REQUIRED_FIELD";
})(exports.ExceptionCode || (exports.ExceptionCode = {}));
function validateRequiredFields(obj, fields, className) {
fields.forEach(function (field) {
if (!obj.hasOwnProperty(field))
throw new Exception(exports.ExceptionCode.MISSING_REQUIRED_FIELD, "Missing field " + field + (className ? " from " + className : ''));
});
}
var SpatialExtent = /** @class */ (function () {
function SpatialExtent() {
}
SpatialExtent.fromJson = function (jsonObj) {
validateRequiredFields(jsonObj, ["bbox"], SpatialExtent.name);
var spatialExtent = new SpatialExtent();
spatialExtent.crs = jsonObj["crs"];
spatialExtent.bbox = jsonObj["bbox"];
return spatialExtent;
};
return SpatialExtent;
}());
var TemporalExtent = /** @class */ (function () {
function TemporalExtent() {
}
TemporalExtent.fromJson = function (jsonObj) {
var temporalExtent = new TemporalExtent();
temporalExtent.trs = jsonObj["trs"];
temporalExtent.interval = jsonObj["interval"];
return temporalExtent;
};
return TemporalExtent;
}());
var Extent = /** @class */ (function () {
function Extent() {
}
Extent.fromJson = function (jsonObj) {
validateRequiredFields(jsonObj, ["spatial"], Extent.name);
var extent = new Extent();
extent.spatial = SpatialExtent.fromJson(jsonObj["spatial"]);
if (jsonObj.hasOwnProperty("temporal"))
extent.temporal = TemporalExtent.fromJson(jsonObj["temporal"]);
return extent;
};
return Extent;
}());
var BoundingVolume = /** @class */ (function () {
function BoundingVolume() {
}
BoundingVolume.fromJson = function (jsonObj) {
var boundingVolume = new BoundingVolume();
boundingVolume.box = jsonObj["box"];
boundingVolume.region = jsonObj["region"];
boundingVolume.sphere = jsonObj["sphere"];
return boundingVolume;
};
return BoundingVolume;
}());
var Link = /** @class */ (function () {
function Link() {
}
Link.fromJson = function (jsonObj) {
validateRequiredFields(jsonObj, ["href", "rel"], Link.name);
var link = new Link();
link.href = jsonObj["href"];
link.rel = jsonObj["rel"];
if ("title" in jsonObj)
link.title = jsonObj["title"];
if ("type" in jsonObj)
link.type = jsonObj["type"];
if ("hreflang" in jsonObj)
link.hreflang = jsonObj["hreflang"];
return link;
};
return Link;
}());
var _3DContainer = /** @class */ (function () {
function _3DContainer() {
}
_3DContainer.fromJson = function (jsonObj) {
var _a;
validateRequiredFields(jsonObj, ["id", "extent", "links"], _3DContainer.name);
var container = new _3DContainer();
container.id = jsonObj["id"];
container.title = jsonObj["title"];
container.description = jsonObj["description"];
container.collectionType = jsonObj["collectionType"];
container.itemType = jsonObj["itemType"];
container.extent = Extent.fromJson(jsonObj["extent"]);
if (jsonObj.hasOwnProperty("contentExtent"))
container.contentExtent = BoundingVolume.fromJson(jsonObj["contentExtent"]);
container.crs = jsonObj["crs"];
container.links = jsonObj["links"].map(Link.fromJson);
container.children = (_a = jsonObj["children"]) === null || _a === void 0 ? void 0 : _a.map(_3DContainer.fromJson);
container.content = jsonObj["content"].map(Link.fromJson);
return container;
};
return _3DContainer;
}());
var Collections = /** @class */ (function () {
function Collections() {
}
Collections.fromJson = function (jsonObj) {
var _a, _b;
var collections = new Collections();
collections.links = (_a = jsonObj["links"]) === null || _a === void 0 ? void 0 : _a.map(Link.fromJson);
collections.collections = (_b = jsonObj["collections"]) === null || _b === void 0 ? void 0 : _b.map(_3DContainer.fromJson);
return collections;
};
return Collections;
}());
var Conformance = /** @class */ (function () {
function Conformance() {
}
Conformance.fromJson = function (jsonObj) {
validateRequiredFields(jsonObj, ["conformsTo"], Conformance.name);
var conformance = new Conformance();
conformance.conformsTo = jsonObj["conformsTo"];
return conformance;
};
return Conformance;
}());
var LandingPage = /** @class */ (function () {
function LandingPage() {
}
LandingPage.fromJson = function (jsonObj) {
validateRequiredFields(jsonObj, ["links"], LandingPage.name);
var landingPage = new LandingPage();
landingPage.title = jsonObj["title"];
landingPage.description = jsonObj["description"];
landingPage.links = jsonObj["links"].map(Link.fromJson);
return landingPage;
};
return LandingPage;
}());
(function (RelationshipLink) {
RelationshipLink[RelationshipLink["affinemap"] = 0] = "affinemap";
RelationshipLink[RelationshipLink["alternate"] = 1] = "alternate";
RelationshipLink[RelationshipLink["collection"] = 2] = "collection";
RelationshipLink[RelationshipLink["conformance"] = 3] = "conformance";
RelationshipLink[RelationshipLink["data"] = 4] = "data";
RelationshipLink[RelationshipLink["dataset"] = 5] = "dataset";
RelationshipLink[RelationshipLink["describedBy"] = 6] = "describedBy";
RelationshipLink[RelationshipLink["distribution"] = 7] = "distribution";
RelationshipLink[RelationshipLink["item"] = 8] = "item";
RelationshipLink[RelationshipLink["items"] = 9] = "items";
RelationshipLink[RelationshipLink["original"] = 10] = "original";
RelationshipLink[RelationshipLink["parent"] = 11] = "parent";
RelationshipLink[RelationshipLink["root"] = 12] = "root";
RelationshipLink[RelationshipLink["scheme"] = 13] = "scheme";
RelationshipLink[RelationshipLink["self"] = 14] = "self";
RelationshipLink[RelationshipLink["service"] = 15] = "service";
RelationshipLink[RelationshipLink["service-desc"] = 16] = "service-desc";
})(exports.RelationshipLink || (exports.RelationshipLink = {}));
var Root = /** @class */ (function () {
function Root() {
}
return Root;
}());
exports.BoundingVolume = BoundingVolume;
exports.Collections = Collections;
exports.Conformance = Conformance;
exports.Exception = Exception;
exports.Extent = Extent;
exports.LandingPage = LandingPage;
exports.Link = Link;
exports.Root = Root;
exports.SpatialExtent = SpatialExtent;
exports.TemporalExtent = TemporalExtent;
exports._3DContainer = _3DContainer;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment