Skip to content

Sheet C-206Complete

BIM/GIS Scripts

Terminal-style placeholder for bim-gis-scripts

A custom computational toolkit connecting geospatial research, statistical testing, and architectural modeling for the thesis Restoring the Jewish Temple: A Spatial Study. The workflow combines QGIS/PyQGIS spatial development, standalone Python analysis, and pyRevit tools that translate selected GIS geometry into native Revit elements.

Purpose

The thesis examines competing assumptions about the Temple’s placement on the Temple Mount through georeferenced mapping, axial relationships, control points, architectural overlays, and uncertainty testing. The scripts make those relationships measurable and repeatable, then carry selected geometry into a BIM environment for architectural exploration.

The toolkit supports a traceable progression from spatial evidence to analytical results and design geometry. Its outputs evaluate geometric consistency under specified assumptions; they do not establish historical certainty.

Core workflow

QGIS/PyQGIS spatial construction → data preparation → deterministic constraint checks → observed Monte Carlo simulation → randomized null-model comparison → sensitivity and dispersion analysis → publication figures and tables → GIS-to-Revit manifest → Revit reference geometry and walls.

Primary spatial construction and exploratory work happen in QGIS/PyQGIS, followed by a separate Python testing environment used for independent checks. The standalone analysis scripts use GeoPandas and related libraries rather than requiring the QGIS Python runtime.

GIS preparation and spatial checks

Data preparation — prepare_data.py

Consolidates source layers into an analysis-ready GeoPackage. It reads Shapefile, GeoPackage, GeoJSON, and KML data; attempts geometry repair; standardizes field names; adds metadata; and exports a processing summary.

Layers are reprojected to WGS 84 / UTM Zone 36N, EPSG:32636, providing a common metric coordinate system. Optional settings handle missing source CRS information and warn about suspicious coordinate ranges.

Constraint evaluation — run_constraints.py

Evaluates spatial relationships among selected anchors, east–west and north–south axes, centroids, and candidate model footprints. It produces CSV results and optional comparison tables for thesis reference layers.

The script exposes thresholds for distance, angular alignment, and containment. Explicit layer selection allows the analysis to use declared inputs rather than relying solely on automatic name matching.

Statistical testing

Observed convergence — run_monte_carlo.py

Tests the stability of the selected line geometry under controlled positional and rotational uncertainty. Each trial perturbs the input constraints and computes a least-squares point-to-lines convergence location.

Outputs include trial coordinates, a mean center, covariance ellipse metrics, radial probability rings, and distances to reference points. Optional leave-one-out tests remove individual constraints to measure their influence on the result.

Code defaults include 5,000 trials, 0.25° rotational noise, 2 m positional noise, and random seed 42. These are configurable defaults, not a claim that every exported result used identical settings.

Null-orientation comparison — run_null_model.py

Builds a comparison model by randomizing selected constraint orientations while retaining configurable fixed constraints. An option preserves the perpendicular relationship between the north–south and east–west axes.

The script applies local perturbations, solves convergence points, and exports summary metrics, probability rings, trial coordinates, and comparisons against observed-model results. This supplies a defined benchmark for assessing convergence concentration under the chosen randomization rules.

Dispersion and sensitivity reporting

run_rms.py calculates selected numeric RMS measures, centered coordinate RMS, radial RMS around a mean center, and optional distances to a reference point. Supporting scripts turn dispersion and leave-one-out results into comparison tables and charts.

The sensitivity figure script contains fixed values transcribed from an appendix table, so that figure must be updated explicitly when its underlying analysis changes.

GIS-to-BIM translation

Manifest builder — build_revit_import_manifest.py

Converts selected Shapefile and GeoPackage layers into revit_import_manifest.json, separating GIS file parsing from Revit element creation.

The builder reads base controls, observed-model geometry, and architectural translation layers. These include control points, axes, mean centers, confidence ellipses, temple footprint overlays, and cubit-square series.

It normalizes coordinates to EPSG:32636 and subtracts a selected anchor to create local coordinates in meters. The default anchor is mc_mean_center; alternatives include axis_origin and axis_origin_true. The manifest retains the global anchor coordinates, CRS, source paths, layer names, categories, labels, and polygon or line properties.

This boundary keeps GeoPackage handling in standard Python and supplies pyRevit with a simpler, inspectable geometry format.

Revit reference importer — pyrevit_v2_1_clean_archive_importer.py

Reads the manifest inside Revit and creates visible point crosses, optional labels, axis linework, and polygon boundaries. It converts local meters to Revit’s internal feet and prefers model curves, with a detail-curve fallback when necessary.

The imported geometry allows architectural work to reference the same control framework, footprints, and uncertainty geometry used in the GIS analysis.

Wall creation — pyrevit_v2_2_create_walls_from_manifest.py

Creates native Revit walls directly from selected manifest segments. The user chooses geometry sources, categories, wall type, base level, and unconnected height.

Architectural translation polygons are the intended starting point. Statistical ellipses and control axes remain analytical references unless deliberately selected. Using the manifest vertices directly avoids reconstructing geometry from previously imported drafting curves.

Figures, tables, and research outputs

  • export_plates.py: Configurable spatial plates with layer styling, annotations, scale bars, north arrows, comparison tables, and optional layer exports.
  • methods_parameter_table.py: Methods and appendix parameter tables in CSV, Markdown, and LaTeX, with registry validation and explicit overrides.
  • build_master_results_table.py: Consolidated results, publication tables, and a supporting comparison figure.
  • Supporting figure scripts: Null-distribution, observed-versus-null, RMS, and constraint-sensitivity graphics.

The resulting deliverables span cleaned spatial datasets, simulation coordinates, comparison metrics, publication material, a Revit import manifest, reference geometry, and native wall elements.

Technical foundation

The standalone analysis uses Python, GeoPandas, Fiona, Shapely, NumPy, pandas, and Matplotlib. QGIS/PyQGIS provides the spatial authoring environment. The BIM tools use pyRevit, the Autodesk Revit API, and JSON interchange.

Shapefile and GeoPackage preserve spatial geometry; CSV carries analytical results; the manifest provides the controlled handoff into Revit.

Current position and boundaries

The toolkit contains implementations for data preparation, spatial constraints, Monte Carlo testing, null-model comparisons, sensitivity outputs, publication exports, manifest generation, Revit reference import, and wall creation.

The current manifest builder selects base controls, observed-model geometry, and architectural translation layers; it does not include the cleaned archive’s null-model and sensitivity groups. Its geometry is planar, with exported vertex elevations set to zero, and polygon conversion uses exterior rings. The BIM translation therefore supplies a plan-based modeling foundation rather than a complete terrain-aware reconstruction or lossless GIS conversion.

run_sightlines.py is an unimplemented placeholder. The bridge is a file-based transfer into Revit, with no two-way synchronization.

Sheet

C-206 · BIM/GIS Scripts

Rev

v2.0 · 2026.10