ArcGIS Blog

3D Visualization & Analytics

ArcGIS Pro

Transform 2D building footprint polygons into 3D buildings using 3D Object Feature Layer

By Maggie Uehling and Rodney Chin

3D technology has made exceptional improvements that have turned basic shapes into realistic objects. The applications of 3D continue to expand with users applying 3D to topics such as digital twins, architecture, and emergency management. With advancements, users are moving to 3D for nuanced analysis, visualizations, and mapping.

Previously, I wrote about how to add 2D features into a 3D scene. That was to help users dabbling in 3D GIS for the first time and adjusting 2D data for 3D visualization. But how do you officially convert 2D z-aware features, such as building footprints, into 3D features?

In this blog article, I will continue with the Tennessee Tech University mapping and cover how to transform 2D features into multipatch and 3D object feature layers (3D-OFL). I’ll demonstrate two methods: the Layer 3D to Feature Class tool and Copy-Paste Special. The Layer 3D to Feature Class method can be run for point, line, and polygon features, but Copy-Paste Special also works with extruded polygon features.

3D scene of Tennessee Technological University campus

For this project, I’m focusing on building footprint polygons. A few important points: this data source was created in ArcGIS Pro, the data is z-aware, and displayed in a 3D local scene. Since I plan on creating new data, I’m going to work in a local scene rather than a global scene. For more information on local scenes, see Scenes in the ArcGIS Pro help..

To follow with this workflow, find an area you want to work in and create a z-aware polygon feature layer in a local scene for building footprints and generate a few examples to work with. For steps on this, see How to add 2D features to a 3D scene.

Prepare the 2D features

Now that I have created a few examples, I must prep the data. First, I establish a height for the buildings polygon layer. One way to accomplish this is by adding a new field to the attribute table for height, and then input different values for a range of heights. This will create a more realistic and diverse look for the university campus.

Attribute table with Height field added

Extrude the polygons

Extrusion is the process of stretching a flat, 2D shape vertically to create a 3D object in a scene. For example, you can extrude building polygons by a height value to create 3D building shapes. Only points, lines, and polygons support extrusion. For more information, see Extrude features to 3D symbology.

To alter the feature layer’s extrusion setting, select the layer in the Contents pane, browse to Feature Layer on the ribbon, and click the down arrow for Type in the Extrusion section. I selected Base Height because I want the vertices of my polygon to act as the base for my new 3D building. From here I choose Height on the Field drop-down menu and US Feet on the Unit drop-down menu. This approach uses the Height attribute that I created from that layer’s attribute table as the parameter for the new 3D buildings. As soon as I select the Height attribute, all polygons are extruded to the height determined in the attribute table.

Base Height extrusion type

Alternatively, if you want your polygons to be the same height value without an existing field in your attribute table, click Extrusion Expression  in the Extrusion section of the ribbon to open the Expression Builder pane. Type a value in the Expression text box, for example, 15. Click OK. Doing this will extrude all polygons on the selected layer to a constant uniform height, in this case, 15 U.S. feet.

Polygon buildings set to a height value of 15

Using either option will allow you to extrude your footprints into a 3D shape. Keep in mind these extruded shapes look like 3D models, but they are still considered polygons in ArcGIS Pro. This means you will not be able to texture the shapes, edit the shapes, or perform any operations that specifically work with 3D objects. You must complete another step to transform them into either a multipatch or a 3D object.

Method 1: Layer 3D to Feature Class Tool

With the data prepped and ready to use, there are two methods to transform the 2D feature data into 3D: geoprocessing tools or Copy/Paste SpecialCopy/Paste Special will be discussed in the next section. If you choose the geoprocessing route, the options are Layer 3D to Feature Class and Interpolate Polygon to Multipatch. I recommend the Layer 3D to Feature Class (3D Analyst) tool over Interpolate Polygon to Multipatch, because it works with more than one feature class and can be used on points, lines, and polygons, but keep in mind both geoprocessing tools require the 3D Analyst extension for ArcGIS Pro.

To access the Layer 3D to Feature Class tool, click the Analysis tab on the ribbon and click the Tools button to open Geoprocessing pane. In the Geoprocessing pane, browse to the Toolboxes tab, expand the 3D Analyst Tools section, expand the 3D Features section, expand the Conversion toolbox to access the Layer 3D to Feature Class tool (Alternatively, you can do a quick search in the Find Tools bar).

Location of Layer 3D To Feature Class

Click the tool and the Layer 3D To Feature Class pane appears. Select the polygon layer for Input Feature Layer and notice that it automatically populates a name in the Output Feature Class parameter. You can either modify the name of the output or use the default name. I’m going to use the default name for now.

Layer 3D To Feature Class Pane

Click Run at the bottom of the pane and give the tool a few moments to process your request. When it’s finished processing, a new multipatch feature layer appears in the Contents pane that contains the new buildings. From here, you can texture, perform analysis, or edit the buildings further using Editing tools.

 

