ualsg / hdb3d-code Goto Github PK
View Code? Open in Web Editor NEWCode to generate the 3D city model of Singapore public housing (HDB) buildings from open data
License: MIT License
Code to generate the 3D city model of Singapore public housing (HDB) buildings from open data
License: MIT License
Should you wish to do a smaller area, say a suburb or campus: overpass and osm2geojson might be useful.
query = """
[out:json][timeout:30];
// area-of-interest here
area[name='Cape Peninsula University of Technology (Bellville Campus)']->.a;
// --when areas have duplicate names given the world has a limited amount of uniquely named places
// --main area
//area[name="Western Cape"]->.b;
// -- target area ~ can be way or relation
//relation(area.b)[name="Woodstock"];
//map_to_area -> .a;
(
(
// I want all buildings
way[building](area.a);
// plus every building:part
way["building:part"](area.a);
// and relation type=multipolygon ~ to removed courtyards from buildings
relation["building"]["type"="multipolygon"](area.a);
);
-
// excluding buildings with relation type=building role=outline
// to remove outlines that surround building:part
(
// for every way in the input set select the relations of which it is an "outline" member
rel(bw:"outline")["type"="building"];
// back to the ways with role "outline"
way(r:"outline");
);
);
out body;
>;
out skel qt;
"""
url = "http://overpass-api.de/api/interpreter"
r = requests.get(url, params={'data': query})
#rr = r.read()
gj = osm2geojson.json2geojson(r.json())
will you give you what you need. Hereafter you can continue with a slightly modified hdb2d.py. The image below as an example of the result.
Courtyards are correct with features in courtyards retained (bottom left) and buildings with correct height when building:part have a different height to the outline (above half-way up on the right). notebook here.
Thank you for this wonderful resource.
Hi, ath the moment I'm using mapbox for a personal project. In the readme you show that it's possible to visualise cityjson data in Mapbox. I can't find any tutorials for how to do this. Hopefully you can help me and explain how to use Mapbox with cityJson :).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.