| Author |
Message |
|
|
I came up with a better way to accomplish this without using the mbstring library:
Code:
if(is_unicode($query)) {
$query_escaped = urlencode($query);
} else {
$query_escaped = urlencode(utf8_encode($query));
}
|
 |
|
|
No problem.
Glad to see that it is fixed!
Thanks again, Marc.
|
 |
|
|
Thanks Marc!
That makes sense. Hopefully that information will become more complete in time.
How about some documentation for hierarchy on the main website so others can enjoy it's greatness?
Thanks a ton for the work you're doing here. It's extremely helpful. The hierarchy service was exactly what I needed for my project. The geonames project is fantastic!
|
 |
|
|
I think through some research, I answered my last question. The answer seems to be "no", but I'm not sure why.
Here is something that should be in #6 of my previous post:
http://ws.geonames.org/hierarchy?geonameId=5744256&style=full
It jumps straight from ADM2 down to a specific building, but I think a populated place should be between those two. Here is how I found the proper populated place:
http://ws.geonames.org/findNearbyPlaceName?lat=45.3567875&lng=-122.5962024
I have coded around this in my application, but I think it makes sense to have it actually be part of the service.
|
 |
|
|
One more question about the structure of results returned by hierarchy.
Will there ever be something two levels below ADM1 in the hierarchy.
Here is how I understand the structure:
1) Continent
2) Country
3) ADM1
4) ADM2 (sometimes non-existent)
5) populated place/building/structure/etc.
6) ???? Does anything ever exist here?
Thanks again!
|
 |
|
|
I have a question about the consistency of results from this service.
Will the second result always be something that is considered a "country"?
Take Puerto Rico for example: http://ws.geonames.org/hierarchy?geonameId=4566967&style=full
It is considered an island by geonames, but for all intents and purposes, it is it's own country.
I need to know if I can safely assume that the second result is always a country.
Thanks.
|
 |
|
|
I don't see any documentation on this service anywhere on the site. Has it been "officially released"?
I plan on using this service for my project and was lucky to stumble upon it in the forums. I think it would help others if there was documentation about it on the main site.
|
 |
|
|
In PHP, I am using this:
Code:
$encoding = mb_detect_encoding($query);
if($encoding == 'UTF-8') {
$query_escaped = urlencode($query);
} else {
$query_escaped = urlencode(utf8_encode($query));
}
It's probably not the best way to go about it, but it works whether you are using UTF-8 for your php files themselves or not.
|
 |
|
|
As far as I can tell, a majority of the west coast timezones are incorrect.
http://ws.geonames.org/search?q=oregon+city&maxRows=1&style=FULL
http://ws.geonames.org/search?q=eugene&maxRows=1&style=FULL
http://ws.geonames.org/search?q=portland&maxRows=1&style=FULL
Everything is coming up as <timezone dstOffset="-6.0" gmtOffset="-7.0">America/Boise</timezone> instead of America/Los Angeles like it should.
|
 |
|
|