Method 2: Copy-Paste Special

This method works primarily on polygon feature classes. For this method, I create a new empty feature class and paste the data inside. This method doesn’t require an extension and allows you to translate data into any 3D feature class type (multipatch or 3D-OFL). If you want a 3D object feature layer (3D-OFL), Copy-Paste Special will allow you to bypass the multipatch to 3D-OFL conversion and directly paste 2D data into a 3D-OFL. Also, 3D-OFL has more options to work with and room to grow in comparison to a multipatch feature class. For this example, I’m going to work with a 3D-OFL.

First, create a 3D-OFL from scratch. Create a new feature class by right-clicking the geodatabase and selecting New, and then clicking Feature class. For Feature Class Type, select 3D Object and click Next.

Create Feature Class Pane

For Fields, click Import at the top and navigate to the original feature class that contains the data. Fields from the original attribute table will be added, and any unnecessary fields can be removed by right-clicking the fields and selecting delete. It is important to match the desired fields of the created feature class with the original to maintain the data schema. If the fields match the data will transfer over, but data without a corresponding field will be lost which is time consuming to fix later. You can also define the spatial reference using the wizard.

With the fields matching, click Finish, and a new 3D object feature layer is created.

To select features, click Select in the ribbon bar and manually select features to copy. Once they are selected in the local scene, right-click to copy the features. This will copy your selection to the clipboard. Then browse to the Edit tab on the ribbon and go to the Clipboard section.

Editing Ribbon

Click the Paste down arrow and select Paste Special. This opens the Paste Special window that allows you to choose where the copied data will go. Choose the newly created 3D-OFL template and click OK. Once the data copies from the clipboard, you will see a translation tool (red, blue, and green arrows) appears at the center of the data. Optionally, move the features and click Finish to apply the translation. Note that Ctrl C and CTRL V keyboard shortcuts will not work in the same manner as using the dedicated button.

Paste Special Pane

My buildings data has successfully been moved into my 3D-OFL, so I can now turn on all my layers for a 3D map of the Tennessee Tech campus.

3D scene of Tennessee Technological University campus with 3D object feature layers

I have a newly created and populated 3D-OFL and can now print, publish, or conduct 3D analysis, mapping or altering the features with modify tools and symbology.

You can provide feedback and suggest other topics that you want to learn about in the Esri Community. Check out the 3D tutorials such as Model a 3D city block and Create realistic 3D urban scenes or sign up for a training course to expand your 3D capabilities.

Licensing information

ArcGIS Pro Basic, Standard, or Advanced: Requires 3D Analyst

Share this article

Subscribe
Notify of
0 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Carissa Choong(@cchoongsidwell)
November 9, 2021 11:08 am

This script is going to be such a huge help but I am running into an error when I run the script as coped: it says that: name “GetParameter” is not defined. Is it because I am running ArcGIS Pro 2.4 perhaps? Thanks!

Katarina Hirai(@khiraisl)
November 18, 2021 11:56 am

Anyone try this? I can’t get the Time Zone to set correctly. After publishing, the feature service reflects UTC for our data’s date fields even though I set the “timezone” parameter to “Pacific Standard Time”.

Yuguang Liu(@yuguangl_uom)
January 23, 2022 7:55 pm

Hi there,

I have created the publish web feature layer, but the input is “map”. What I want to select and publish is a “layer” in the content pane. Could you please tell me how to solve the problem? Thanks in advance.

Best
Leo

James Shreeve(@jshreevesnorfolk)
January 31, 2022 6:08 am
Reply to  Jonah Lay

Hi Jonah, you sent me to this blog from another post last week (thank you!) and I’ve been working through the above and have come across the same problem as Leo. I’ve had a look at the code sample you supplied, is there a way to create a script tool using that code or does it need to be run as a standalone Python script? Or is there a way to alter the code for this blog to look at features rather than map files? Many thanks in advance

Robert Thomson(@miramichiadministrator)
January 24, 2022 12:22 pm

This is great but I can only get it to work if I leave share_groups blank or just use one group name. Otherwise I get 0x800 “This value is not a member of” Any ideas? I’m separating group names with commas. I’m running ArcGIS Pro 2.9.

Robert Thomson(@miramichiadministrator)
January 25, 2022 8:42 am
Reply to  Jonah Lay

That was all I needed, thanks.

Nicholas Gray(@graynic)
February 10, 2022 1:46 pm

Thank you very much for posting this! Is there a way to set the Portal connection where the data will publish to? It looks like it defaults to whatever Portal you are/were signed in to last. I have several Portal/ArcGIS Online connections in Pro but would like to specify which one it publishes too. I plan on setting this up as a scheduled task so I need to make sure it publishes to the right Portal. Thank you!

jonathan molineaux(@jonathan-molineaux_noaa)
February 24, 2022 5:13 am

