Skip to content

Error: ENOENT: no such file or directory, open '[...]/data/N44E001.hgt'聽#16

Description

@kozlown

Hi, and first of all great work for this module 馃憤
It looks like SyncTileSet is not waiting the end of file writing before calling callback, I got the error bellow, though after a while I got the specified file in my data directory at absolute path specified in the error. My code runs with values which lead to the creation of about 40 .hgt files. By the way when I execute it a second time everything is ok because .hgt files are already in data directory.

{ Error: ENOENT: no such file or directory, open '[...]/data/N44E001.hgt'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at new Hgt (/var/www/mnp-project/api/node_modules/node-hgt/src/hgt.js:7:17)
at /var/www/mnp-project/api/node_modules/node-hgt/src/load-tile.js:28:35
at /var/www/mnp-project/api/node_modules/node-hgt/src/imagico.js:45:9
at tryCallOne (/var/www/mnp-project/api/node_modules/promise/lib/core.js:37:12)
at /var/www/mnp-project/api/node_modules/promise/lib/core.js:123:15
at flush (/var/www/mnp-project/api/node_modules/asap/raw.js:50:29)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '[...]/data/N44E001.hgt' }

my code :

const tileset = new SyncTileSet(`${__dirname}/data/`, [this.minLat, this.minLng], [this.maxLat, this.maxLng], (err) => {
    if (err) {
        reject(err)
        return
    }
    _.each(this.coordinates, (coordinate) => {
        const lat = coordinate[1]
        const lng = coordinate[0]
        // get new elevation and set it
        const elevation = tileset.getElevation([lat, lng])
        coordinate[2] = elevation
    })
    resolve('ok')
})

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions