Skip to content

Conversation

paleolimbot
Copy link
Member

@paleolimbot paleolimbot commented Sep 16, 2025

We've been using the SQL table function sd_random_geometry() quite a bit for testing and benchmarking and I think this may make those types of simulations much nicer to write.

This still needs a bit of testing/moving of the parameter validation to Rust but it's not essential for release. I'll circle back after working on some more releasy-type tasks.

import sedonadb.testing

sedonadb.testing.random_geometry(
    10,
    geometry_type="MultiPolygon",
    num_parts=(1, 4),
    hole_rate=1,
    num_vertices=(3, 5),
    size=20,
).to_pandas().plot()
output

@petern48
Copy link
Collaborator

This reminds me that when I was writing up the pytest-benchmarking code, I realized it would be nice to have a random geometry rust function (instead of a table provider) that returns a single column, so that we could create multiple unique random geometry columns in a single query to use with functions that take two geometry inputs (e.g predicates). I can't think of many other use cases tho, so it doesn't seem very high priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants