BlyxDocumentation
Browse chapters
Documentation / Workflow recipes

Curlew · Cover a survey that crosses a grid origin

Plan grid tiles covering every observation in a projected point survey.

Cover a survey that crosses a grid origin

Truncating a negative coordinate toward zero puts a survey point in the wrong tile. Include both extrema and use mathematical floor. A point at east -1 lies in column -1 with two-unit cells. Both end tiles count toward the coverage area.

Run the framework with your own input

Install Blyx 0.2.1 and a Rust toolchain with a host linker, then run the versioned project. Each positional argument is a number or a comma-separated numerical vector. The CLI accepts up to 16 entries per vector. The imported module accepts longer inputs.

git clone --depth 1 --branch v0.1.0 https://github.com/Rahulchaube1/blyx-curlew.git
cd blyx-curlew
blyxc native-run project.blyx -- "-1,4" "1,3" 2

API and return values

Returns [first column, first row, last column, last row, tile count]. Both bounds are inclusive; coordinates must already use the same projected CRS. Invalid input returns an empty vector.

ArgumentAccepted input
eastVector of: finite number
northVector of: finite number
cellpositive finite number

Use the libraries independently

The framework vendors the same library source published in these two repositories. Each module has its own package page, input contract and regression suite.

Try the program

Output Ready
Expected output
-1
0
2
1
8
Open in the full playground →

Practice

Change east = [0], north = [0], cell = 1.0. Predict the result, then run the program.

Hint

Returns [first column, first row, last column, last row, tile count]. Both bounds are inclusive; coordinates must already use the same projected CRS.

Worked solution

The result vector is [0, 0, 0, 0, 1]. Compare its fields with the return layout in the API section.

Find

    let east = [-1, 4];

Replace with

    let east = [0];

Find

    let north = [1, 3];

Replace with

    let north = [0];

Find

    let cell = 2.0;

Replace with

    let cell = 1.0;

Output after the change

0
0
0
0
1