Ejemplo n.º 1
0
 public function testGetCountyPrimary()
 {
     $geodata = new Geodata('json');
     $result = $geodata->getCounty('MD', 'Montgomery County', 'primary');
     $this->assertTrue(!empty($result));
 }
Ejemplo n.º 2
0
<?php

/**
 * SBA Geodata API
 *
 * @link https://github.com/samhenry/sba-geodata-php
 * @author Sam Henry
 * @since 12.10.2015
 */
require '../src/Geodata.php';
use SamHenry\Geodata\Geodata;
// Initialize class
$geodata = new Geodata('json');
// Retrieve all counties in Maryland
$result = $geodata->getCounties('MD');
// Print Results
echo '<pre>';
foreach ($result as $r) {
    echo 'Name: ' . $r->name . PHP_EOL;
    echo 'ID: ' . $r->feature_id . PHP_EOL;
    echo 'Class: ' . $r->feat_class . PHP_EOL;
    echo 'FIPS Class: ' . $r->fips_class . PHP_EOL;
    echo 'State: ' . $r->state_name . PHP_EOL;
    echo 'Coordinates: ' . $r->primary_latitude . ',' . $r->primary_longitude . PHP_EOL;
    echo 'URL: ' . $r->url . PHP_EOL;
    echo PHP_EOL;
}
echo '</pre>';
Ejemplo n.º 3
0
<?php

/**
 * SBA Geodata API
 *
 * @link https://github.com/samhenry/sba-geodata-php
 * @author Sam Henry
 * @since 12.10.2015
 */
require '../src/Geodata.php';
use SamHenry\Geodata\Geodata;
// Initialize class
$geodata = new Geodata('json');
// Retrieve all data for Montgomery County, MD
$result = $geodata->getCounty('MD', 'Montgomery County');
// Print Results
echo '<pre>';
foreach ($result as $r) {
    echo 'Name: ' . $r->name . PHP_EOL;
    echo 'ID: ' . $r->feature_id . PHP_EOL;
    echo 'Class: ' . $r->feat_class . PHP_EOL;
    echo 'FIPS Class: ' . $r->fips_class . PHP_EOL;
    echo 'County: ' . $r->full_county_name . PHP_EOL;
    echo 'State: ' . $r->state_name . PHP_EOL;
    echo 'Coordinates: ' . $r->primary_latitude . ',' . $r->primary_longitude . PHP_EOL;
    echo 'URL: ' . $r->url . PHP_EOL;
    echo PHP_EOL;
}
echo '</pre>';
Ejemplo n.º 4
0
<?php

/**
 * SBA Geodata API
 *
 * @link https://github.com/samhenry/sba-geodata-php
 * @author Sam Henry
 * @since 12.10.2015
 */
require '../src/Geodata.php';
use SamHenry\Geodata\Geodata;
// Initialize class
$geodata = new Geodata('json');
// Retrieve all data for Baltimore, MD
$result = $geodata->getCity('MD', 'Baltimore');
// Print Results
echo '<pre>';
foreach ($result as $r) {
    echo 'Name: ' . $r->name . PHP_EOL;
    echo 'ID: ' . $r->feature_id . PHP_EOL;
    echo 'Class: ' . $r->feat_class . PHP_EOL;
    echo 'FIPS Class: ' . $r->fips_class . PHP_EOL;
    echo 'County: ' . $r->full_county_name . PHP_EOL;
    echo 'State: ' . $r->state_name . PHP_EOL;
    echo 'Coordinates: ' . $r->primary_latitude . ',' . $r->primary_longitude . PHP_EOL;
    echo 'URL: ' . $r->url . PHP_EOL;
    echo PHP_EOL;
}
echo '</pre>';
Ejemplo n.º 5
0
<?php

/**
 * SBA Geodata API
 *
 * @link https://github.com/samhenry/sba-geodata-php
 * @author Sam Henry
 * @since 12.10.2015
 */
require '../src/Geodata.php';
use SamHenry\Geodata\Geodata;
// Initialize class
$geodata = new Geodata('json');
// Retrieve all counties in Maryland
$result = $geodata->getCities('MD');
// Print Results
echo '<pre>';
foreach ($result as $r) {
    echo 'Name: ' . $r->name . PHP_EOL;
    echo 'ID: ' . $r->feature_id . PHP_EOL;
    echo 'Class: ' . $r->feat_class . PHP_EOL;
    echo 'FIPS Class: ' . $r->fips_class . PHP_EOL;
    echo 'County: ' . $r->full_county_name . PHP_EOL;
    echo 'State: ' . $r->state_name . PHP_EOL;
    echo 'Coordinates: ' . $r->primary_latitude . ',' . $r->primary_longitude . PHP_EOL;
    echo 'URL: ' . $r->url . PHP_EOL;
    echo PHP_EOL;
}
echo '</pre>';