- 10–40 → 3–4minutes per permit, manual → pipeline
- 90%maximum time saved per permit
- 8 hunattended runs
- 400+permits processed
- 700+building polygons
Client under NDA · visuals use synthetic data
Every use permit comes with a set of scanned drawings. One of them is the site plan, which shows where each building stands on its lot. My client needs those buildings drawn as polygons on a real map, and every polygon has to carry the same attribute fields.
The same steps repeat for hundreds of permits, and one misplaced polygon is easy to miss in a file that holds hundreds more. So I built a command-line toolchain that takes every permit through the same path and checks the result before each delivery.
What the client needs
For each permit, the client wants the outline of every building on the site plan. Each outline becomes a polygon with eight attribute fields that follow the client's specification. The polygons are delivered as a File Geodatabase and a GeoPackage in TWD97 TM2 (EPSG:3826). Every case also comes with a one-page PPT that shows the cropped site plan with a red frame around each building, so the client can check the work case by case.
A permit can cover several buildings, and a building can be split into several units. Each unit gets its own polygon, which is why one permit often turns into more than one feature.
How I built the toolchain
I wrote the whole workflow as one command-line tool with 30 commands, one for each step. A batch begins by taking the next permits from the work list. If someone else has already digitised a permit, the tool skips it and moves down the list, so the batch still ends up the size I asked for.
Each permit needs only three drawings from a local government's public building-permit map. The site plan decides how many units there are and where they sit. The permit application and the completion photos are there to cross-check it.
The work is split between AI interpretation and manual review. AI reads the drawings and picks the candidate polygons, and I review every batch and correct the shapes and frames before it is delivered.
- 01DrawingsThree drawings per permit
- 02AI readingBuildings, units, names and a confidence level
- 03PolygonsOne polygon per unit in EPSG:3826
- 04Automated checksAbout 30 checks, with repairs tried first
- 05Manual reviewSite plan and map side by side
- 06DeliveryGDB / GPKG + one-page PPT per case
When AI reads the drawings, it first counts the buildings and units, then works out how parent and child permits relate. It copies any building name printed on the site plan, notes clues to the location and gives the reading a confidence level of high, medium or low. After that it picks a candidate polygon for each unit. All of this lives in one record per permit. Every output file is regenerated from these records, so a correction made in one record reaches all of them on the next run.
About 30 automated checks then run over the batch. Some look at the geometry, for example polygons that overlap each other or earlier work, or neighbouring buildings whose shared edge does not line up. Others confirm the coordinate system and the naming rule for building names. When a check fails, the tool tries to repair the problem first. If it cannot, the case drops to a lower confidence level and goes on my review list, while the rest of the batch carries on.
Checking each case on one card
Every batch is reviewed and corrected on a review page in my browser before it is delivered. Each permit gets one card, with the site plan on the left and the map on the right. When a polygon is off, I edit its shape right on the map, and the red frame that will appear in the PPT can be adjusted on the same card. Low-confidence cases also show the completion photo and street view next to each other. Each decision I make there is written back to the permit's record.
- Permit
- SAMPLE-03
- Building
- B2
- Main permit
- Yes
- Building name
- Block B
- Units on plan
- 3
- Confidence
- Medium
Every write starts as a dry run
Writing to the spreadsheet and uploading files both start as a dry run that only lists what would change. Nothing is written until I confirm. After an upload, the tool reads every file back from the cloud and compares its MD5 checksum with the local copy. Once a round is delivered, its records are locked, and a SHA-256 audit of the project files reports anything that changes afterwards.
Results
Since June 2026 I have made five deliveries to the client, covering 295 permits and 381 building polygons. The next delivery is already complete at 126 permits and 327 polygons. Every delivery has been a File Geodatabase in TWD97 TM2 (EPSG:3826) with eight attribute fields, and since the September round a GeoPackage comes with it. The client also receives a one-page PPT for each case.
Tools
The toolchain is written in Python. GDAL writes both the GeoPackage and the File Geodatabase, with Shapely doing the geometry work. The one-page slides come from python-pptx, and the review page runs on Leaflet. QGIS stays on hand as a backup editor.
Because of the NDA, this page leaves out the client's name and the work area, and it shows no real drawings or coordinates.