Options
All
  • Public
  • Public/Protected
  • All
Menu

Class KMLUtilities

Function directly related the processing of parsed kml data

export
class

KMLUtilities

Hierarchy

  • KMLUtilities

Index

Methods

Static abgrStringToColorOpacity

  • abgrStringToColorOpacity(abgr: string): object
  • Converts the KML Color format into rgb 000000 - FFFFFF and opacity 0.0 - 1.0

    static
    memberof

    KMLUtilities

    Parameters

    • abgr: string

      KML Color format AABBGGRR alpha (00-FF) blue (00-FF) green (00-FF) red (00-FF)

    Returns object

    • a: number
    • rgb: string

Static addSpecificIcon

  • addSpecificIcon(styleTable: FeatureTableStyles, item: [string, object], zipFileMap: Map<string, any>): Promise<object>
  • Adds an Icon into the Database

    static
    memberof

    KMLUtilities

    Parameters

    • styleTable: FeatureTableStyles

      Database Object for the style

    • item: [string, object]

      The id from KML and the object data from KML

    • zipFileMap: Map<string, any>

    Returns Promise<object>

    }

Static getLatLonBBox

  • getLatLonBBox(node: any): BoundingBox
  • Converts node that contains a LatLonBox tag into a geopackage Bounding box

    static
    memberof

    KMLUtilities

    Parameters

    • node: any

      node from KML

    Returns BoundingBox

    Geopackage Bounding box.

Static handleGroundOverLay

  • handleGroundOverLay(node: any, geopackage: GeoPackage, image: Jimp, progressCallback?: Function): Promise<void>
  • Converts KML Ground Overlay into appropriate tile sets.

    static
    memberof

    KMLUtilities

    Parameters

    • node: any

      Ground Overlay KML node

    • geopackage: GeoPackage
    • image: Jimp
    • Optional progressCallback: Function

    Returns Promise<void>

Static insertIconImageData

  • insertIconImageData(jimpImage: Jimp, newIcon: any, styleTable: FeatureTableStyles, anchorU?: number, anchorV?: number): Promise<number>
  • Converts Item into a data URL and adds it and information about to the database.

    static
    memberof

    KMLUtilities

    Parameters

    • jimpImage: Jimp
    • newIcon: any
    • styleTable: FeatureTableStyles
    • Default value anchorU: number = 0.5
    • Default value anchorV: number = 0.5

    Returns Promise<number>

Static kmlLineStringToGeoJson

  • kmlLineStringToGeoJson(node: any[]): object
  • Takes in a KML parsed LineString and returns a GeoJSON formatted object.

    static
    memberof

    KMLUtilities

    Parameters

    • node: any[]

      The data from xmlStream with the selector of Placemark.

    Returns object

    • coordinates: number[]
    • type: string

Static kmlPointToGeoJson

  • kmlPointToGeoJson(node: any[]): object
  • Takes in a KML parsed Point and returns a GeoJSON formatted object.

    static
    memberof

    KMLUtilities

    Parameters

    • node: any[]

      The data from xmlStream with the selector of Placemark.

    Returns object

    • coordinates: number[]
    • type: string

Static kmlPolygonToGeoJson

  • kmlPolygonToGeoJson(node: Array<any>): object
  • Takes in a KML parsed Polygon and returns a GeoJSON formatted object.

    static
    memberof

    KMLUtilities

    Parameters

    • node: Array<any>

      The data from xmlStream with the selector of Placemark.

    Returns object

    • coordinates: number[][][]
    • type: string

Static kmlToGeoJSON

  • kmlToGeoJSON(node: any): any
  • Converts kml geometries (Point, LineString, and Polygon) into GeoJSON features

    static
    memberof

    KMLUtilities

    Parameters

    • node: any

      KML parsed Placemark node

    Returns any

Static setUpGeometryNodes

  • setUpGeometryNodes(node: any, progressCallback?: Function): any[]
  • Creates a list of node that need to be processed.

    static
    memberof

    KMLUtilities

    Parameters

    • node: any

      Placemark Node from kml via xml-stream

    • Optional progressCallback: Function

    Returns any[]

Static setUpKMLDefaultStylesAndIcons

  • setUpKMLDefaultStylesAndIcons(geopackage: GeoPackage, tableName: string, progressCallback?: Function): Promise<FeatureTableStyles>
  • Provides default styles and Icons for the Geometry table. Currently set to White to match google earth. Icon set to yellow pushpin google earth default.

    static
    memberof

    KMLUtilities

    Parameters

    • geopackage: GeoPackage
    • tableName: string

      Name of the Main Geometry table

    • Optional progressCallback: Function

    Returns Promise<FeatureTableStyles>

Static writeMultiGeometry

  • writeMultiGeometry(geometryIds: any[], geopackage: GeoPackage, multiGeometryTableName: string, relatedTableExtension: RelatedTablesExtension, multiGeometryMapName: string): void
  • Writes and maps MultiGeometries into the database

    static
    memberof

    KMLUtilities

    Parameters

    • geometryIds: any[]

      List of Ids for the item in the Multi geometry

    • geopackage: GeoPackage

      Geopackage Database

    • multiGeometryTableName: string

      Name on the table that stores the id of the MultiGeometry

    • relatedTableExtension: RelatedTablesExtension

      Used to connect tables.

    • multiGeometryMapName: string

      Cross reference table (map) between the Geometry table and the MultiGeometry Table

    Returns void

Generated using TypeDoc