Skip to content

Commit 7fa5a8a

Browse files
authored
Use WKB from hyparquet (#15)
1 parent 186810e commit 7fa5a8a

File tree

7 files changed

+18
-156
lines changed

7 files changed

+18
-156
lines changed

demo/bundle.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/bundle.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@
1818
"url": "git+https://github.com/hyparam/geoparquet.git"
1919
},
2020
"dependencies": {
21-
"hyparquet": "1.17.3"
21+
"hyparquet": "1.19.0"
2222
},
2323
"devDependencies": {
24-
"@rollup/plugin-node-resolve": "16.0.1",
24+
"@rollup/plugin-node-resolve": "16.0.2",
2525
"@rollup/plugin-terser": "0.4.4",
2626
"@types/google.maps": "3.58.1",
27-
"@types/node": "24.3.0",
27+
"@types/node": "24.7.0",
2828
"@vitest/coverage-v8": "3.2.4",
29-
"eslint": "9.33.0",
29+
"eslint": "9.37.0",
3030
"http-server": "14.1.1",
3131
"hyparquet-compressors": "1.1.1",
32-
"rollup": "4.46.2",
33-
"typescript": "5.9.2",
32+
"rollup": "4.52.4",
33+
"typescript": "5.9.3",
3434
"vitest": "3.2.4"
3535
},
3636
"files": [

src/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export { asyncBufferFromUrl } from 'hyparquet'
2-
export { toGeoJson } from './toGeoJson.js'
3-
export { decodeWKB } from './wkb.js'
2+
export { toGeoJson, decodeWKB } from './toGeoJson.js'

src/toGeoJson.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { parquetMetadataAsync, parquetReadObjects } from 'hyparquet'
2-
import { decodeWKB } from './wkb.js'
2+
import { wkbToGeojson } from 'hyparquet/src/wkb.js'
33

44
/**
55
* Convert a GeoParquet file to GeoJSON.
@@ -63,3 +63,10 @@ export async function toGeoJson({ file, compressors }) {
6363
features,
6464
}
6565
}
66+
67+
/**
68+
* @param {Uint8Array} buffer
69+
*/
70+
export function decodeWKB(buffer) {
71+
return wkbToGeojson({ view: new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength), offset: 0 })
72+
}

src/wkb.js

Lines changed: 0 additions & 144 deletions
This file was deleted.

test/wkb.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, it } from 'vitest'
2-
import { decodeWKB } from '../src/wkb.js'
2+
import { decodeWKB } from '../src/index.js'
33

44
describe('WKB decoding', () => {
55
it('should decoding well-known binary Point', () => {

0 commit comments

Comments
 (0)