Module: CartoJson

Defined in:
lib/carto_json/wkt_parser.rb,
lib/carto_json.rb,
lib/carto_json/point.rb,
lib/carto_json/shape.rb,
lib/carto_json/utils.rb,
lib/carto_json/circle.rb,
lib/carto_json/errors.rb,
lib/carto_json/parser.rb,
lib/carto_json/polygon.rb,
lib/carto_json/version.rb,
lib/carto_json/rectangle.rb,
lib/carto_json/line_string.rb

Overview

TODO: Write in a real parsing library like Parslet, finish multi type support

Defined Under Namespace

Modules: Shape, Utils Classes: Circle, Error, InputError, InsufficientPointsError, InvalidRadiusError, InvalidTypeError, LineString, NotImplementedError, Parser, Point, Polygon, Rectangle, WKTParser

Constant Summary collapse

PRIMITIVE_TYPES =
[:circle, :point, :linestring, :polygon, :rectangle]
MULTI_TYPES =
[:multipoint, :multilinestring, :multipolygon]
TYPES =
PRIMITIVE_TYPES+MULTI_TYPES
LAT =

These might change, so I’ve made it easier to switch.

:lat.freeze
LNG =
:lng.freeze
VERSION =
"0.0.9"

Class Method Summary collapse

Class Method Details

.parse(input) ⇒ Object



11
12
13
# File 'lib/carto_json.rb', line 11

def parse(input)
  Parser.parse input
end

.parse_wkt(input) ⇒ Object



15
16
17
# File 'lib/carto_json.rb', line 15

def parse_wkt(input)
  WKTParser.parse input
end