Skip to content

Commit 3ff835b

Browse files
committed
Strip out WKB parser and use upstream hyparquet
1 parent 7fa5a8a commit 3ff835b

File tree

4 files changed

+8
-78
lines changed

4 files changed

+8
-78
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@
1818
"url": "git+https://github.com/hyparam/geoparquet.git"
1919
},
2020
"dependencies": {
21-
"hyparquet": "1.19.0"
21+
"hyparquet": "1.20.0"
2222
},
2323
"devDependencies": {
24-
"@rollup/plugin-node-resolve": "16.0.2",
24+
"@rollup/plugin-node-resolve": "16.0.3",
2525
"@rollup/plugin-terser": "0.4.4",
2626
"@types/google.maps": "3.58.1",
27-
"@types/node": "24.7.0",
27+
"@types/node": "24.9.1",
2828
"@vitest/coverage-v8": "3.2.4",
29-
"eslint": "9.37.0",
29+
"eslint": "9.38.0",
3030
"http-server": "14.1.1",
3131
"hyparquet-compressors": "1.1.1",
32-
"rollup": "4.52.4",
32+
"rollup": "4.52.5",
3333
"typescript": "5.9.3",
3434
"vitest": "3.2.4"
3535
},

src/index.js

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

src/toGeoJson.js

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

43
/**
54
* Convert a GeoParquet file to GeoJSON.
@@ -30,13 +29,8 @@ export async function toGeoJson({ file, compressors }) {
3029
const features = []
3130
const primaryColumn = geoSchema.primary_column || 'geometry'
3231
for (const row of data) {
33-
const wkb = row[primaryColumn]
34-
if (!wkb) {
35-
// No geometry
36-
continue
37-
}
38-
39-
const geometry = decodeWKB(wkb)
32+
const geometry = row[primaryColumn]
33+
if (!geometry) continue // No geometry
4034

4135
// Extract properties (all fields except geometry)
4236
/** @type {Record<string, any>} */
@@ -63,10 +57,3 @@ export async function toGeoJson({ file, compressors }) {
6357
features,
6458
}
6559
}
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-
}

test/wkb.test.js

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

0 commit comments

Comments
 (0)