Open joemcl opened 4 years ago
Hey @joemcl
It looks like Google codes it thus,
line1 | "1400 Constitution Avenue Northwest" city | "Washington" state | "DC" zip | "20560"
So the city is Washington, but you'll also want to include DC as a state. It's a unique case though. That will whitelist Washington as a city in other states as well. This seems like something that might be better written as an exception, or perhaps the settings interface could be rethought.
Here's how to view Google's output for a given address, which the extension is parsing. Note to replace $API_KEY
with your Google API key.
Joseph
Aha, thanks so much @josephlacey , tried that. So using State = District of Columbia (as in the dropdown) and City = Washington, I can now get districts for DC - but just the Country level lower chamber, and it shows as just us/district, since DC unfortunately doesn't have an actual member of congress, just a non-voting Delegate. Don't get any value back for City Council district, and of course DC does not have any counties.
I can now get districts for DC - but just the Country level lower chamber, and it shows as just us/district, since DC unfortunately doesn't have an actual member of congress, just a non-voting Delegate.
In the above test address, Google is showing Eleanor Holmes Norton as the rep, but I guess like the county since it's all one district the code might not process is correctly.
Don't get any value back for City Council district, and of course DC does not have any counties.
I'm also seeing city council reps and the mayor, but again the unique nature of the political lines may make it an exception to correct processing.
Yeah DC has Wards for City Council which gets returned - but I think district
is a unique Division type, it doesn't return state
, and ward
is a unique Division type, it doesn't return council_district
, for DC, as for say, an address in New York City. Here's what gets returned for a street address in DC, Ward 5:
{
"name": "D.C. City Council Member",
"divisionId": "ocd-division/country:us/district:dc/ward:5",
"officialIndices": [
10
]
}
and here's what gets returned for an address in NYC -
{
"name": "New York City Council Member",
"divisionId": "ocd-division/country:us/state:ny/place:new_york/council_district:7",
"officialIndices": [
14
]
},
And just out of curiosity, gonna see what gets returned for a Chicago address, Chicago has Wards for City Council as well:
{
"name": "Chicago City Alderperson",
"divisionId": "ocd-division/country:us/state:il/place:chicago/ward:47",
"officialIndices": [
13
]
},
So yeah a Chicago address returns ward
not council_district
, like a DC address does.
So rather than adding ward
and district
as new and distinct levels, seems like adding code to recognizeward
as equivalent to council_district
, and district
as equivalent to state
would then populate values for City Council districts/Wards for DC, Chicago, wherever else uses ward
. And Puerto Rico has "municipios" which I think are equivalent to cities/place
s and will see what gets used for Puerto Rico, if it returns state
or something else.
@josephlacey thanks again so much. I've got the extension working after I figured out my error with help from @MegaphoneJon , see #25 . So, I want to help get Cities added in to the lookup, and not sure next steps to take for a PR to get Cities added to a lookup list, as one can do for Counties if a State is first selected in Administer -> System Settings -> Electoral API. My immediate goal is to add the District of Columbia as a City manually, and not sure what to enter. I've tried Dc, District_of _columbia, Washington_dc and none of those worked.