npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

js-airspace-db-client

v2.8.1

Published

AirMap Airspace Data DB Client

Downloads

1

Readme

js-airspace-db-client

Description

Javascript client for the v2 airspace database.

Installation

http://pkg.airmap.com:7777/package/js-airspace-db-client/latest

Usage

Create a client:

    let client = new Client({
        database_uri: 'postgres://localhost:5432/airspace'
    }

The database connection pool is all set up. You can just start using the various query functions available.

API Specification

constructor

Create a new airspace data client.

Parameters

  • config Object client configuration settings
    • config.database_uri string database connection URI

Returns Client

airspace

Airspace functions

status

Status functions Instance of AirspaceClient

rules

Functions pertaining to rules and regulations from the Airspace Database.

airspace_advisory

Function to retrieve advisories from the airspace db

AirspaceClient

Extends BaseClient

This is a class for a specific database queries.

findByGroupId

Search the airspace table for the geometry that has the specified group_geo_uuid.

Parameters

  • uuid uuid The group_geo_uuid

Returns array return the airspace object

findByIndividualId

Search the airspace table for the geometry that has the specified airmap_uuid.

Parameters

  • uuid uuid The airmap_uuid

Returns array return the airspace object

search

Searches for airspace objects that match the supplied filters.

Parameters

  • filters object Filters that a user can search the airspace table on.

Returns Array<Promise.object> List of airspace objects.

getMultipleIds

getMultipleIds - Retreives airspace data for the following airmap_uuid's.

Parameters

  • ids Array<string> An array of uuids to retreive airspace data for.

Returns Array<Promise.object> description

getAvailableCountries

getAvailableCountries - Returns an array of available ISO 3166-1 alpha-3 countries in the database.

Returns Array<Promise.string> Array of country codes

getMid

getMid - Retreives the name, latitude, longitide, and metadata for a given managed object ID.

Parameters

Returns Array<Promise<object>>

getIdentifier

getIdentifier - Retreive the name and metadata for a given geo_object_id. This is used to get the Airport Identifier for generating an airport managed object ID.

Parameters

  • geo_object_id number Serial id for the geo_object in the airspace DB.

Returns Promise<object> geo object data

getMidById

getMidById - Retreive the mid and name for a given geo_object_id.

Parameters

  • geo_object_id number Serial id for the geo_object in the airspace DB.

Returns Promise<object> mid metadata

getIntersectingMIDs

getIntersectingMIDs - Retrieve the intersecting enabled and active MIDs.

Parameters

  • geometry as a GeoJSON string

Returns Promise<Array<String>>

getTemporalLayers

Query Airspace for temporal ruleset layers. Layers are not validated to ensure they are truly temporal. This is used by api-tile-data.

Parameters

  • ruleset string ruleset id.
  • layers Array<string> Array of layers.
  • tile Object bounding box of form [xMin, yMin, xMax, yMax]

Returns Array<Object>

getAdvisoriesByPolygon

getAirspaceByPolygon - Get status from a buffered path.

Parameters

  • lat float Float between -90 and 90
  • lng float Float between -180 and 180
  • polygon geojson Geometry to intersect
  • filters object types, ignored_types, and datetime filters.

Returns Promise Result

StatusClient

Extends BaseClient

This is a class for a specific database queries.

getStatusByPoint

getStatusByPoint - Get status around a point given a supplied buffer.

Parameters

  • lat float Float between -90 and 90
  • lng float Float between -180 and 180
  • buffer float buffer in meters
  • filters object types, ignored_types, and datetime filters.

Returns Promise The result

getStatusByPath

getStatusByPath - Get status from a buffered path.

Parameters

  • lat float Float between -90 and 90
  • lng float Float between -180 and 180
  • path geojson Linestring path.
  • buffer float Buffer in meters
  • filters object types, ignored_types, and datetime filters.

Returns Promise Result

getStatusByPolygon

getStatusByPath - Get status from a buffered path.

Parameters

  • lat float Float between -90 and 90
  • lng float Float between -180 and 180
  • polygon geojson Geometry to intersect
  • filters object types, ignored_types, and datetime filters.

Returns Promise Result

welcome

Retrieves all welcome summaries that intersect with as given latitude/longitude pair.

Parameters

Returns Array<Promise.object> array of intersecting jurisdictions

_getRulesetQuery

Returns a base query for selecting relevant fields for rulesets. It omits ruleset-selecting where clauses, so that this query can be customized.

Because rules and rulesets can contain multiple predicates, this query joins predicates on rules and rules on rulesets to guarantee that all of the information is returned. The data is parsed and consolidated in the API layer.

searchRulesets

Retrieves rules that apply within a specific location.

Because rules and rulesets can contain multiple predicates, this query joins predicates on rules and rules on rulesets to guarantee that all of the information is returned. The data is parsed and consolidated in the API layer.

Parameters

  • geometry object geoJSON object

Returns Array<Promise.object>

getRulesetById

Retrieves a single ruleset.

Duplicate values for rules may be generated by the inner join because a rule can have multiple flight_features attached. The data is oarsed and consolidated the Rules API.

Parameters

  • ruleset_id string ruleset unique IDs

Returns Array<Promise.object> array of rules

getRulesByRulesetIds

Retreives all rules that are a part of the given rulesets. Duplicate values for rules may be generated by the inner join because a rule can have multiple flight_features attached. The data is parsed and consolidated in the Rules API.

Parameters

Returns Array<Promise.object> array of rules

_getUnmatchedTextRulesQuery

Base query for fetching unmatched text rules from ordinance_rule_display_text. Omits the where clause to be added as needed.

getUnmatchedTextRules

Retrieves "text-only" rules that apply to a given location. These are rules that exist in ordinance_rule_display_text and do not have a matching ordinance_rule.

Parameters

  • geometry object geoJSON object

Returns Array<Promise.object>

getUnmatchedTextRulesByUids

Retrieves "text-only" rules for a list of rulesets. These are rules that exist in ordinance_rule_display_text and do not have a matching ordinance_rule.

Parameters

  • ruleset_uids Array<string> an array containing ruleset uids

Returns Array<Promise.object>