A web-based GeoJSON analysis tool for computing geometric properties of building polygons, including orientation, shape metrics, and entrance accessibility analysis.
- Area Calculation: Accurate geodesic area computation in square meters
- Roundness Index: Circularity measurement (4π × area / perimeter²)
- Centroid Calculation: Geographic center point (WGS84)
- Major Axis Orientation: Principal component analysis-based azimuth angle (0-360°, clockwise from North)
- Entrance Analysis: Distance and bearing to nearest building entrance
- Interactive Map: MapLibre GL JS with OpenFreeMap vector tiles
- Building Overlays: Semi-transparent polygons with orientation arrows
- Entrance POIs: Black circular markers for
entrance=mainandentrance=yes - Connection Lines: Blue lines from building centroids to nearest entrances
- Rose Diagrams: Dual polar charts showing building orientation and entrance direction distributions
- CSV Download: Complete dataset with all computed metrics
- Statistical Summary: Count, sum, mean, standard deviation, min, max for all features
https://mapconcierge.github.io/BuildingShapeAnalyzer2025/
<<<<<<< HEAD
- Upload GeoJSON: Click the file input and select a GeoJSON file containing building polygons (EPSG:4326)
- View Analysis:
- Buildings appear as teal polygons with red orientation arrows
- Arrow length = 2× building's major axis
- Blue lines connect buildings to nearest entrances (within search radius)
- Explore Data: Click any building to see detailed metrics in a popup
- Download Results: Click "Download CSV" to export all computed data
| Metric | Description | Unit |
|---|---|---|
area_sqm |
Geodesic area | m² |
roundness |
Circularity index (1.0 = perfect circle) | - |
centroid_lon |
Centroid longitude | degrees |
centroid_lat |
Centroid latitude | degrees |
orientation_deg |
Major axis azimuth | degrees (0-360) |
axis_length_m |
Major axis length (2× max centroid distance) | meters |
entrance_distance_m |
Distance to nearest entrance | meters |
entrance_bearing_deg |
Bearing to nearest entrance | degrees (0-360) |
entrance_type |
Entrance classification | main/yes |
- MapLibre GL JS (v3.6.2): Map rendering
- Turf.js (v6.5.0): Geospatial calculations
- Chart.js (v4.4.0): Rose diagram visualization
- Overpass API: Real-time entrance data retrieval
- Client-side only: No server required
- Single HTML file: All code embedded for easy deployment
- GitHub Pages ready: Deploy directly to
/docsfolder
- Source: OpenStreetMap via Overpass API
- Query:
node["entrance"="main"]andnode["entrance"="yes"] - Search Radius: 2× building major axis length
- Priority:
entrance=main→entrance=yes - Update Trigger: Map movement at zoom ≥16
- Orientation: Principal Component Analysis (PCA) of polygon vertices
- Area: Turf.js geodesic area calculation (accounts for latitude distortion)
- Roundness: Polsby-Popper compactness measure
- Bearing: Turf.js bearing calculation (origin: centroid, destination: entrance)
- Bins: 16 directions (22.5° each)
- Color: Teal (#088888)
- Interpretation: Shows preferred building alignment (e.g., street grid patterns)
- Bins: 16 directions (22.5° each)
- Color: Dark blue (#000099)
- Interpretation: Shows entrance accessibility patterns relative to building positions
- Zoom/Pan: Standard map navigation
- POI Layers: All non-entrance POIs hidden for clarity
- Base Map: OpenFreeMap Liberty style (vector tiles)
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [[[lon, lat], ...]]
},
"properties": {
"name": "Building Name",
...
}
}
]
}- CRS: EPSG:4326 (WGS84)
- Geometry: Polygon or MultiPolygon
- Properties: Optional (preserved in output)
All original properties plus computed metrics (see table above)
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
- Place
index.htmlin/docsfolder - Enable GitHub Pages in repository settings
- Select
mainbranch and/docsfolder - Access via
https://username.github.io/repository-name/
Simply open index.html in a browser. No build process required.
- Entrance Data: Requires internet connection for Overpass API
- Performance: Large datasets (>1000 buildings) may slow entrance processing
- Search Radius: Entrances beyond 2× major axis length are not connected
- Rate Limiting: Overpass API has usage limits (25s timeout per query)
- Urban planning analysis
- Building orientation studies
- Accessibility assessment
- Architectural pattern recognition
- Street network alignment research
This tool is provided as-is for educational and research purposes.
- Map Tiles: OpenFreeMap
- Entrance Data: OpenStreetMap contributors
- Libraries: MapLibre GL JS, Turf.js, Chart.js
v6.0 - November 2025
Contributions welcome! Please open an issue or submit a pull request.
For questions or issues, please open a GitHub issue with:
- Sample GeoJSON file (if applicable)
- Browser and version
- Description of the problem =======
617831e8ba2e200892b6327495c5b721e1d8ae79