Thank you for posting this article. I am having an issue with seeing my Portal connection in the output folder though. Is there a workaround for this? If I add the SignInToPortal ArcPy function, will this allow me to view the Portal Connection in my output folder?

Last edited 3 years ago by jonathan molineaux
Evan Marshall(@evan-marshallci-stpaul-mn-us_stpaul)
April 1, 2022 8:02 am

Hello, I implemented this script tool and generally it works well. We do have a weird issue where if we try to use it to overwrite an existing hosted table, it works, but converts the item to a hosted feature layer. We need these items to persist in AGO as hosted tables. Any thought to adding a parameter to tell it to overwrite as a table rather than a service? or choose no geometry type? thanks!

Wilson, Jared(@jcwilson4_ncdenr)
April 8, 2022 11:24 am

I’ve downloaded and used the model as it is used in the demonstration map and it uploaded the layer directly to my AGOL content pane, however, when I attempt to run the Publish Web Feature Layer in my own map, the tool runs for a very extended period of time seemingly without end. Is there an option I should be selecting that is different? I selected to run the tool exactly how I had it in the demo as well.

steve miller(@suasteve)
April 26, 2022 7:35 am

I’ve downloaded the script and got the Model working with one exception, I have a date field and I can’t get it to publish in Eastern Time Zone. What should I be putting in the Time zone parameter? I’ve tried EDT and Eastern_Daylight_Time, but the date field in the web layer is showing UTC. As a side note, when I query the AGOL rest the date field is in EDT.

Thank
Steve

Julia Hillin(@jhillin)
June 24, 2022 11:40 am

I’ve tried running this script but I get a traceback error to lines 30, 68, and 122 and a ValueError: Missing target server. I copied the script over directly and used the correct inputs/configurations, so I’m not sure what the issue is. Any ideas?

Last edited 3 years ago by Julia Hillin
Michael Olkin(@swscgisadmin)
November 2, 2022 9:45 am

I have successfully run this script within a model in a project, but I have not yet had success running it as a scheduled task. Here’s the error that I see in the log after attempting to run it as a scheduled task:

<msg code=”100″ type=”-2147467259″>Failed to execute. Parameters are not valid.</msg><msg code=”100″ type=”735″>The value is empty. ERROR 000735: Map: Value is required</msg>

I have checked and re-checked the script and parameters, but all appears to be set up correctly.

Nicholas Gray(@graynic)
December 13, 2024 9:41 am
Reply to  Michael Olkin

@Michael Olkin did you ever fix this issue? I am experiencing the same thing. I can run the model fine and it publishes but when I schedule it I get this same error. @Jonah Lay Thank you!

Amin Alhassan(@amin-alhassanloudoun-gov_loudounps)
August 9, 2023 10:18 am

Hello Jonah,
Thanks for sharing this script, it’s still “golding” to me. I have adapted it and tried to set the time zone to Eastern Standard Time or ET,EST and all the ways I can imagine the eastern standard time; yet, the time aware data after publishing still shows UTC time values. I have read others comments on the same issue. Are you able to look into that or any other work around. I really appreciate the effort put in.

Thanks,
Amin

Amin Alhassan(@amin-alhassanloudoun-gov_loudounps)
August 15, 2023 10:36 am
Reply to  Jonah Lay

Thanks Jonah, it worked at last. Any thought on overwriting a stand alone hosted feature layer in AGOL? This did not set the time zone but the feature was overwritten when I tried on a hosted feature layer not in a web map.

Carlos Alberto Duarte Carranza(@caduarte_vrip)
September 25, 2023 11:46 am

Dear Jonah,
Thanks for this great and absolutely useful tutorial!
I have a model which ends with a feature layer as output. How can I connect my model with the model in your tutorial to publish (only) my output feature to AGOL?

Thanks in advance!

Carlos

Andrew Ferguson(@andrew-ferguson_whg)
October 9, 2023 3:31 am

Dear Jonah, Thank you. This is an excellent article. I’m having some difficulty publishing a single feature via a model I’ve created. I’ve modified the code to select my layer with “selected_layer = m.listLayers()[0]” and provided this variable within a list as a parameter in the m.getWebLayerSharingDraft() function however I am getting the error: Error 001272: Analzer errors were encountered ([{"code":"00102", "message":"Selected layer does not contain a required layer type for web feature layer", "object":"Map"}]). I can manually publish the layer to AGOL without any analyser errors though. Can you offer any insight as to why this is happening? Thanks… Read more »

Adam Hart(@ahart_midlandcounty)
July 3, 2024 11:25 am

Jonah,

This is a great tool and I am hoping to use it with some of our data. I have one question…How would the code be modified to overwrite a layer with attachments? The steps in the model work fine to add the attachments to the feature class, but I’m having trouble trying to overwrite the AGO layer with the updated attachments. Any help would be greatly appreciated. Thanks