![]() In order to create MapBox friendly 3D dataset, we basically need to extract each of the nested Polygons as an individual one, assign common properties (identifiers etc.), define its height based on Z value of its vertices and store vertices in format. |- coordinates - list of Polygons, each containing list of building vertices in format |- properties - all of the attributes stored in GDF columns Each feature have the following attributes: |- id - database unique identifier We can see it is a FeatureCollection with a list of features. Let’s convert gdf into JSON to explore further the structure of the file. Geometry: Building shape of `POLYGON Z` type. SOURCE_ID: Building shape source identifier. Assigned by City Planning.ĭOITT_ID: Unique identifier assigned by DOITT. NYC 3-D Building Model contains the following information: BIN: Building identification number. Let’s inspect the geodataframe with gdf.head(): ![]() Gdf = gpd.read_file(gdb_path, driver='FileGDB', layer=0) Or if data is in a GeoDataBase format: import fiona Now let’s load data into GeoDataFrame: gdf = gpd.read_file('>.shp') To start we have to import necessary libraries, which are: JSON, GeoPandas and Shapely. In order to work I needed to somehow decompose this nested collection of polygons and tease out height value. It requires plain 2D polygons defined by XY coordinates and assigned height information, which then can be used as an extrusion value. The only problem is that MapBox does not support Multipatches with XYZ coordinates. A collection that can be made up of triangle strips, triangle fans, triangles, or rings, multipatch features can be used to construct 3D features in ArcGIS®, save existing data, and exchange data with other non-GIS 3D software packages such as Collaborative Design Activity (COLLADA) and SketchUp®. The multipatch data format, a geographic information system (GIS) industry standard developed by ESRI in 1997, is a geometry used as a boundary representation for 3D objects. In this case we decided to build our own city model which could be extruded by MapBoxGL engine.Īs a basis for our model I chose NYC 3-D Building Model provided by NYC DOITT. The only problem was that, we needed to edit and interact with this layer in our tool. Especialy, that MapBox introduced extrusions to display building heights ( here is tutorial). Since we were already using eneterprise account of Carto as a data server and MapBox as a visualization platform (BTW, they are pretty nicely integrated), we decided to stick with it. ![]() ![]() There were already existing efforts trying to accomplish just that such as CesjumJS or OSMBuildings. It makes sense to use this function to group a collection of 3D polygon faces into a single multipatch polyhedron.While working on NYC Energy & Water Performance Map for NYC Mayor’s Office of Sustainaility we thought that it would be cool to display actual building shape in 3D rather than just the plain footprint outline. In this case, what is the advantage of the conversion? If grouping by ObjectID then you will have the same number of entities - i.e one multipatch for each polygon. You can check whether the geometry is MULTIPATCH or POLYGON on the Feature Layer Properties -> Source -> Geometry. You report that your "output had the same amount of entities only they all were having the same geometry." It lists several other caveats why the conversion might not work. They have no fixed orientation that can be used for exporting. The position of these 2D symbols areĭynamically oriented to face the camera position in a 3D scene, so The Layer 3D To Feature Class docs for ArcGIS Pro state "[Marker One clue is that you are converting billboards. Without more information, we cannot be sure why it failed in this case. There are many reasons why 'Layer 3D To Feature Class'will fail.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |