HughP / geotoad

Automatically exported from code.google.com/p/geotoad
Other
0 stars 0 forks source link

Add support for international province searches #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run a query on a South African Province
2.
3.

What is the expected output? What do you see instead?
Cache results for the province

What version of the product are you using? On what operating system?
v 3.9.7.1

Please provide any additional information below.

Query:

( o ) To use this query in the future, type:
( o ) geotoad.rb --distanceMax=0 --output='c://' --ownerInclude=''
--password=***** --queryType=state --user=****** --userInclude='' 'gauteng'

output:

( o ) Performing state search for Gauteng
 ***  No waypoints found in
http://www.geocaching.com/seek/nearest.aspx?state_id
= (server error?) - retrying
 ***  No waypoints found in state_id= search. Possible error fetching
http://www
.geocaching.com/seek/nearest.aspx?state_id=
 *!*  ERROR: No caches found in search, exiting early.

Original issue reported on code.google.com by marc.tho...@gmail.com on 20 Sep 2008 at 1:39

GoogleCodeExporter commented 9 years ago
Right now we don't support the new province searches, the state search is only 
for
the US at the moment. I'm not sure when I will get to doing this just yet, so 
patches
are welcome!

Original comment by helixblue on 20 Sep 2008 at 2:43

GoogleCodeExporter commented 9 years ago
Not sure if this is what you meant, but these are the following state_id's for 
South
African Provinces:

152 - Western Cape
153 - Eastern Cape
154 - Northern Cape
155 - Mpumalanga
156 - North West 
157 - Kwazulu Natal 
158 - Limpopo
159 - Gauteng
160 - Free State 

Original comment by nraider3...@gmail.com on 21 Sep 2008 at 10:02

GoogleCodeExporter commented 9 years ago
Interesting to know that provinces are implemented just like states! If you add 
these
codes to lib/searchcode.rb (make sure they are lowercase), it works 
fantastically (I
tested it with 'gaunteng' -> 159)

The difficult part is going to be handling countries who have the same province 
names
but different codes. It looks like lib/searchcode.rb is going to have to be
refactored so that each country has it's own searchcode list.

lib/searchcode.rb is actually generated by tools/countryrip.rb. It seems to be 
the
best way to go about things is to iterate over each country and fetch the list 
of
state_id's for each one. 

Original comment by helixblue on 21 Sep 2008 at 12:12

GoogleCodeExporter commented 9 years ago
Many Thanks

Original comment by marc.tho...@gmail.com on 21 Sep 2008 at 7:27

GoogleCodeExporter commented 9 years ago
The same state / province issue could be fixed by prefixing the state/province 
name
with -us (-usa?) or -ca(-can?), etc. alabama-us, alberta-can, etc.

would make it fairly obvious as to which one to pick...

#Canadian Provinces
  $idHash['state_id']['alberta-ca']=63
  $idHash['state_id']['british columbia-ca']=64
  $idHash['state_id']['manitoba-ca']=65
  $idHash['state_id']['New Brunswick-ca']=66
  $idHash['state_id']['newfoundland-ca']=67
  $idHash['state_id']['nova scotia-ca']=68
  $idHash['state_id']['ontario-ca']=69
  $idHash['state_id']['prince edward island-ca']=70
  $idHash['state_id']['quebec-ca']=62
  $idHash['state_id']['saskatchewan-ca']=71
  $idHash['state_id']['northwest territories-ca']=72
  $idHash['state_id']['nunavut-ca']=73
  $idHash['state_id']['yukon territory-ca']=74

#South African Provinces
  $idHash['state_id']['western cape-sa']=152
  $idHash['state_id']['eastern cape-sa']=153
  $idHash['state_id']['northern cape-sa']=154
  $idHash['state_id']['mpumalanga-sa']=155
  $idHash['state_id']['north west-sa']=156
  $idHash['state_id']['kwazulu natal-sa']=157
  $idHash['state_id']['limpopo-sa']=158
  $idHash['state_id']['gauteng-sa']=159
  $idHash['state_id']['free state-sa']=160

Original comment by dur...@gmail.com on 16 Mar 2009 at 9:14

GoogleCodeExporter commented 9 years ago

Original comment by helixblue on 1 Jul 2009 at 5:15

GoogleCodeExporter commented 9 years ago
State searches are deprecated in 3.10, in favor of location searches using the 
Google 
Maps API. This should now be useful to you.

Original comment by helixblue on 24 Jan 2010 at 9:12