surrealdb / surrealist

Surrealist is the ultimate way to visually manage your SurrealDB database
https://surrealist.app/
MIT License
1.03k stars 73 forks source link

Surrealist has trouble handling a Polygon #257

Open Dhghomon opened 2 months ago

Dhghomon commented 2 months ago

Describe the bug "Received invalid binary data" when trying to use a Polygon.

To Reproduce

Use a query that uses a Polygon, such as:

RETURN {
  type: "Polygon",
  coordinates: [[
    [-0.03921743611083, 51.88106875736589],
    [30.48112752349519, 50.68377089794912],
    [23.66174524001544, 42.94500782833793],
    [ 1.92481534361859, 41.69698118125476]
  ]]
};

Or a MultiPolygon:

UPDATE university:oxford SET locations = {
    type: "MultiPolygon",
    coordinates: [
        [
            [ [10.0, 11.2], [10.5, 11.9], [10.8, 12.0], [10.0, 11.2] ]
        ],
        [
            [ [9.0, 11.2], [10.5, 11.9], [10.3, 13.0], [9.0, 11.2] ]
        ]
    ]
};

Interesting behaviour:

RETURN geo::centroid( {
  type: "Polygon",
  coordinates: [[
    [-0.03921743611083, 51.88106875736589],
    [30.48112752349519, 50.68377089794912],
    [23.66174524001544, 42.94500782833793],
    [ 1.92481534361859, 41.69698118125476]
  ]]
});

Expected behavior Should return what the CLI does

Environment:

1.4.0 for windows on x86_64

And on the web version:

Platform: Web Navigator: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 Version: 2.0.5 Flags: featureFlags: false, models_view: true, apidocs_view: true, themes: false, newsfeed: true