KMLCompanion

com.phasmidsoftware.xmldoc.kml.KMLCompanion
object KMLCompanion

Companion helper object for the KML class. Provides utility methods for loading, rendering, and manipulating KML objects and their features.

CONSIDER merging this with object KML. NOTE that this object depends on cats effect IO.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def loadKML(resource: URL): IO[Seq[KML]]

Loads KML content from the specified resource URL, processes it, and returns a sequence of KML objects.

Loads KML content from the specified resource URL, processes it, and returns a sequence of KML objects.

Value parameters

resource

the URL pointing to the KML resource to be loaded.

Attributes

Returns

an IO action that yields a sequence of KML objects when executed.

def loadKML(triedFilename: Try[String]): IO[Seq[KML]]

Loads a KML file from the given filename encapsulated in a Try. If the filename is valid, the method reads and processes the KML content.

Loads a KML file from the given filename encapsulated in a Try. If the filename is valid, the method reads and processes the KML content.

Value parameters

triedFilename

a Try-wrapped string representing the filename of the KML file to be loaded.

Attributes

Returns

an IO action that, when executed, yields a sequence of KML objects.

def renderKMLAsFormat(resourceName: String, format: Format): IO[Seq[String]]

Renders KML content from a specified resource and applies the given format, returning the results as a sequence of strings.

Renders KML content from a specified resource and applies the given format, returning the results as a sequence of strings.

Value parameters

format

the format to be applied to the KML content.

resourceName

the name of the resource containing the KML content to be rendered.

Attributes

Returns

an IO action that yields a sequence of formatted strings when executed.

def renderKMLToPrintStream(resourceName: String, format: Format, printStream: PrintStream = ...): IO[Unit]

Renders KML content from the specified resource, formats it according to the provided format, and writes the output to the given PrintStream.

Renders KML content from the specified resource, formats it according to the provided format, and writes the output to the given PrintStream.

Value parameters

format

the format to be applied to the KML content.

printStream

the output PrintStream where the formatted content will be written. Defaults to System.out.

resourceName

the name of the resource containing the KML content to be rendered.

Attributes

Returns

an IO action that, when executed, performs the rendering and output operation.

def renderKMLs(ks: Seq[KML], format: Format): IO[Seq[String]]

Note that this mechanism won't work if, as we wouldn't expect, there is more than one KML element.

Note that this mechanism won't work if, as we wouldn't expect, there is more than one KML element.

Value parameters

format

the desired format.

ks

the KML elements.

Attributes

Returns

a Seq[String] wrapped in IO.

Concrete fields

val logger: Logger