qrest
A small CLI tool to query ArcGIS REST API services, implemented in Rust. The server response is returned as pretty JSON.
Said another way, Query REST, aka qrest. Pronounced crest
Usage example:
./qrest https://gisservices.its.ny.gov/arcgis/rest/services/NYS_Place_Points/FeatureServer/0/query --where "County = 'Essex' AND PlaceType = 'Incorporated Town'" --count
# Outputs:
# {
# "count": 18
# }
Compiling
Brief instructions follow. For more detail, see Screwtape's Notepad's article, which this is based on.
Use cargo to build for your system.
cargo build --release
To cross-compile from Debian to 64-bit Windows,
# One-time setup
rustup target add x86_64-pc-windows-gnu
rustup toolchain install stable-x86_64-pc-windows-gnu
sudo apt install mingw-w64
Then configure the linker ~/.cargo/config
:
[target.x86_64-pc-windows-gnu]
linker = "/usr/bin/x86_64-w64-mingw32-gcc"
Once setup, you can build with:
cargo build --target x86_64-pc-windows-gnu --release