Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rl3/nodejs-globe-elevation
Browse files Browse the repository at this point in the history
  • Loading branch information
runlevel3@goedel committed Sep 22, 2016
2 parents a103cbf + 1a7c7b9 commit 8264d3e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ console.log('Elevation at 51.7894(lat), 11.1416(lng) =? 123:', elevation.getElev
console.log('Elevation at (35.0(lat), -106.6(lng)), (35.1(lat), 106.5(lng)) =? 1624.2:', elevation.getElevation([ { lat: 35.0, lng: -106.6 }, [ () => -106.5, () => 35.1 ] ]));
```
## Initialization
Initialization is optional if your data files are located at one of the above mentioned directories. If not, give it with ```dataPath```.
Initialization is optional if your data files are located at one of the above mentioned directories. If not specify it with ```dataPath```.

Furthermore we've optimized file operation for multiple calculations. You may specify with ```openFileTimeout``` a timeout in ms, for which any opened file will be kept open after last access. You may specify ```0``` to disable this feature (default is 1 second). You should not use much higher values for nodejs waits on process exit for any pending timeout before exiting.
Furthermore we've optimized file operation for multiple calculations. You may specify with ```openFileTimeout``` a timeout in ms, for which any file will be kept open after last access. You may specify ```0``` to disable this feature (default is 1 second). You should not use much higher values because nodejs waits on process exit for any pending timeout before exiting.

## ```getElevation( location [, onError] )```
You may specify a single location or an array of two locations (bounding box).

Any location may be in the format ```[ lng, lat ]``` or ```{ lng: lng, lat: lat }``` or a function returning such values. ```lat``` and ```lng``` may be functions itselfes returning the needed values.
Any location may be in the format ```[ lng, lat ]``` or ```{ lng: lng, lat: lat }``` or a function returning such values. ```lat``` and ```lng``` may be functions itselfes returning the corresponding values.

**Attention:** Please note, that we chose ```[ lng, lat ]``` for arrays, because it's MongoDB's internal format for geo locations.

If you specify a bounding box, ```lng``` and ```lat``` will be iterated over every value inbetween in 1/120 grad steps. The result is the mean value of all eleveations.
If you specify a bounding box, ```lng``` and ```lat``` will be iterated over every value inbetween in 1/120 grad steps. The result is the mean value of all elevations.

The optional ```onError``` function is called whenever an error occured. It's return value wil be the result of ```getElevation```

0 comments on commit 8264d3e

Please sign in to comment.