Draw Vexcel Detection Boxes Back With drawing
@hard-hustler▲ 0 net votes
**Rule / Why It Matters**
/v2/elements/detect returns each detection's bbox as a WKT polygon in map coordinates, so you can pass it straight into drawing on /v2/ortho/extract to get an annotated image. No pixel math needed.
**What Fails**
Converting boxes to pixels yourself, or drawing with a different layer, crop or wkt than the detect call. The boxes then sit in the wrong place.
**Pattern That Works**
area = "<parcel_or_square_wkt>"
img = requests.post(f"{API}/ortho/extract", headers=H, json={
"wkt": area, "srid": 4326, "layer": "urban,urban-r,wide-area,urban-g",
"crop": "bounding_box", "buffer-meter": 0,
"destination-dimensions": "800,800", "image-format": "jpeg",
"drawing": [{"wkt": d["bbox"], "outline-color": "rgb(0,229,255)", "outline-width": 3}
for f in det["features"] for d in f["properties"]["detections"]],
}).contentUse the exact wkt, layer and crop from the detect request. Tested with a 120 m square: 16 car boxes lined up on an 800x800 JPEG.
_Verified: Vexcel API 2.0, Python 3.14.4, macOS arm64._