@@ -221,7 +221,13 @@ def _main(
221221# --------------------------------------------------------------------------- #
222222@app .command ()
223223def systems (refresh : bool = typer .Option (False , "--refresh" , help = "Force a live fetch (ignore cache)" )):
224- """List the Italian reference systems supported by Verto Online."""
224+ """List the Italian reference systems supported by Verto Online.
225+
226+ Examples:
227+
228+ openverto systems
229+ openverto -o jsonl systems
230+ """
225231 try :
226232 rows = lib_systems (refresh = refresh )
227233 except Exception as exc : # noqa: BLE001
@@ -236,7 +242,19 @@ def convert(
236242 to_epsg : str = typer .Option (..., "--to" , help = "Target EPSG (e.g. 6706)" ),
237243 no_cache : bool = typer .Option (False , "--no-cache" , help = "Bypass the offline conversion cache" ),
238244):
239- """Convert one or more coordinates between reference systems (e=est/lon, n=nord/lat)."""
245+ """Convert one or more coordinates between reference systems (e=est/lon, n=nord/lat).
246+
247+ Axis order is always e (est/lon) first, n (nord/lat) second.
248+
249+ Examples:
250+
251+ openverto convert --from 23033 --to 6706 290000 4640000
252+ openverto -o jsonl convert --from 4265 --to 6706 12.4924 41.8902
253+ printf '290000,4640000\\ n' | openverto -o csv convert --from 23033 --to 6706
254+
255+ Note: global options like -o/--output go BEFORE the subcommand
256+ (openverto -o jsonl convert ...), never after it.
257+ """
240258 in_e = _parse_epsg (from_epsg )
241259 out_e = _parse_epsg (to_epsg )
242260 pairs = _read_coord_args (coords or [])
@@ -257,7 +275,13 @@ def convert(
257275
258276@app .command ()
259277def inspect (epsg : list [str ] = typer .Argument (..., help = "One or more EPSG codes" )):
260- """Show datum family, axis order, units, zone and false easting for an EPSG."""
278+ """Show datum family, axis order, units, zone and false easting for an EPSG.
279+
280+ Examples:
281+
282+ openverto inspect 3003
283+ openverto -o json inspect 3003 6706
284+ """
261285 cards = []
262286 for a in epsg :
263287 code = _parse_epsg (a )
@@ -270,13 +294,25 @@ def inspect(epsg: list[str] = typer.Argument(..., help="One or more EPSG codes")
270294
271295@app .command ()
272296def detect (e : float = typer .Argument (...), n : float = typer .Argument (...)):
273- """Guess the likely source reference system of a coordinate from its magnitude."""
297+ """Guess the likely source reference system of a coordinate from its magnitude.
298+
299+ Examples:
300+
301+ openverto detect 290000 4640000
302+ openverto -o json detect 1500000 4640000
303+ """
274304 _emit (lib_detect (e , n ))
275305
276306
277307@app .command ()
278308def targets (epsg : str = typer .Argument (..., help = "Source EPSG" )):
279- """List the reference systems you can convert a given EPSG into."""
309+ """List the reference systems you can convert a given EPSG into.
310+
311+ Examples:
312+
313+ openverto targets 3003
314+ openverto -o csv targets 3003
315+ """
280316 code = _parse_epsg (epsg )
281317 try :
282318 rows = lib_targets (code )
@@ -296,7 +332,13 @@ def roundtrip(
296332 The residual is the gap between the original coordinate and itself after the
297333 forward + inverse transform (datum shift + projection). residual_e/residual_n
298334 are exact in the source unit; residual_m is an approximate distance in metres
299- (for geographic sources, a latitude-aware spherical approximation)."""
335+ (for geographic sources, a latitude-aware spherical approximation).
336+
337+ Examples:
338+
339+ openverto roundtrip --from 23033 --to 6706 290000 4640000
340+ openverto -o json roundtrip --from 3003 --to 6707 1500000 4640000
341+ """
300342 in_e = _parse_epsg (from_epsg )
301343 out_e = _parse_epsg (to_epsg )
302344 pairs = _read_coord_args (coords or [])
@@ -330,7 +372,14 @@ def batch(
330372 skip_invalid : bool = typer .Option (False , "--skip-invalid" , help = "Bisect and skip coordinates the service rejects" ),
331373 rejects : str = typer .Option ("" , "--rejects" , help = "Write skipped rows to this CSV" ),
332374):
333- """Convert a whole CSV of coordinates to CSV or GeoJSON (auto-chunks at 32000)."""
375+ """Convert a whole CSV of coordinates to CSV or GeoJSON (auto-chunks at 32000).
376+
377+ Examples:
378+
379+ openverto batch catasto.csv --from 3003 --to 6707 --e-col est --n-col nord --out out.csv
380+ openverto batch points.csv --from 3003 --to 6706 --format geojson --out out.geojson
381+ openverto batch mixed.csv --from 4265 --to 6706 --skip-invalid --rejects bad.csv
382+ """
334383 in_e = _parse_epsg (from_epsg )
335384 out_e = _parse_epsg (to_epsg )
336385 if fmt not in ("csv" , "geojson" ):
@@ -415,6 +464,11 @@ def geojson(
415464
416465 GeoJSON positions (x, y) equal (e, n) — longitude, latitude for geographic
417466 systems — matching the service's axis order directly, with no swap needed.
467+
468+ Examples:
469+
470+ openverto geojson aree.geojson --from 4230 --to 6706 --out out.geojson
471+ cat aree.geojson | openverto geojson - --from 4230 --to 6706
418472 """
419473 in_e = _parse_epsg (from_epsg )
420474 out_e = _parse_epsg (to_epsg )
@@ -445,7 +499,13 @@ def cache(
445499 stats : bool = typer .Option (False , "--stats" , help = "Show cache statistics" ),
446500 clear : bool = typer .Option (False , "--clear" , help = "Delete cached systems and conversions" ),
447501):
448- """Inspect or clear the local offline cache of conversions and systems."""
502+ """Inspect or clear the local offline cache of conversions and systems.
503+
504+ Examples:
505+
506+ openverto cache --stats
507+ openverto cache --clear
508+ """
449509 if clear :
450510 removed = cache_mod .clear ()
451511 _emit ({"cleared" : removed })
@@ -455,7 +515,13 @@ def cache(
455515
456516@app .command ()
457517def doctor ():
458- """Verify connectivity to the IGM Verto Online service."""
518+ """Verify connectivity to the IGM Verto Online service.
519+
520+ Examples:
521+
522+ openverto doctor
523+ openverto -o json doctor
524+ """
459525 info = {"version" : __version__ , "service" : "IGM Verto Online" }
460526 try :
461527 sysrows = lib_systems (refresh = True )
0 commit comments