Skip to content

Commit

Permalink
Fix broken windows (#64)
Browse files Browse the repository at this point in the history
  - Update dependencies
  - Formatting and format check
  - Update readme
  - Update workflow to support PRs and Node 14 LTS
  • Loading branch information
wavded authored Feb 2, 2021
1 parent ffbe68d commit f58cf1e
Show file tree
Hide file tree
Showing 6 changed files with 418 additions and 434 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"root": true,
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"extends": ["eslint:recommended"],
"env": {
"node": true,
"es6": true
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: build
on: push
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['10', '12']
node: ['10', '12', '14']
name: Node v${{ matrix.node }}
steps:
- uses: actions/checkout@v2
Expand All @@ -14,5 +14,6 @@ jobs:
node-version: ${{ matrix.node }}
- run: sudo apt-get install gdal-bin
- run: yarn install
- run: yarn fmt-check
- run: yarn lint
- run: yarn test
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,20 @@
"scripts": {
"test": "nyc tape \"test/*-test.js\"",
"lint": "eslint --max-warnings 0 modules examples test *.js",
"fmt": "prettier --write \"**/*.{html,js,json,md}\""
"fmt": "prettier --write \"**/*.{html,js,json,md}\"",
"fmt-check": "prettier --check \"**/*.{html,js,json,md}\""
},
"main": "./index.js",
"dependencies": {
"archiver": "^5.0.2",
"comma-separated-values": "^3.6.0",
"decompress-zip": "^0.2.2",
"decompress-zip": "^0.3.3",
"findit": "^2.0.0",
"rimraf": "^3.0.2"
},
"devDependencies": {
"eslint": "^7.4.0",
"eslint-config-prettier": "^6.10.0",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-prettier": "^3.1.2",
"nyc": "^15.1.0",
"prettier": "^2.0.5",
Expand Down
7 changes: 5 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ console.log(data)
See `/examples` for usage examples and `/test/api.js`.

# Configuring the base ogr2ogr command

An alternative to installing GDAL, you can invoke ogr2ogr via a [GDAL Docker image](https://hub.docker.com/r/osgeo/gdal) instead. Do this by configuring the base command that is executed to invoke the ogr2ogr CLI.

```javascript
var ogr2ogr = require('ogr2ogr')

ogr2ogr('/home/.../path/to/spatial/file')
.command('docker run -v /home/:/home --rm osgeo/gdal:alpine-small-latest ogr2ogr')
.command(
'docker run -v /home/:/home --rm osgeo/gdal:alpine-small-latest ogr2ogr'
)
.exec(function (er, data) {
if (er) console.error(er)
console.log(data)
Expand Down Expand Up @@ -147,7 +150,7 @@ geojson.pipe(fs.createWriteStream('/lonely.json'))

(The MIT License)

Copyright (c) 2020 Marc Harter <[email protected]>
Copyright (c) 2021 Marc Harter <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
2 changes: 1 addition & 1 deletion test/api-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ test('api input formats', function (tp) {
t.equal(data.features[0].properties.area, '51', 'maintains attributes')
t.equal(
data.features[0].geometry.coordinates[0],
11354588.060913906,
11354588.060913904,
'is reprojected'
)
})
Expand Down
Loading

0 comments on commit f58cf1e

Please sign in to comment.