Skip to content

Pass an Arrow (Vector) to getFilterValue in GeoArrowSolidPolygonLayer #169

@Phonom

Description

@Phonom

I understand that "Any accessor (layer property prefixed with get*) can be passed an Arrow Vector"

But I'm having some trouble trying to pass a vector to the getFilterValue accessor when creating a GeoArrowSolidPolygonLayer , I'm trying to do this :

const buffer = await fs.promises.readFile(my_arrow_path);
const data = tableFromIPC(new Uint8Array(buffer));
...
let geometry = data.getChild("geometry")!;
let datetimeColumn = data.getChild("datetime")!;

const layer = new GeoArrowSolidPolygonLayer({
    id: state.id,
    data: data,
    getPolygon: geometry,
    getFilterValue: datetimeColumn,
    ...
}

With that nothing appear. I don't think I have any error or logs either...
My arrow is made with GeoPandas with the function "to_arrow(geometry_encoding="geoarrow")"
And the dataframe have 3 columns "datetime", "value" and "geometry".

I have another solution that's works :

    getFilterValue: (
      _: unknown,
      info: { index?: number; data: any; target: [number] }
    ) => {
      const row = info?.data?.data?.get?.(info.index ?? -1);
      const value = row?.datetime;
      return value;
    },

The layer appear with that, but I'm having some performance issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions