class GeoJSON::LineString

Overview

A LineString is a Geometry representing two or more points in geographic space connected consecutively by lines.

This class corresponds to the GeoJSON LineString.

Defined in:

geojson/line_string.cr

Constructors

Instance Method Summary

Instance methods inherited from class GeoJSON::Object

bbox bbox, type : String type

Constructor methods inherited from class GeoJSON::Object

new(pull : JSON::PullParser) new

Constructor Detail

def self.new(pull : JSON::PullParser) #

A LineString is a Geometry representing two or more points in geographic space connected consecutively by lines.

This class corresponds to the GeoJSON LineString.


def self.new(coordinates : Array(Coordinates), *, bbox = nil) #

Create a new LineString with the given coordinates and optional bounding box bbox.


def self.new(coordinates : Array(Point), *, bbox = nil) #

Create a new LineString with the given coordinates and optional bounding box bbox.


def self.new(coordinates : Array(Array(Float64)), *, bbox = nil) #

Create a new LineString with the given coordinates and optional bounding box bbox.


Instance Method Detail

def [](*args, **options) #

Gets the LineString vertex at the given index.


def [](*args, **options, &) #

Gets the LineString vertex at the given index.


def bbox #
Description copied from class GeoJSON::Object

Calculates the bounding box for any GeoJSON object, including FeatureCollection.


def coordinates : Array(Coordinates) #

Gets this LineString's GeoJSON type ("LineString")


def type : String #

Gets this LineString's GeoJSON type ("LineString")