Help with WKB
#2962
Replies: 1 comment 3 replies
-
Hmm, I assume you have checked the structure of You may want to apply types using checking he shape of the returned data, and using e.g. const rawData = await fetch(FETCH_URL)
.then(res => res.blob())
const data = await parse(rawData, WKBLoader, {
worker: false,
wkb: {
shape: 'binary-geometry'
}
});
if (data.type === 'binary-geometry') {
console.debug("Parsed type : ", data.type);
console.debug("Data : ", data.positions);
const layer = new GeoJsonLayer({
id: 'wkbPoint',
data: {
shape: 'binary-feature-collection',
points: data,
} as const satisifies BinaryFeatureCollection,
pointType: 'circle',
getFillColor: [255, 0, 0, 255],
getRadius: 2000,
}) I don't have a working example of WKB in loaders.gl examples, that could be a good addition. Until we get around to that if you could create a code pen that might make it a bit easier to help you debug. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone, I'm trying to fetch and show a WKB, so I'm using the WKBLoader and thanks to this page I found a way to put my
BinaryGeometry
(hereBinaryPointGeometry
for test purpose) in aGeoJsonLayer
which should, in my comprehension, handle that despite his name.Unfortunately, I got the error
deck: initialization of GeoJsonLayer({id: 'wkbPoint'}): GeoJSON does not have type Error: GeoJSON does not have type
from Deck.GL.Note that my
BinaryPointGeometry
actually has atype
field with valuePoint
.Here are some sources
Beta Was this translation helpful? Give feedback.
All reactions