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.


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

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


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

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


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

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


[View source]

Instance Method Detail

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

Gets the LineString vertex at the given index.


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

Gets the LineString vertex at the given index.


[View source]
def bbox #
Description copied from class GeoJSON::Object

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


[View source]
def coordinates : Array(Coordinates) #

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


[View source]
def type : String #

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


[View source]