node-geocoder icon indicating copy to clipboard operation
node-geocoder copied to clipboard

North Pacific Ocean

Open throbi opened this issue 9 years ago • 4 comments

Hi,

great plugin, thanks!

I only have one issue, when trying to reverse coordinates from oceans. E.g. clicking around 7.471741, -128.427631 on Google maps shows me "North Pacific Ocean". Calling geocoder.reverse with google provider returns this error:

{ Error: Status is ZERO_RESULTS. at c:\node_modules\node-geocoder\lib\geocoder\googlegeocoder.js:285:25 at IncomingMessage. (c:\node_modules\node-geocoder\lib\httpadapter\httpadapter.js:62:9) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:185:7) at endReadableNT (_stream_readable.js:974:12) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9) cause: Error: Status is ZERO_RESULTS. at c:\node_modules\node-geocoder\lib\geocoder\googlegeocoder.js:285:25 at IncomingMessage. (c:\node_modules\node-geocoder\lib\httpadapter\httpadapter.js:62:9) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:185:7) at endReadableNT (_stream_readable.js:974:12) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9), isOperational: true }

Would it be possible to return "North Pacific Ocean" instead?

Thanks, Robert

throbi avatar Nov 25 '16 20:11 throbi

Just tried to call directly the Google API: https://maps.googleapis.com/maps/api/geocode/json?latlng=7.471741,%20-128.427631, which returned { "results" : [], "status" : "ZERO_RESULTS" }

So "North Pacific Ocean" should come from another source...

throbi avatar Nov 25 '16 21:11 throbi

Just found that geonames.org can give the right answer: http://api.geonames.org/ocean?lat=7.41343&lng=-128.427631&username=demo

<geonames>
    <ocean>
        <name>
              North Pacific Ocean
        </name>
    </ocean>
</geonames>

Would it be possible to support this service as well?

Thanks, Robert

throbi avatar Nov 25 '16 21:11 throbi

sure do you have time to do a pull request to add a new provider ?

nchaulet avatar Nov 26 '16 14:11 nchaulet

Sorry Nicolas, on a very tight schedule at the moment... 2016.11.26. 15:21 ezt írta ("Nicolas Chaulet" [email protected]):

sure do you have time to do a pull request to add a new provider ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nchaulet/node-geocoder/issues/200#issuecomment-263065824, or mute the thread https://github.com/notifications/unsubscribe-auth/AAekEb-PH42mxnwzsdSqZ0a-Vi_21ZNtks5rCEBugaJpZM4K8tZ1 .

throbi avatar Nov 26 '16 16:11 throbi