Options
All
  • Public
  • Public/Protected
  • All
Menu

Class KMLToGeoPackage

Convert KML file to GeoPackages.

Hierarchy

  • KMLToGeoPackage

Index

Constructors

constructor

Properties

hasMultiGeometry

hasMultiGeometry: boolean

hasStyles

hasStyles: boolean

iconMap

iconMap: Map<string, object>

iconMapPair

iconMapPair: Map<string, string>

iconRowMap

iconRowMap: Map<number, any>

iconUrlMap

iconUrlMap: Map<string, number>

numberOfGroundOverLays

numberOfGroundOverLays: number

numberOfPlacemarks

numberOfPlacemarks: number

properties

properties: Set<string>

styleMap

styleMap: Map<string, object>

styleMapPair

styleMapPair: Map<string, string>

styleRowMap

styleRowMap: Map<number, any>

styleUrlMap

styleUrlMap: Map<string, number>

zipFileMap

zipFileMap: Map<string, any>

Methods

_calculateTrueExtentForFeatureTable

  • _calculateTrueExtentForFeatureTable(gp: any, tableName: any): Array<number>
  • Parameters

    • gp: any
    • tableName: any

    Returns Array<number>

_updateBoundingBoxForFeatureTable

  • _updateBoundingBoxForFeatureTable(gp: any, tableName: any): void
  • Parameters

    • gp: any
    • tableName: any

    Returns void

addKMLDataToGeoPackage

  • addKMLDataToGeoPackage(kmlData: PathLike | Uint8Array, geopackage: GeoPackage, defaultStyles: FeatureTableStyles, tableName: string, progressCallback?: Function): Promise<void>
  • Reads the KML file and extracts Geometric data and matches styles with the Geometric data. Also read the Ground Overlays.

    memberof

    KMLToGeoPackage

    Parameters

    • kmlData: PathLike | Uint8Array

      Path to KML file or KML Data

    • geopackage: GeoPackage

      GeoPackage instance

    • defaultStyles: FeatureTableStyles

      Feature Table Style Object

    • tableName: string

      Name of Main table for Geometry

    • Optional progressCallback: Function

    Returns Promise<void>

convert

  • Converts KML and KMZ to GeoPackages.

    Parameters

    Returns Promise<GeoPackage>

convertKMLOrKMZToGeopackage

  • convertKMLOrKMZToGeopackage(kmlOrKmzPath: PathLike, isKMZ?: boolean, geopackage?: GeoPackage | string, tableName?: string, kmlOrKmzData?: Uint8Array | null, progressCallback?: Function): Promise<GeoPackage>
  • Determines the function calls depending on the type of file and the environment it is in

    memberof

    KMLToGeoPackage

    Parameters

    • kmlOrKmzPath: PathLike
    • Optional isKMZ: boolean
    • Optional geopackage: GeoPackage | string
    • Optional tableName: string
    • Optional kmlOrKmzData: Uint8Array | null
    • Optional progressCallback: Function

    Returns Promise<GeoPackage>

    Promise of a GeoPackage

convertKMLToGeoPackage

  • convertKMLToGeoPackage(kmlData: PathLike | Uint8Array, geopackage: GeoPackage | string, tableName: string, progressCallback?: Function): Promise<GeoPackage>
  • Takes a KML file and does a 2 pass method to exact the features and styles and inserts those item properly into a geopackage.

    memberof

    KMLToGeoPackage

    Parameters

    • kmlData: PathLike | Uint8Array

      Path to KML file or Data of KML file

    • geopackage: GeoPackage | string

      String name or instance of Geopackage to use

    • tableName: string

      Name of table with geometry

    • Optional progressCallback: Function

    Returns Promise<GeoPackage>

    Promise of a Geopackage

convertKMZToGeoPackage

  • convertKMZToGeoPackage(kmzData: PathLike | Uint8Array, geopackage: GeoPackage | string, tableName: string, progressCallback?: Function): Promise<GeoPackage>
  • Unzips and stores data from a KMZ file in the current directory or in a Map

    memberof

    KMLToGeoPackage

    Parameters

    • kmzData: PathLike | Uint8Array

      Path to KMZ file or Data of the KMZ file

    • geopackage: GeoPackage | string

      String or instance of Geopackage to use

    • tableName: string

      Name of the main Geometry Table

    • Optional progressCallback: Function

    Returns Promise<GeoPackage>

    Promise of a GeoPackage

createOrOpenGeoPackage

  • createOrOpenGeoPackage(geopackage: GeoPackage | string, options: KMLConverterOptions, progressCallback?: Function): Promise<GeoPackage>
  • Determines whether to create a new file or open an existing file.

    memberof

    KMLUtilities

    Parameters

    • geopackage: GeoPackage | string

      String Name or instance of a GeoPackage

    • options: KMLConverterOptions
    • Optional progressCallback: Function

    Returns Promise<GeoPackage>

    Promise of a GeoPackage

downloadFile

  • downloadFile(fileUrl: string, outputLocationPath: string): Promise<unknown>
  • Parameters

    • fileUrl: string
    • outputLocationPath: string

    Returns Promise<unknown>

getMetaDataKML

  • getMetaDataKML(kmlData: PathLike | Uint8Array, geopackage?: GeoPackage, progressCallback?: Function): Promise<object>
  • Runs through KML and finds name for Columns and Style information. Handles Networks Links. Handles Bounding Boxes

    memberof

    KMLToGeoPackage

    Parameters

    • kmlData: PathLike | Uint8Array

      Path to KML File or KML Data

    • Optional geopackage: GeoPackage
    • Optional progressCallback: Function

    Returns Promise<object>

    } Object of the set of property name and the total Bounding Box

setUpStyleKML

  • setUpStyleKML(geopackage: GeoPackage, tableName: string, progressCallback?: Function): Promise<FeatureTableStyles>
  • Inserts style information from the KML in the GeoPackage.

    memberof

    KMLToGeoPackage

    Parameters

    • geopackage: GeoPackage

      Geopackage instance of

    • tableName: string

      Name of Main Table

    • Optional progressCallback: Function

    Returns Promise<FeatureTableStyles>

    Promise of a Feature Table of Styles

setUpTableKML

  • setUpTableKML(tableName: string, geopackage: GeoPackage, properties: Set<string>, boundingBox: BoundingBox, progressCallback?: Function): Promise<GeoPackage>
  • Takes in KML and the properties of the KML and creates a table in the geopackage folder.

    Parameters

    • tableName: string

      name the Database table will be called

    • geopackage: GeoPackage

      file name or GeoPackage object

    • properties: Set<string>

      columns name gotten from getMetaDataKML

    • boundingBox: BoundingBox
    • Optional progressCallback: Function

      Passed the current status of the function.

    Returns Promise<GeoPackage>

    Promise of a GeoPackage

Generated using TypeDoc