You are here

interface WktGeneratorInterface in Geofield 8

Defines an interface for WktGenerator.

Hierarchy

Expanded class hierarchy of WktGeneratorInterface

All classes that implement WktGeneratorInterface

3 files declare their use of WktGeneratorInterface
GeofieldBaseWidget.php in src/Plugin/Field/FieldWidget/GeofieldBaseWidget.php
GeofieldLatLon.php in src/Plugin/migrate/process/GeofieldLatLon.php
GeofieldWKT.php in src/Plugin/migrate/process/GeofieldWKT.php

File

src/WktGeneratorInterface.php, line 8

Namespace

Drupal\geofield
View source
interface WktGeneratorInterface {

  /**
   * Helper to generate a random WKT string.
   *
   * Try to keeps values sane, no shape is more than 100km across.
   *
   * @return string
   *   The random WKT value.
   */
  public function wktGenerateGeometry();

  /**
   * Returns a WKT format point feature given a point.
   *
   * @param array $point
   *   The point coordinates.
   *
   * @return string
   *   The WKT point feature.
   */
  public function wktBuildPoint(array $point);

  /**
   * Returns a WKT format point feature.
   *
   * @param array $point
   *   A Lon Lat array. By default create a random pair.
   *
   * @return string
   *   The WKT point feature.
   */
  public function wktGeneratePoint(array $point = NULL);

  /**
   * Returns a WKT format multipoint feature.
   *
   * @return string
   *   The WKT multipoint feature.
   */
  public function wktGenerateMultipoint();

  /**
   * Returns a WKT format linestring feature given an array of points.
   *
   * @param array $points
   *   The linestring components.
   *
   * @return string
   *   The WKT linestring feature.
   */
  public function wktBuildLinestring(array $points);

  /**
   * Returns a WKT format linestring feature.
   *
   * @param array $start
   *   The starting point. If not provided, will be randomly generated.
   * @param int $segments
   *   Number of segments. If not provided, will be randomly generated.
   *
   * @return string
   *   The WKT linestring feature.
   */
  public function wktGenerateLinestring(array $start = NULL, $segments = NULL);

  /**
   * Returns a WKT format multilinestring feature.
   *
   * @return string
   *   The WKT multilinestring feature.
   */
  public function wktGenerateMultilinestring();

  /**
   * Returns a WKT format polygon feature given an array of points.
   *
   * @param array $points
   *   The polygon components.
   *
   * @return string
   *   The WKT polygon feature.
   */
  public function wktBuildPolygon(array $points);

  /**
   * Returns a WKT format polygon feature.
   *
   * @param array $start
   *   The starting point. If not provided, will be randomly generated.
   * @param int $segments
   *   Number of segments. If not provided, will be randomly generated.
   *
   * @return string
   *   The WKT polygon feature.
   */
  public function wktGeneratePolygon(array $start = NULL, $segments = NULL);

  /**
   * Returns a WKT format multipolygon feature given an array of polygon points.
   *
   * @param array $rings
   *   The array of polygon arrays.
   *
   * @return string
   *   The WKT multipolygon feature.
   */
  public function wktBuildMultipolygon(array $rings);

  /**
   * Returns a WKT format multipolygon feature.
   *
   * @return string
   *   The WKT multipolygon feature.
   */
  public function wktGenerateMultipolygon();

}

Members

Namesort descending Modifiers Type Description Overrides
WktGeneratorInterface::wktBuildLinestring public function Returns a WKT format linestring feature given an array of points. 1
WktGeneratorInterface::wktBuildMultipolygon public function Returns a WKT format multipolygon feature given an array of polygon points. 1
WktGeneratorInterface::wktBuildPoint public function Returns a WKT format point feature given a point. 1
WktGeneratorInterface::wktBuildPolygon public function Returns a WKT format polygon feature given an array of points. 1
WktGeneratorInterface::wktGenerateGeometry public function Helper to generate a random WKT string. 1
WktGeneratorInterface::wktGenerateLinestring public function Returns a WKT format linestring feature. 1
WktGeneratorInterface::wktGenerateMultilinestring public function Returns a WKT format multilinestring feature. 1
WktGeneratorInterface::wktGenerateMultipoint public function Returns a WKT format multipoint feature. 1
WktGeneratorInterface::wktGenerateMultipolygon public function Returns a WKT format multipolygon feature. 1
WktGeneratorInterface::wktGeneratePoint public function Returns a WKT format point feature. 1
WktGeneratorInterface::wktGeneratePolygon public function Returns a WKT format polygon feature. 1