Skip to content

Commit

Permalink
Remove sensitive string formating
Browse files Browse the repository at this point in the history
@ac6y Works just fine without the sensitive string formating

It could of been the true/false that should of been in String instead of Boolean
  • Loading branch information
DenisCarriere committed Mar 26, 2016
1 parent a491da3 commit 5c59190
Showing 1 changed file with 14 additions and 24 deletions.
38 changes: 14 additions & 24 deletions geocoder/tamu.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,20 @@ def __init__(self, location, **kwargs):
raise ValueError("Provide key")

self.location = location
self.key = key

# note we do string formatting b/c apparently tamu endpoint is
# sensitive to the order of parameters.
self.url = \
'https://geoservices.tamu.edu/Services/Geocode/WebService/'\
'GeocoderWebServiceHttpNonParsed_V04_01.aspx?'\
'streetAddress={addr}'\
'&city={city}'\
'&state={state}'\
'&zip={zipcode}'\
'&apikey={key}'\
'&format=json'\
'&census=true'\
'&censusYear=1990|2000|2010'\
'&notStore=false'\
'&verbose=true'\
'&version=4.01'.format(
addr=location,
key=self.key,
city=city,
state=state,
zipcode=zipcode)

self.url = 'https://geoservices.tamu.edu/Services/Geocode/WebService/GeocoderWebServiceHttpNonParsed_V04_01.aspx'
self.params = {
'streetAddress': location,
'city': city,
'state': state,
'zip': zipcode,
'apikey': key,
'format': 'json',
'census': 'true',
'censusYear': '1990|2000|2010',
'notStore': 'false',
'verbose': 'true',
'version': '4.01'
}
self._initialize(**kwargs)

def _catch_errors(self):
Expand Down

1 comment on commit 5c59190

@ac6y
Copy link
Contributor

@ac6y ac6y commented on 5c59190 Mar 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better - I think you are right, it must have been the string/boolean issue, and not the parameter order as I had thought.

Please sign in to comment.