SunlightDistrict::districtsGeoloc()

  • Description: Find the legislative district that a given set of latitude and longitude coordinates exist in.
  • Arguments: Requires two arguments.
    • latitude
    • longitude
1
2
3
4
5
6
api_key = 'XXXXXXXXXXXX';

echo '<pre>';
print_r( $sf-&gt;districtsGeoloc( '37.0625', '-95.677068' ) );
echo '</pre>';
?&gt;

Result:

1
2
3
4
5
stdClass Object
(
    [state] =&gt; KS
    [number] =&gt; 4
)