2017 © Pedro Peláez
 

library geo-parser

Parser for geography coordinate strings

image

creof/geo-parser

Parser for geography coordinate strings

  • Tuesday, May 3, 2016
  • by djlambert
  • Repository
  • 2 Watchers
  • 17 Stars
  • 359,563 Installations
  • PHP
  • 5 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 14 Versions
  • 12 % Grown

The README.md

creof/geo-parser

Code Climate Test Coverage Build Status, (*1)

Lexer and parser library for geometric and geographic point string values., (*2)

Usage

There are two use patterns for the parser. The value to be parsed can be passed into the constructor, then parse() called on the returned Parser object:, (*3)

$input  = '79°56′55″W, 40°26′46″N';

$parser = new Parser($input);

$value = $parser->parse();

If many values need to be parsed, a single Parser instance can be used:, (*4)

$input1 = '56.242 E';
$input2 = '40:26:46 S';

$parser = new Parser();

$value1 = $parser->parse($input1);
$value2 = $parser->parse($input2);

Supported Formats

Both single values and pairs are supported. Some samples of supported formats are below, though not every possible iteration may be explicitly specified:, (*5)

  1. Simple single signed values, (*6)

    • 40
    • -40
    • -8.543
    • +132
    • +77.2
  2. Simple single signed values with degree symbol, (*7)

    • 40°
    • -40°
    • -5.234°
    • +43°
    • +38.43°
  3. Single unsigned values with or without degree symbol, and cardinal direction, (*8)

    • 40° N
    • 40 S
    • 56.242 E
  4. Single values of signed integer degrees with degree symbol, and decimal minutes with apostrophe, (*9)

    • 40° 26.222'
    • -65° 32.22'
    • +165° 52.22'
  5. Single values of unsigned integer degrees with degree symbol, decimal minutes with apostrophe, and cardinal direction, (*10)

    • 40° 26.222' E
    • 65° 32.22' S
  6. Single values of signed integer degrees with degree symbol, integer minutes with apostrophe, and optional integer or decimal seconds with quote, (*11)

    • 40° 26' 46"
    • -79° 58' 56"
    • 93° 19' 25.8"
    • +120° 19' 25.8"
  7. Single values of signed integer degrees with colon symbol, integer minutes, and optional colon and integer or decimal seconds, (*12)

    • +40:26:46
    • -79:58:56
    • 93:19:25.8
  8. Single values of unsigned integer degrees with degree symbol, integer minutes with apostrophe, optional integer or decimal seconds with quote, and cardinal direction, (*13)

    • 40° 26' 46" S
    • 99° 58' 56" W
    • 44° 58' 53.9" N
  9. Single values of unsigned integer degrees with colon symbol, integer minutes with, optional colon and integer or decimal seconds, and cardinal direction, (*14)

    • 40:26:46 S
    • 99:58:56 W
    • 44:58:53.9 N
  10. Two of any one format separated by whitespace, (*15)

  11. Two of any one format separated by a comma, (*16)

Return

The parser will return a integer/float or an array containing a pair of these values., (*17)

Exceptions

The Lexer and Parser will throw exceptions implementing interface CrEOF\Geo\String\Exception\ExceptionInterface., (*18)

The Versions

03/05 2016

dev-master

9999999-dev

Parser for geography coordinate strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

parser geo text lexer string geometry geography coordinate spatial

03/05 2016

2.1.0

2.1.0.0

Parser for geography coordinate strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

parser geo text lexer string geometry geography coordinate spatial

10/04 2016

dev-develop

dev-develop

Parser for geography coordinate strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

parser geo text lexer string geometry geography coordinate spatial

18/11 2015

2.0.0

2.0.0.0

Parser for geography coordinate strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

parser geo text lexer string geometry geography coordinate spatial

18/11 2015

1.0.1

1.0.1.0

Parser for geography coordinate strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

parser geo text lexer string geometry geography coordinate spatial

11/11 2015

1.0.0

1.0.0.0

Parser for geography coordinate strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

parser geo text lexer string geometry geography coordinate spatial

09/11 2015

0.0.8

0.0.8.0

Parser for geography coordinate strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

parser geo text lexer string geometry geography coordinate spatial

01/04 2014

0.0.7

0.0.7.0

Parser for geography coordinate strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

parser geo text lexer string geometry geography coordinate spatial

01/04 2014

0.0.6

0.0.6.0

Parser for geography coordinate strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

parser geo text lexer string geometry geography coordinate spatial

01/04 2014

0.0.5

0.0.5.0

Parser for geography coordinate strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

parser geo text lexer string geometry geography coordinate spatial

29/03 2014

0.0.4

0.0.4.0

Parser for geography coordinate strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

parser geo text lexer string geometry geography coordinate spatial

27/03 2014

0.0.3

0.0.3.0

Parser for geography coordinate strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

geography

23/03 2014

0.0.2

0.0.2.0

Parser for geography coordinate strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

geography

23/03 2014

0.0.1

0.0.1.0

Parser for geography coordinate strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

geography